一种命令行工具,用于将文档从存储库构建为HTML文件。最初基于https://github.com/juju/docs/blob/master/tools/mdbuild.py。
ubuntudesign.documentation-builder的Python项目详细描述
一种工具,用于从 包含标记文件的远程Git存储库。
安装
安装documentation-builder的最佳方法是使用snap:
sudo snap install documentation-builder
如果您的系统上没有snap,也可以使用pip3:
pip3 install ubuntudesign.documentation-builder
有关详细信息,请参见the documentation。
开发
文档生成器是一个python模块。主应用程序代码位于 ubuntudesign/documentation_builder。更新 到标记或样式应该在the default template中进行。
检查更改
要检查对documentation builder所做的更改,在可编辑模式下,在封装的环境中本地安装模块可能是最简单的:
python3 -m venv env3 &&source env3/bin/activate # Create encapsulated environment pip install -e . # Install the module in editable mode documentation-builder --source-folder docs # build the documentation-builder's own documentation xdg-open build/en/index.html # Open up the documentation page
关注变化
关于ubuntu等人。您可以使用inotifywait监视源文件的更改,并在发生以下更改时重新生成:
sudo apt install inotify-tools # Ensure inotifywait is installed # Force rebuild docs when anything changes in the source folder while inotifywait -r -e close_write "./ubuntudesign";do bin/documentation-builder --force --source-folder docs;done
测试
运行测试:
./setup.py test
调试
运行特定测试:
./setup.py test --addopts tests/test_operations.py::test_find_files
可以通过adding a debugger to the code调试测试并再次运行测试。