milesj / docusaurus-plugin-typedoc-api

Docusaurus plugin that provides source code API documentation powered by TypeDoc.
69 stars 25 forks source link

Integrate the sidebar into an existing sidebar #128

Closed ManuelRauber closed 7 months ago

ManuelRauber commented 7 months ago

Hi,

After getting the plugin to run, it provides a so much better output than the other plugin.

However, there are two things, that I'm missing:

Using the other plugin, I can easily integrate the output into my existing sidebar: image

The other plugin has generated everything below the "TypeDoc" sidebar.

At the moment, there are maybe two possible solutions:

  1. Generate a static sidebar.js (this is what the other plugin is doing)
  2. Customize the sidebar generator: https://docusaurus.io/docs/sidebar/autogenerated#customize-the-sidebar-items-generator

Do you think it would be possible?

milesj commented 7 months ago

Can probably generate a file.

ManuelRauber commented 7 months ago

Hi @milesj

Thanks for the quick implementation!

I just tried it out and the sidebar can be integrated.

However, when you click it, it switches the complete sidebar to only the generated one.

I guess that's because we're changing the route to /api.

Do think there is anything that can be done in order to not switch the sidebar?

It may only be possible if you would generate files? Is there a reason not to generate MDX files for TypeDoc? From what I see you should have everything, and possibly just needs some serialization to the disk? That would also easily solve #127

milesj commented 7 months ago

You can't change the sidebar of /api routes. I'm also not entirely sure that's possible. Feel free to submit a PR though.

As for why it's not markdown. Because our custom built React components offer far more functionality than markdown can provide. This plugin was also built way back when typedoc had far less features, and wasn't jsx based.