view README-zh.md for Chinese version.
A new MoonBit docs framework based on Sphinx.
-
For Python Environment, execute command
> Python: Create Environment
fornext
usingrequirement.txt
in VSCode, or:python3 -m venv .env source .env/bin/activate pip install -r requirements.txt
-
For building PDF using Latex,
latexmk
needs to be installed:- MacOS:
- install Mactex
- install
latexmk
using TeX Live Utility
- MacOS:
Execute task Watch Document
in VSCode, or:
sphinx-autobuild . ./_build/html
# or sphinx-autobuild -D language='zh_CN' . ./_build/html
Execute task Build Document
in VSCode, or:
make html
python3 -m http.server -d _build/html
For Chinese version:
LANGUAGE="zh_CN" make html
python3 -m http.server -d _build/html
For PDF:
make latexpdf
open ./_build/latex/moonbitdocument.pdf
For Markdown:
pip install sphinx-markdown-builder
make markdown
Execute task Translate Document
in VSCode, or:
make gettext
sphinx-intl update -p _build/gettext -l zh_CN
You should be able to see the file changed thanks to the Git version system.
You should see new entries or modified entries each composed of a document position, a msgid
and a msgstr
.
The msgid
is the original text and msgstr
would be the translation to be written.
If there's a fuzzy
flag, it means that gettext has tried to match a translation which might not be correct.
If you have verified the content or translated it otherwise, you should remove the line containing the flag.
For full format explanation, checkout GNU's handbook
For better editing experience, checkout editors listed on GNU's website.