Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't auto-generate a sidebar #251

Closed
samarmeena opened this issue Sep 16, 2021 · 11 comments
Closed

Can't auto-generate a sidebar #251

samarmeena opened this issue Sep 16, 2021 · 11 comments

Comments

@samarmeena
Copy link

Before recent update

image

After recent update

image

Config

plugins: [
    [
      "docusaurus-plugin-typedoc",
      // Plugin / TypeDoc options
      {
        entryPoints: ["../src/index.ts"],
        tsconfig: "../tsconfig.json",
        excludePrivate: true,
        excludeExternals: true,
        excludeProtected: true,
        readme: "none",
      },
    ],
  ],

Not sure about the actual issue, please provide a solution.

Thank you

@tgreyuk
Copy link
Member

tgreyuk commented Sep 18, 2021

In your sidebars.js please replace:

API: require('./typedoc-sidebar.js'),

with:

'API': [
      {
        type: 'autogenerated',
        dirName: 'api', // 'api' is the 'out' directory
      },
    ],

I will update the README.

@samarmeena
Copy link
Author

In your sidebars.js please replace:

API: require('./typedoc-sidebar.js'),

with:

'API': [
      {
        type: 'autogenerated',
        dirName: 'api', // 'api' is the 'out' directory
      },
    ],

I will update the README.

image

Sidebar.js

...
    {
      type: "category",
      label: "API",
      items: [
        {
          type: "autogenerated",
          dirName: "api", // 'api' is the 'out' directory
        },
      ],
    },
...

Issue not resolved

It's important to delete old API folder before running npm run build to reproduce this issue.

Question

is there way to disable typedoc-sidebar.js file generation?, because that is not required.

@samarmeena
Copy link
Author

samarmeena commented Sep 18, 2021

Steps to reproduce issue

  1. Execute git clone https://github.com/oceanroleplay/discord.ts.git
  2. cd docs
  3. update all dependencies to latest (ncu -u, later npm install)
  4. make necessary changes as per new update in docusaurus-plugin-typedoc
  5. Execute npm run build
  6. Execute npm run serve
  7. Navigate to http://localhost:3001/discord.ts/docs/installation

Issue

Sidebar API category is missing (Below is example output of sidebar if correctly build)
image

@tgreyuk
Copy link
Member

tgreyuk commented Sep 18, 2021

Thanks i found out what the problem was. fix in 0.16.2. Have tested on your repo and appears to build fine now. Have also removed sidebar generation but actually that was as a bit of a red herring.

@tgreyuk tgreyuk closed this as completed Sep 18, 2021
@tgreyuk tgreyuk reopened this Sep 18, 2021
@tgreyuk
Copy link
Member

tgreyuk commented Sep 18, 2021

Please close if you are happy or let me know if still an issue..

@samarmeena
Copy link
Author

I am testing now, will update in few mins.

@samarmeena
Copy link
Author

samarmeena commented Sep 18, 2021

@tgreyuk it appear that, api docs are generated correctly, but sidebar is still not generated.

image

With sidebar config

...
    {
      type: "category",
      label: "API",
      items: [
        {
          type: "autogenerated",
          dirName: "api", // 'api' is the 'out' directory
        },
      ],
    },
...

@tgreyuk
Copy link
Member

tgreyuk commented Sep 18, 2021

ok thanks - strange - if docs are generated then assume it is some kind of docusaurus config issue. will have a proper look later.

@samarmeena
Copy link
Author

@tgreyuk any ETA for fix? This is holding up the upgrade of dependencies in our project.

@tgreyuk
Copy link
Member

tgreyuk commented Sep 21, 2021

@OceanRoleplay have made a few amends in 0.16.3. Have followed the steps above and all looks good to me - sidebar is displayed as expected:

Screenshot 2021-09-21 at 22 26 29

@samarmeena
Copy link
Author

@OceanRoleplay have made a few amends in 0.16.3. Have followed the steps above and all looks good to me - sidebar is displayed as expected:

Screenshot 2021-09-21 at 22 26 29

Wow, that's wonderful. Maybe I had got something wrong. Now it's working alright.

Thank you for your help and support, closing issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants