在注释中编写文档,并使用模板进行渲染。
项目描述
Shell 脚本文档
在注释中编写文档,并使用模板进行渲染。
shellman
可以使用在shell脚本注释中编写的文档生成man页、wiki页和帮助文本。
例如
#!/bin/bash
## \brief Just a demo
## \desc This script actually does nothing.
main() {
case "$1" in
## \option -h, --help
## Print this help and exit.
-h|--help) shellman "$0"; exit 0 ;;
esac
}
## \usage demo [-h]
main "$@"
调用./demo -h
时的输出
Usage: demo [-h]
This script actually does nothing.
Options:
-h, --help Print this help and exit.
您可以在文档中看到更多示例: https://pawamoy.github.io/shellman/.
演示
在上面的演示中,我们看到了三个内置模板:helptext、manpage和wikipage。
您可以通过指定--template path:my/template
语法来使用自己的模板。
您还可以编写一个插件,请参阅文档: https://pawamoy.github.io/shellman/plugins.
安装
使用pip
pip install shellman
使用pipx
python3.8 -m pip install --user pipx
pipx install shellman
使用shellman的项目
项目详情
下载文件
下载适合您平台文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分发
shellman-1.0.0.tar.gz (21.7 kB 查看散列)
构建分发
shellman-1.0.0-py3-none-any.whl (24.7 kB 查看散列)
关闭
shellman-1.0.0.tar.gz 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 1b49c8e50d4df9c1b84ccadaa5164dd62a139619d2bfc93a03d4f6d9035eb04c |
|
MD5 | e2739883563b01f1710eeffe19f4080d |
|
BLAKE2b-256 | a049b7c942217081120692856c5917f9ba955e8a8f01358fc2d63952ad541508 |
关闭
shellman-1.0.0-py3-none-any.whl 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 02647e5146195f8a50f3687720ba4c990ad8666e38d833eba160ab57cabec116 |
|
MD5 | 39f2a0052993fd62e7b95166b76efe9c |
|
BLAKE2b-256 | 5b6f9eda5b059ffeb503562af9747a7ecbcb412bb48b97ce013f5b6095d0c60d |