shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.87k stars 1.28k forks source link

Ability to Generate Automatic Docs like typedoc #1025

Open Murtatrxx opened 1 year ago

Murtatrxx commented 1 year ago

Nextra is great. But when it comes to automatic documentation generation from set files, it cant. Could you guys add something integrates with typedoc?

dimaMachina commented 1 year ago

We need to wait to support mdx 2 for typedoc plugin markdown https://github.com/tgreyuk/typedoc-plugin-markdown/issues/305

twlite commented 1 year ago

typedoc-plugin-markdown did not work well for me so I built my own transformer called typedoc-nextra which serializes typedoc's json into markdown https://npm.im/typedoc-nextra

Murtatrxx commented 1 year ago

🤨 Interesting

balazsorban44 commented 1 year ago

@B2o5T You can add format: "detect" since: https://github.com/shuding/nextra/pull/1296

After I looked at it, there seems to be no reason to use MDX anyway.

dimaMachina commented 1 year ago

@balazsorban44 ah you are totally right, and we use already format: detect in loader

https://github.com/shuding/nextra/blob/ea6a6450939e35e6510993da19caabf265cd2be4/packages/nextra/src/loader.ts#L153

transitive-bullshit commented 1 year ago

@balazsorban44 following this thread right now. Is there a good reference implementation of using nextra with typedoc that I can take a look at?

Specifically, typedoc's output with typedoc-plugin-markdown outputs folders in a way that I'm not sure is well suited to nextra.

Thanks! 🙏

balazsorban44 commented 1 year ago

Check out the typedoc-plugin-markdown@next version of the TypeDoc plugin, I find it perfect, and there's basically nothing to do on the Nextra side just generate the content into the pages folder.

n1ru4l commented 1 year ago

From #1511:

It would be great for TypeScript library authors to have a built-in/additional library solution for generating neat TypeScript code definitions.

For docusaurus, we have something like milesj/docusaurus-plugin-typedoc-api@master/packages/plugin/README.md (Demo: boostlib.dev/api)

Our needs are both for single package repositories and mono repositories.