Converts comments to function to reference markdown documentation.
shdoc will match comments in the following form before function definitions:
# @description Multiline description goes here and
# there
#
# @example
# some:other:func a b c
# echo 123
#
# @arg $1 string Some arg.
# @arg $@ any Rest of arguments.
#
# @noargs
#
# @exitcode 0 If successfull.
# @exitcode >0 On failure
# @exitcode 5 On some error.
#
# @stdout Path to something.
#
# @see some:other:func()
some:first:func() {
shdoc.awk
has no args and expects shell script with comments as described
above on the stdin and will markdown output result on the stdout.
Will produce following output:
Multiline description goes here and there
some:other:func a b c
echo 123
- $1 (string): Some arg.
- ... (any): Rest of arguments.
Function has no arguments.
- 0: If successfull.
-
0: On failure
- 5: On some error.
- Path to something.
- some:other:func()
See example documentation on: