You should install Rust lang
first.
Check this doc.
Then install mdBook & mdBook-i18n using cargo
:
./scripts/install.sh
Read mdBook Documentation for more details.
Directory structure:
docs/
book/ -> Build book result, ignored by git
src/
en/ -> English translation
introduction/
introduction.md -> A markdown
SUMMARY.md -> A markdown which generates the sidebar menu. Check the detail here https://rust-lang.github.io/mdBook/format/summary.html
cn/ -> Chinese translation. It has same directory structure as 'en/'.
resources/ -> Static resources
The './scripts/serve.sh' command is used to preview a book by serving it via HTTP at localhost:3000
by default:
./scripts/serve.sh
You can put images under docs/src/resources
directory.
This directory will copy into your final build directory. So there will have 3 copies of resources
under:
- docs/book/html/resources
- docs/book/html/cn/resources
- docs/book/html/en/resources
In any Markdown doc, you can ref images using ${dir_to_SUMMARY.md}/resources/${your_image}
.
For example:
In docs/src/en/test/test-scenes.md
we use
![scene-default deployment](../../resources/images/dev-guide/test/scene-default.jpg)