-
Notifications
You must be signed in to change notification settings - Fork 55
Migrate docs from mdbook to docusaurus #692
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
Conversation
chore: improve explanation of PAT inside of new trigger-deploy-docs workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
I've noted a couple of small changes I'd like to make. Could you also do the following in Makefile.toml:
- Rename the
docstask tointernal-docs, and- Change it's category to
Documentation - Update it's description to
Builds the internal compiler documentation
- Change it's category to
- Create a new task called
docsjust aboveinternal-docswith the following definition:
[tasks.docs]
category = "Documentation"
description = "Opens the public compiler documentation"
dependencies = ["docusaurus"]
cwd = "./docs/external"
command = "npx"
args = ["start:dev"]
[tasks.docusaurus]
category = "Build"
cwd = "./docs/external"
command = "npx"
args = ["install"]|
|
||
| on: | ||
| push: | ||
| branches: [next] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to only trigger this workflow if files in the docs directory change, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely agreed, will fix!
|
|
||
| steps: | ||
| - name: Send repository_dispatch to aggregator | ||
| uses: peter-evans/repository-dispatch@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's pick a specific SHA revision of this action - depending on tags (which are mutable) is extremely risky when secrets are involved. We need to do this with our other uses, but I don't want to add any new GHA dependencies without selecting a revision that we've reviewed ourselves and vetted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely agree with you on this one. I will pick a specific SHA ref and we can review it for safety.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we plan on taking this SHA ref?: a628c95fd17070f003ea24579a56e6bc89b25766
It's the latest version that was released yesterday.
|
@Keinberger You'll also have to make sure commit signing is turned on and sign your commits, let me know if you need any help getting that set up - I think all of our repos currently require it in order to merge, and while I can bypass it for this PR, you'll need to get that set up anyway, so we may as well do it now 🙂 |
chore: only trigger deployment workflow upon changes to docs folder
|
Hey @bitwalker , I implemented the changes you asked for. Also implemented signed commits, my last commit is signed as you can see. Furthermore, based on discussions I had with Philipp and Bobbin on the Docusaurus PR on the
|
|
Shit, I just remembered I wasn't supposed to merge this 🤦 - @Keinberger will there be any issues once the other repos are migrated? |
|
Yeah we have to revert the merge, otherwise the current Miden Books deployment will fail. Merging can only be done once all PRs are ready and everything is ready to be migrated to Docusaurus. |
|
@bitwalker Next time when something like this happens, please go ahead and revert the merge immediately. Our Miden Book updated overnight and in that process the compiler docs were lost because it couldn't recognize the Docusaurus format (all other repos are still using mdbook). I had to create #700 here and also manually revert the automated commit on the miden-docs repo to revert this change and make sure everything works again... |
Summary
This PR migrates the existing documentation from mdbook to Docusaurus. This includes syntax changes and structural updates.
🚨 DO NOT MERGE YET 🚨
Merging this PR before all other Docusaurus PRs are ready will break the docs deployment! Also, merging has to be done in correct order to ensure a smooth transition!
Note
docs/src.docs/src/external, internal docs inside ofdocs/src/internal.Questions & Clarifications
I kept the md files inside of
docs/src/internalto keep supporting mdbook, so that the internal docs can be hosted as an mdbook on 0xmiden.github.io/miden-node/. These files are files that are currently not exported to the Miden book.That said, I believe it would be better to migrate these files to Docusaurus syntax as well. This would allow us to integrate the internal docs into the external documentation in the future, while also ensuring that developers only need to work with a single, consistent syntax (Docusaurus Markdown) instead of switching between mdBook and Docusaurus.
@bitwalker What do you think?
Changes
Syntax changes
As already mentioned before, this PR changes the markdown syntax of all docs markdown files.
Going forward all documentation will also be written using Docusaurus sytnax.
NOTE: Please review the updated Markdown files to understand the new format.
Local testing
To test docs locally before pushing changes:
cd docs/externalNote: The
index.mdfile might not appear in the correct sidebar order during local dev. In production deployments it will. To guarantee proper ordering, ensureindex.mdincludes:New Docs Architecture
The documentation system no longer relies on cron jobs or local scripts. Instead, changes are propagated through a CI-driven process. Here are the key changes:
Instead of relying on a cron task to update the docs, every repository now integrates a "trigger-docs-deploy.yml" workflow, which automatically triggers a rebuild and redeployment of the docs upon changes to
next.Upon Testnet deployments, a dedicated workflow inside of the miden-docs repository can be triggered to create a snapshot of the docs for that specific version. This workflow has to be triggered manually.