Documentation Porting - Take 2 #20140
Replies: 6 comments 14 replies
-
https://github.com/thejcannon/pantsasaurus is my repo demonstrating this. |
Beta Was this translation helpful? Give feedback.
-
It seems how we do the versioning is the biggest open question? |
Beta Was this translation helpful? Give feedback.
-
Do we have any statistics on what % of users are on older Pants versions? Is it significant enough to warrant keeping docs for more than say previous/current/next, at most? |
Beta Was this translation helpful? Give feedback.
-
Thank you for diving into this, it is valuable work. I'm really excited for it! This scheme seems fairly different to what I'm used to with software that does release branches like Pants. Pants isn't just "constant releases from For other software that's like Pants that I'm familiar with (for example, Rust, Swift, CPython?), there's typically a split between:
I imagine we could apply this model to Pants too, e.g.:
We've been chugging along seemingly okay with manual doc site updates (and no previews etc.) for all releases up to now, so I think we can aim for that bar for MVP of the new process, with a plan for how to improve. That is, the "automation" could be a human running the appropriate command and committing the output to the
(I don't think we'd be wasting work by staging it like this, we'd just start seeing the benefits sooner without having to solve everything at once.) What do you think? Can you do a compare-and-contrast of the approaches? |
Beta Was this translation helpful? Give feedback.
-
For a website migration, a question that pops up for me is always: will it break existing URLs? Two comparisons (for ease of comparison, I've replaced
So it looks like we might have some path differences ( I could also imagine the details of some "slug" computations either in paths or fragments might differ in some edge cases (e.g. the various headings on https://www.pantsbuild.org/docs/awslambda-python have punctuation and formatting and numbers, and the fragments for the reference docs often seem to end up bracketed by What sort of options do we have for smoothing over this change? |
Beta Was this translation helpful? Give feedback.
-
The new docs/blogs sites are now live. 🎉 |
Beta Was this translation helpful? Give feedback.
-
Alright, so as a follow up to #19553, docs porting is still something I'm working towards, and closer than ever, however it won't be mkdocs-based.
Introducing Docusaurus.
Why Docusaurus?
Overall Strategy
main
main
will always contain the support files and "evergreen" pages (list of maintainers, sponsorship info, etc...).Additionally, it will contain the docs for the version
main
represents.release branches
Release branches will have the docs included and some (namely release branches made after this switch) will include now-obsolete support files and "evergreen" pages.
Local builds
Anyone will be able to run
npm start
in the docs directory to run a local hot-reloading version of the docs site.Versioning
We can choose between docs-host-versioning and tool-versioning. In order to support "evergreen" pages, and cohesive UI/UX for version selection, the tool-versioning seems most attractive.
(Here's Docusaurus' docs: https://docusaurus.io/docs/versioning)
Note that the tool doesn't fit our use-case well. Each copy of the versioned docs has to live in the same tree. That would mean naively, all versions of our docs would live on
main
.Therefore, instead we'd need a "build" process when publishing the full docs that would look something like:
main
main~1
into the docs dirReference docs
The "reference" docs are generated from running
help-all
in the Pants repo with a specified set of plugins enabled. That means the above process will need sub-steps to runpants help-all
to first generate the reference docs for that branch, then version and move on.We'll likely want/need a strategy to not run this process on "dead" branches. Both for the savings in build time as well as complexity (the
help-all
output likely has and will change, meaning we would need to maintain multiple "generator" templates).Blog
Docusaurus supports having a blog, so the plan is to port it because it's feeding two birds with one scone.
Existing URLs
I'll generate a sitemap from the existing docs and we can easily host a big redirect script
Beta Was this translation helpful? Give feedback.
All reactions