diff --git a/README.md b/README.md index 5b9bc48..7a21088 100644 --- a/README.md +++ b/README.md @@ -8,26 +8,54 @@ definitions, and creates a markdown file with ready to use documentation. ## Index -* [Example](#example) -* [Annotations](#annotations) -* [Usage](#usage) -* [Installation](#installation) -* [More examples](#examples) -* [License](#license) +- [Index](#index) +- [Example](#example) + - [Source file](#source-file) + - [Output](#output) +- [Features](#features) + - [`@name`](#name) + - [`@file`](#file) + - [`@brief`](#brief) + - [`@description`](#description) + - [`@section`](#section) + - [`@example`](#example-1) + - [`@option`](#option) + - [`@arg`](#arg) + - [`@noargs`](#noargs) + - [`@set`](#set) + - [`@env`](#env) + - [`@exitcode`](#exitcode) + - [`@stdin`](#stdin) + - [`@stdout`](#stdout) + - [`@stderr`](#stderr) + - [`@see`](#see) + - [`@warning`](#warning) + - [`@require`](#require) + - [`@feature`](#feature) + - [`@trap`](#trap) + - [`@deprecated`](#deprecated) + - [`@internal`](#internal) +- [Usage](#usage) +- [Installation](#installation) + - [Arch Linux](#arch-linux) + - [Using Git](#using-git) + - [Others](#others) +- [Examples](#examples) ## Example -
|
-
Generate documentation with the following command:
+
~~~bash
$ shdoc < lib.sh > doc.md
~~~
-_Source_ [examples/readme-example.sh](examples/readme-example.sh) -_Output_: [examples/readme-example.md](examples/readme-example.md) +_Source_ [examples/readme-example.sh](examples/readme-example.sh) + +_Output_: [examples/readme-example.md](examples/readme-example.md) + +### Source file + ~~~bash #!/bin/bash # @file libexample @@ -40,7 +68,6 @@ _Output_: [examples/readme-example.md](examples/readme-example.md) # * etc # @description My super function. -# Not thread-safe. # # @example # echo "test: $(say-hello World)" @@ -59,6 +86,20 @@ _Output_: [examples/readme-example.md](examples/readme-example.md) # @exitcode 0 If successful. # @exitcode 1 If an empty string passed. # +# @warning Not thread-safe. +# +# @deprecated use yell-hello instead +# +# @require ubuntu>20 +# +# @trap INT EXIT HUP QUIT ABRT TERM to manage temp files removal +# +# @feature Retry::default +# +# @set HELLO_HAS_BEEN_SAID int set it to 1 if successful +# +# @env LANGUAGE string provide this variable to translate hello world in given language (default value: en-GB) +# # @see validate() # @see [shdoc](https://github.com/reconquest/shdoc). say-hello() { @@ -71,9 +112,7 @@ say-hello() { } ~~~ - - |
-+### Output ~~~markdown # libexample @@ -94,8 +133,11 @@ The project solves lots of problems: ### say-hello +[](#) +[](#) +[](#) + My super function. -Not thread-safe. #### Example @@ -117,6 +159,14 @@ echo "test: $(say-hello World)" * **$1** (string): A value to print +#### Environment variables + +* **LANGUAGE** (string): provide this variable to translate hello world in given language (default value: en-GB) + +#### Variables set + +* **HELLO_HAS_BEEN_SAID** (int): set it to 1 if successful + #### Exit codes * **0**: If successful. @@ -132,6 +182,22 @@ echo "test: $(say-hello World)" * Output 'Oups !' on error. It did it again. +#### Requires + +* ubuntu>20 + +#### Features + +* Retry::default + +#### Traps + +* INT EXIT HUP QUIT ABRT TERM to manage temp files removal + +#### Warnings + +* Not thread-safe. + #### See also * [validate()](#validate) @@ -139,10 +205,6 @@ echo "test: $(say-hello World)" ~~~ - | -