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.2 (compare) - 2018-09-18

Misc

  • Add logo and demo.svg to fix PyPI page (1e06662).

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

Uploaded Source

Built Distribution

shellman-0.3.2-py2.py3-none-any.whl (23.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: shellman-0.3.2.tar.gz
  • Upload date:
  • Size: 53.0 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.2.tar.gz
Algorithm Hash digest
SHA256 61fd9818d54eb1313ce257c5bc86d54cf143b27a596381a9f17517b81b6bc8ca
MD5 564bc89dfb1fd79d8fc7510c19b38bba
BLAKE2b-256 023a951b592b60ee19cc206f2fb60cc4f168e6ea2c353167a85d2cefea15db7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shellman-0.3.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.8 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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 87374168c80ef24cb4301383549ad7b8a4dbceedcbd1fcb7ffc24310c5cef65f
MD5 ec0a6ed4be0d74b8341ee8f7202e3776
BLAKE2b-256 8806242901a222677bcd0333fd9525376c32740ffe4e16c9ce17202ecbff82e5

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