-
Notifications
You must be signed in to change notification settings - Fork 28
enhance www/README.md #912
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,44 +1,102 @@ | ||||||
| # Website | ||||||
| # Skip Documentation Website | ||||||
|
|
||||||
| The documentation website is built using [Docusaurus](https://docusaurus.io/). | ||||||
| This website is built using [Docusaurus](https://docusaurus.io/) and hosts both our documentation and blog. | ||||||
|
|
||||||
| ## API Documentation | ||||||
|
|
||||||
| # API Documentation | ||||||
| The API documentation is generated using: | ||||||
| - [TypeDoc](https://typedoc.org/index.html) for API documentation generation | ||||||
| - [docusaurus-plugin-typedoc](https://typedoc-plugin-markdown.org/plugins/docusaurus) for Docusaurus integration | ||||||
|
|
||||||
| The API docs are generated by [TypeDoc](https://typedoc.org/index.html) and integrated into docusaurus using [docusaurus-plugin-typedoc](https://typedoc-plugin-markdown.org/plugins/docusaurus). | ||||||
| This setup needs the development/source docs site to be in the same repo as the sources, as there are relative paths in the docusaurus config file to the sources. | ||||||
| A separate deployment step will be needed to generate the docs and push them to the repo that feeds the live site. | ||||||
| This also means that we can iterate on the docs in the source repo without publishing them immediately, and then choose to publish them in sync with publishing packages. | ||||||
| ### Development Setup | ||||||
|
|
||||||
| The workflow for working on API docs is: | ||||||
| ``` | ||||||
| - $ cd /path/to/repo/root | ||||||
| - $ make docs # to initialize the api docs | ||||||
| - $ make docs-run # to run the docs site locally | ||||||
| - visit http://localhost:3000/docs/api/core | ||||||
| - edit the doc comments in the sources | ||||||
| - $ make docs # to regenerate the api docs | ||||||
| The development/source docs site must be in the same repository as the source code due to relative paths in the Docusaurus configuration. This setup allows us to: | ||||||
| - Iterate on documentation in the source repository | ||||||
| - Choose when to publish documentation | ||||||
| - Keep documentation in sync with package releases | ||||||
|
|
||||||
| ### Development Workflow | ||||||
|
|
||||||
| #### Standard Workflow | ||||||
| ```bash | ||||||
| # From repository root INSIDE your Docker instance | ||||||
| make docs # Initialize API documentation | ||||||
|
|
||||||
| # From repository rood OUTSIDE your Docker instance | ||||||
| make docs-run # Run the docs site locally | ||||||
| # Visit http://localhost:3000/docs/api/core or http://localhost/blog | ||||||
|
|
||||||
| # After editing doc comments in the sources | ||||||
| make docs # Regenerate API documentation | ||||||
| ``` | ||||||
|
|
||||||
| A faster but not robust way to regenerate the api docs is: | ||||||
| ```bash | ||||||
| cd /path/to/repo/root/www && npx docusaurus generate-typedoc | ||||||
| ``` | ||||||
| - cd /path/to/repo/root/www && npx docusaurus generate-typedoc | ||||||
| ``` | ||||||
| To publish the docs to the live site: | ||||||
| ``` | ||||||
| - $ make docs-publish | ||||||
|
|
||||||
| ### Publishing Documentation | ||||||
|
|
||||||
| Before, commit your changes and send them for review | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Up to you, but I would suggest:
Suggested change
|
||||||
| ```bash | ||||||
| git add <your_files> | ||||||
| git commit -m '<some message>' | ||||||
| gh pr create # if you use the GitHub CLI | ||||||
| ``` | ||||||
| This will suggest to run: | ||||||
|
|
||||||
| When reviewed and mereged, you are ready to publish documentation to the live site: | ||||||
hubyrod marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| ```bash | ||||||
| # From repository root INSIDE your Docker instance | ||||||
| make docs-publish | ||||||
| ``` | ||||||
|
|
||||||
| You should eventually read: | ||||||
| ```bash | ||||||
| Test locally: make docs-serve | ||||||
| Push to live site: cd www/docs_site/; git add -A; git commit -m 'update to <commit>'; git push; cd - | ||||||
| ``` | ||||||
| Note that the docs_site commit messages will mention the wrong commit hashes if `make docs-publish` is run from a commit that is not (an ancestor of) `main`. | ||||||
|
|
||||||
| The documentation for the tags that TypeDoc recognizes is | ||||||
| [here](https://typedoc.org/guides/tags/). | ||||||
| The commit hash in the last line should be the hash of your commit in the skip repository. | ||||||
|
|
||||||
| Once the docs site is running at http://localhost:3000, the markdown documentation under `www/docs` can be edited and the changes are usually picked up automatically. | ||||||
| This will suggest running: | ||||||
| ```bash | ||||||
| # Test locally | ||||||
| make docs-serve | ||||||
|
|
||||||
| Changes to the `www/docs` file structure usually need to be reflected in the `www/sidebars.ts` file. | ||||||
| # Push to live site | ||||||
| cd www/docs_site/ | ||||||
| git add -A | ||||||
| git commit -m 'update to <hash_of_your_commit>' | ||||||
| git push | ||||||
| cd - | ||||||
| ``` | ||||||
hubyrod marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| > **Note**: If `make docs-publish` is run from a commit that is not (an ancestor of) `main`, the docs_site commit messages will contain incorrect commit hashes. | ||||||
hubyrod marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ## Documentation Structure | ||||||
|
|
||||||
| - The markdown documentation under `www/docs` can be edited while the site is running at http://localhost:3000 | ||||||
| - Changes to the `www/docs` file structure must be reflected in `www/sidebars.ts` | ||||||
| - The `docusaurus.config.ts` file is sensitive to the file system locations of source entry points and tsconfig files | ||||||
|
|
||||||
| ## TypeDoc Tags | ||||||
|
|
||||||
| You may refer to the [official documentation](https://typedoc.org/guides/tags/) of TypeDoc tags for more information. | ||||||
|
|
||||||
|
|
||||||
| ## FAQ | ||||||
|
|
||||||
| ### What if my `docs_site` is not on the `main` branch ? | ||||||
| Clean up your repository is good idea at this point and then start the process again: | ||||||
| ```bash | ||||||
| git pull --rebase # ensure that your local docs_site submodule is up-to-date | ||||||
| git clean -Xdn # -n for a dry-run and double-check what's to be cleaned out | ||||||
| git clean -Xdf # the actual cleaning | ||||||
| ``` | ||||||
|
|
||||||
| ### What if the hash is not in the commit message suggested along the process ? | ||||||
|
||||||
| You can get it from the skip repository: | ||||||
| ```bash | ||||||
| git rev-parse --short HEAD # supposingly it is the last commit of the branch | ||||||
| ``` | ||||||
|
|
||||||
| The `docusaurus.config.ts` file is sensitive to the file system locations of the source entry points and tsconfig files. | ||||||
Uh oh!
There was an error while loading. Please reload this page.