Skip to content

essentialkaos/shdoc

GitHub Actions CI Status GoReportCard codebeat badge GitHub Actions CodeQL Status Coverage Status

Usage DemoInstallationUsageTest & Coverage StatusContributingLicense


shdoc is a tool for viewing and exporting documentation for shell scripts.

Usage Demo

demo

Installation

From source

Make sure you have a working Go 1.18+ workspace (instructions), then:

go install github.com/essentialkaos/shdoc@latest

Prebuilt binaries

You can download prebuilt binaries for Linux and macOS from EK Apps Repository.

To install the latest prebuilt version of bibop, do:

bash <(curl -fsSL https://apps.kaos.st/get) shdoc

Command-line completion

You can generate completion for bash, zsh or fish shell.

Bash:

sudo shdoc --completion=bash 1> /etc/bash_completion.d/shdoc

ZSH:

sudo shdoc --completion=zsh 1> /usr/share/zsh/site-functions/shdoc

Fish:

sudo shdoc --completion=fish 1> /usr/share/fish/vendor_completions.d/shdoc.fish

Usage

Usage: shdoc {options} script

Options

  --output, -o file      Path to output file
  --template, -t name    Name of template
  --name, -n name        Overwrite default name
  --no-color, -nc        Disable colors in output
  --help, -h             Show this help message
  --version, -v          Show version

Examples

  shdoc script.sh
  Parse shell script and show documentation in console

  shdoc script.sh -t markdown -o my_script.md
  Parse shell script and render documentation to markdown file

  shdoc script.sh -t /path/to/template.tpl -o my_script.ext
  Parse shell script and render documentation with given template

  shdoc script.sh myFunction
  Parse shell script and show documentation for some constant, variable or method

Test & Coverage Status

Branch CI Coveralls
master CI Coverage Status
develop CI Coverage Status

Contributing

Before contributing to this project please read our Contributing Guidelines.

License

Apache License, Version 2.0