源代码
此文档的源代码存储库。
注意,这是如何为 transpolibre 应用程序本身构建文档,而不是如何使用 transpolibre。
构建文档
要在本地构建此文档,请执行以下操作。
安装依赖项
安装依赖项,例如在 Debian 中:
sudo apt update
sudo apt install python-is-python3 python3-pip python3-venv
下载文档源
git clone https://spacecruft.org/deepcrayon/transpolibre
cd transpolibre/
设置 Python
python -m venv venv
source venv/bin/activate
pip install -U pip setuptools wheel
文档构建帮助
要获取文档构建帮助,请运行:
make help
将显示此帮助:
Please use 'make <target>' where <target> is one of
clean Remove all build files and directories (including translations)
all Clean and make all targets
gettext_build Build localisation strings for translation
update_locale Update localisation
update_locale_<lang> Update localisation for <lang>
html Build the HTML documentation for all languages
html_<lang> Build HTML documentation for <lang>
latex Build the documentation using LaTeX for all languages
latex_<lang> Build the documentation using LaTeX for <lang>
pdf Build the PDF documentation using LaTeX for all languages
pdf_<lang> Build the PDF documentation using LaTeX for <lang>
ebook Reduce size of PDF for eBook
prepress Reduce size of PDF for prepess
index Copy static docs/index.html to docs/_build/html/index.html
translations Translate from English
清洁
因此,请清理构建工件。
make clean
构建 HTML 文档
要构建 HTML 文档,请运行:
make index
make html
生成的 HTML 将位于 docs/_build/html/ 中,其中包含一个位于 docs/index.html 的顶级 index.html 文件。
构建 LaTex PDF
要从 LaTeX 构建中构建 PDF 文档,首先要安装依赖项(这远远超过了所需的依赖项):
sudo apt install texlive-full
然后构建 LaTeX 和 PDF 文档:
make latex
创建 PDF
从 LaTeX 构建 PDF 文档:
make pdf
生成的 PDF 将位于此处:docs/_build/latex/en/transpolibre.pdf。
电子书
要将 PDF 的大小大幅缩小为 150 dpi 电子书,请运行:
make ebook
生成的 PDF 将位于此处:docs/_build/latex/en/transpolibre-ebook-en.pdf。
印前
要将 PDF 的大小缩小到 300 dpi 以便打印,请运行:
make prepress
生成的 PDF 将位于此处:docs/_build/latex/en/transpolibre-prepress-en.pdf。
构建所有文档
生成所有文档,包括 HTML 和 PDF。
make all
翻译
有关如何更新软件包翻译的说明,请参阅 README.md。