Update documentation
The follow operations should be performed in master
branch unless otherwise specified
Setup docs compiling environment
-
Make sure the following dependencies are installed:
- Node: LTS version v12.16.3+
- Rust: v1.46.0+
-
Install
mdBook
cargo install mdbook
-
Initialize docs compiling environment
make doc-init
You can use
make doc-clean
to cleanup files generated in this step. If you want to redo the initialization, please do a cleanup first
Update docs
-
Run docs dev server:
make doc-dev
and a open browser tab at
http://localhost:3000
-
Make changes to Markdown files in
docs
directory, which will trigger the dev server to hot-reload the docs in the browser. This is a good way for to preview the changes. Please note that anything other than a symbolic link or a Markdown file indocs
will be copied todocs_output/book/html
bymake doc-dev
ormmake doc-build
then be synced todocs_output/gh-pages
bymake doc-deploy
with extraneous files removed. So if you want to add a file togh-pages
, add todocs
first, otherwise that file will be deleted during the syncing
Notes:
-
If you have changed the anchor types in protos or their configuration in
tools/anchor-types-updater/manifests
(previously inprovendb-releases
before moving to the new cluster), you need to regenerate the Anchor Types page atdocs/concepts/anchor_types.md
make doc-anchortypes
-
If you have changed the Node SDK code, you need to regenerate the Node SDK reference at
docs_output/gh-pages/node_sdk/reference
make doc-node
-
If you want to temporarily ignore a link when building the docs, you can add it to
output.linkcheck.exclude
inbook.toml
. Please remember to remove it after you have fixed your problem
Deploy updated docs
-
Make a production build of the docs:
make doc-build
this will generate the htmls in
docs_output/book
-
Sync changes to the directory
docs_output/gh-pages
(the checkout ofgh-pages
branch) fromdocs_output/book/html
:make doc-deploy
-
Go to the
docs_output/gh-pages
directory, review changes and perform a git commit ongh-pages
branch:cd docs_output/gh-pages # review changes git status # commit git add . git commit -am "Some meaningful commit message"