跳转到主要内容

一个命令行工具,用于将仓库中的文档构建成HTML文件。最初基于 https://github.com/juju/docs/blob/master/tools/mdbuild.py。

项目描述

存档

此项目是过时的,不应用于新的文档。使用它的现有文档项目应迁移到 Discourse 模型,或使用其他解决方案。如果您管理此类项目,请与我们联系以协助升级。


Ubuntu 文档构建器

维护模式

documentation-builder 现在被视为过时产品,因为所有由用户维护的文档集现在都应该迁移到 discourse-docs 模型

仍然会执行重要修复,但我们将不会添加新功能。


build status code coverage

一个用于从包含 markdown 文件的远程 git 仓库中构建一组 HTML 格式文档文件的工具。

安装

安装 documentation-builder 的最佳方式是使用 snap

sudo snap install documentation-builder

如果您系统上没有 snap,您也可以使用 pip3 安装它

pip3 install ubuntudesign.documentation-builder

有关更多信息,请参阅 文档

开发

documention-builder 是一个 Python 模块。主要应用程序代码位于 ubuntudesign/documentation_builder。对标记或样式的更新应在 默认模板 中进行。

检查更改

要检查对 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

您可以通过将调试器添加到代码中并再次运行测试来调试测试 (链接到调试器介绍)

项目详情


下载文件

下载适用于您平台的应用程序。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源分布

ubuntudesign.documentation-builder-1.7.0.tar.gz (50.8 kB 查看哈希值)

上传于 来源

由以下支持