跳转到主要内容

在注释中编写文档,并使用模板进行渲染。

项目描述

Shell 脚本文档

在注释中编写文档,并使用模板进行渲染。

ci documentation pypi gitpod gitter

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的项目

  • shellm — 一个建立在核心包含系统之上的脚本和库集合,所有内容都可以使用basher安装。以下是一些示例
    • daemon — 一个库,它简化了在监视目录中消耗文件的守护进程脚本的编写。
    • debug — 一个简单的脚本,在运行另一个脚本之前设置详细的/模拟运行/调试 Bash 标志。
    • format — 使用样式和颜色格式化你的输出。
    • home — 你的 Shell 脚本的家!
    • loop — 控制你的循环的流程(暂停/恢复等)。

项目详情


下载文件

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

源分发

shellman-1.0.0.tar.gz (21.7 kB 查看散列)

上传时间

构建分发

shellman-1.0.0-py3-none-any.whl (24.7 kB 查看散列)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面