mdbook-i18n
mdbook-i18n copied to clipboard
mdBook-i18n
Simple mdBook i18n plugin.
Installation
It requires mdbook >= 0.3.1.
# cargo install mdbook
# cargo install mdbook-i18n
Usage
- Add
languagetobooksection in yourbook.toml. - Add
output.i18n.translationstable to yourbook.toml. Every record in this table must containslanguageandtitle. Also records can contains fieldsauthors(must be array),translators(also must be array),descriptionandsrc. Ifsrcnot present in record, then this field creates as<book's root>/translations/<language name>. - Write translations.
- Run
mdbook buildfor build all books. Every book saves in destination directory in folder with locale name.
How it works?
Source book from config converts to translation config. Common configs shares between all
translations. After that mdbook runs for every translation.
Limitations
- Custom values from main config don't send to mdbook config. For now this project used native
RenderContextwhat have privaterestfield inconfig(this field contains custom values from config). - Books don't share assets. Because native render of mdbook can build only one build, every build generate full tree of assets.
- Books don't has links to different l10n. Because used native render without custom templates.
- Maybe everything else what i forget.
License
MIT