Skip to main content

Write doc in your shell scripts.

Project description

Shellman

Write doc in your shell scripts.

Shellman is a Python package that read files, search for special comment lines (documentation) and output formatted documentation as text, markdown or man page.

License

Software licensed under MPL 2.0 license.

Installation

pip install [--user] shellman

Documentation

https://github.com/Pawamoy/shellman/wiki

Development

To run all the tests: tox

Usage

To render the doc on stdout:

shellman FILE
# equivalent to...
shellman --format=text FILE
# other available formats:
shellman --format=man FILE
shellman --format=markdown FILE

You can pass the -o, --output option to specify a file to write to, instead of stdout.

To check if the documentation within a script is correct:

shellman --check --warn FILE         # CI test
shellman --check --failfast FILE     # quick CI test with no output
shellman --check --warn --nice FILE  # always passing test with output

In a script, for automatic help text:

#!/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 "$@"

Output when calling ./demo -h:

Usage: demo [-h]

This script actually does nothing.

Options:
  -h, --help
    Print this help and exit.

Changelog

0.1.0 (2016-11-30)

  • Alpha release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shellman-0.2.1.tar.gz (26.0 kB view hashes)

Uploaded Source

Built Distribution

shellman-0.2.1-py2.py3-none-any.whl (17.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page