How to support versioning?
Closed this issue · 7 comments
With the other docusaurus typedoc plugin, versioning worked automatically, as the api docs were just a folder with MD files. How can it work with this plugin?
This plugin currently doesn't support versioning.
Docusaurus doesn't provide any utilities for versioning, so I would have to roll my own implementation, which is a lot of overhead that I just don't have the time for right now. For example, just try and untangle how versioning works for docs: https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-plugin-content-docs/src/index.ts
The plugin you linked works very differently from mine, as it's generating the TypeDoc docs using the TypeDoc templates, and injects them into Docusaurus' build. Mine generates TypeDoc as JSON, then renders it using custom React components, coupled with native Docusaurus components, and wires up Docusaurus routes.
With that being said, this is something I also want, so it will happen eventually.
Yes, I know the difference, hence asking how it can be supported. It is quite important for us, so we might end up forking and trying to hack it somehow (and PR it back if you'd be interested). I guess it could work by versioning the JSON file that typedoc generates, and handling things dynamically same way as they work now?
For example, just try and untangle how versioning works for docs
Well, I don't know about the source code, but in v2 it is quite simple, each version is a full snapshot of the docs, and here it could work the very same way (each version being typedoc JSON file). It feels quite easy to achieve (everything should be reused frontend-wise), but I will need to first try myself :]
Yeah in theory that's how I expected it to work also. Something like versioned_docs/version-x.x/typedoc.json
. Ideally it would be nice to piggyback off of docs:version
, but I don't think that's possible.
But yeah, open to a PR.
Before I dive too deep myself, I wanted to ask whether you would be up to implement this for some GH sponsorship (or if you can provide an invoice, that obviously work for us too)?
Ok got enough of it working and tested, so I'm gonna land it. We should definitely iterate on it over time as I'm sure there's stuff I missed.