Skip to main content

Write documentation in comments and render it with templates.

Project description

Shell Script Documentation

Write documentation in comments and render it with templates.

pipeline status coverage report pypi version python wheel gitter chat

shellman can generate man pages, wiki pages and help text using documentation written in shell scripts comments.

For example:

#!/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.

You can see more examples and all the documentation in the wiki!

Demo

In the demo above we saw the three builtin templates: helptext, manpage and wikipage.

You can use your own templates by specifying them with the --template path:my/template syntax.

You can also write a plugin: see the wiki page on GitLab or on GitHub.

Installation

shellman is written in Python, so you must install it with pip:

pip install shellman

Some projects using shellman

License

Software licensed under ISC license.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v0.3.1 (compare) - 2018-09-18

Misc

  • Reduce size of package, simplify manifest (f123b53).
  • Switch documents to markdown (f3917e9).

v0.3.0 (compare) - 2018-09-17

Added

  • Add credits in wikipage template (e70b7c8).
  • Add groupby_unsorted filter to improve option rendering (2e42177).
  • Add logo (f9289a0).
  • Add new reader module (ea13cfb).
  • Add option to smart_width to indent first line or not (e625afb).
  • Add vcsroot name variable (f5db3b3).

Changed

  • Change README.rst to README.md (4628e76).

Fixed

  • Fix code block (de304ee).
  • Fix credits and readme url to gitlab plugins doc (9958019).
  • Fix get context from env (f1e2296).
  • Fix usage tag (4a47431).
  • Fix wikipage template (2f5a0ad).

Removed

  • Remove blank line in AUTHORS (e414282).
  • Remove formatter options, enforce user behavior (48c26d0).
  • Remove MPL2.0 notices in sources (now ISC) (87e92df).
  • Remove pyup file, remove option-description subtag (implicit) (4a08fa1).

Misc

  • Allow failure for style and spell on travis (4a7a60f).
  • Automatically compute indent_str from indent, cast indent to int (0a09554).
  • Handle multiple file input/output, fix some templates vars, format with black (2c6672b).
  • Ignore bandit warning as irrelevant (no html templates) (4947fe5).
  • Implement context abilities (5e7c9d4).
  • Implement plugin abilities (cd4723f).
  • Implement smart_width for text format, write more templates (bb15f51).
  • Improve helptext usage display, fix smartwrap indent (11f78bf).
  • Improve manpage groff template, fix various issues (b829593).
  • Link up with argparse (12f186d).
  • Rename tag to section (5e80735).
  • Update demo script and svg (ec0c282).
  • Update docs, simplify context usage (8c6c950).
  • Use GitLab-CI instead of Travis (de662d0).

v0.2.2 (compare) - 2017-05-02

Changed

  • Change license from MPL 2.0 to ISC (no 'same license' condition) (868b89e).

Fixed

  • Fix cli main return None -> 0 (7beeecc).
  • Fix codacy badge (fe55efb).
  • Fix docs spelling (69988a2).
  • Fix installation instruction (--user does not install entry point...) (aa2037b).
  • Fix man synopsis section (d79db9a).

Misc

  • Begin to fix output option (f1e5488).
  • Hide sphinx warnings, travis install enchant (c216c78).
  • Use codacy instead of codecov (c024b1c).

v0.2.1 (compare) - 2016-12-06

Misc

  • Update README, fix help display (a131b82).

v0.2.0 (compare) - 2016-12-06

Added

  • Add check feature, add tests (4916b51).
  • Add demo example (ec78d6b).
  • Add markdown format, improve python3 compatibility, add gitignore (6b8c295).
  • Add tests (4d08087).

Fixed

  • Fix changing release date over upstream update (11738c4).
  • Fix command line usage and tests usage combination (bcef7c9).
  • Fix dangerous warning about sys.argv as default value (effe263).

Misc

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.3.1.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

shellman-0.3.1-py2.py3-none-any.whl (23.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file shellman-0.3.1.tar.gz.

File metadata

  • Download URL: shellman-0.3.1.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.0

File hashes

Hashes for shellman-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0a0ba1236845497630ec9f8b41618de8d7d92bf63ad5561b94ca47d026853148
MD5 433583150cc3dcd808fe538f67a0d770
BLAKE2b-256 fc00c50ad327104e0564ad27418b2ab0ec2632e167be4218e8ff5eed72f1bd03

See more details on using hashes here.

File details

Details for the file shellman-0.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: shellman-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.0

File hashes

Hashes for shellman-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5ddef4b640bd1a54f05626006d422014af077a83f3deb38d77aae345f22e62c6
MD5 50804e2ce355e3c7f63603ba4faf3899
BLAKE2b-256 e8483f6102b555e030aae81b24ad193200efab808cc9e08144c7ca51ca87fc1b

See more details on using hashes here.

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