Skip to content
Commits on Source (9)
# Changes in shell-docs-generator
## 1.4.1 (2017-10-31)
* make the created-by line contain the english-language, UTC time.
## 1.4 (2017-10-30)
* add new tag 'todo'
## 1.3.1 (2017-08-30)
* bugfix: markdown header should be surrounded by blank lines
## 1.3 (2017-08-28)
* lint all markdown files by markdownlint
......
shell-docs-generator (1.4.1-1~unki.1) stretch; urgency=medium
* pack new upstream release v1.4.1
-- Andreas Unterkircher <unki@netshadow.net> Tue, 31 Oct 2017 09:20:36 +0100
shell-docs-generator (1.4-1~unki.1) stretch; urgency=medium
* pack new upstream release v1.4
-- Andreas Unterkircher <unki@netshadow.net> Mon, 30 Oct 2017 09:20:39 +0100
shell-docs-generator (1.3.1-1~unki.1) stretch; urgency=medium
* pack new upstream release v1.3.1
-- Andreas Unterkircher <unki@netshadow.net> Wed, 30 Aug 2017 07:21:35 +0200
shell-docs-generator (1.3-1~unki.1) stretch; urgency=medium
* pack new upstream release v1.3
......
......@@ -2,7 +2,7 @@
###############################################################################
# This file is part of the shell-docs-generator v1.3
# This file is part of the shell-docs-generator v1.4.1
#
# shell-docs-generator, a documentation generator for shell scripts based on
# comment tags like @brief, @return, etc. that are placed in front of a
......@@ -22,7 +22,7 @@
# @title shell-docs-generator Function Reference
# @author Andreas Unterkircher
# @version 1.3
# @version 1.4.1
# @license AGPLv3
set -u -e -o pipefail # exit-on-error, error on undeclared variables.
......@@ -33,7 +33,7 @@ shopt -s extglob
# helper variables
readonly PROG_NAME="$(basename "${BASH_SOURCE[0]}")"
readonly PROG_VERS="1.3"
readonly PROG_VERS="1.4.1"
declare -g -a CODE_SRC=()
declare -g -a MARKDOWN_RESULT=()
......@@ -51,6 +51,7 @@ declare -g -a ALLOWED_TAGS=(
'^version$'
'^title$'
'^license$'
'^todo$'
)
declare -A STANZA=()
......@@ -427,7 +428,7 @@ parse_input ()
if [[ "${LINE}" =~ ^#[[:blank:]]*@(author|version|title|license):?[[:blank:]]+([[:print:]]+)[[:blank:]]*$ ]]; then
if $IN_STANZA; then
fail "Tags @title, @author, @version and @license are only allowed outside stanzas."
fail "Global tags @title, @author, @version and @license are not allowed for function stanzas."
fail "no.${LINE_NO} >>> ${LINE}"
exit 1
fi
......@@ -538,7 +539,7 @@ parse_input ()
fi
if $IN_STANZA && [[ "${CUR_TAG}" =~ ^(author|version|title|license)$ ]]; then
fail "Tags @title, @author and @version are only allowed outside stanzas."
fail "Global tags @title, @author, @version and @license are not allowed for function stanzas."
fail "no.${LINE_NO} >>> ${LINE}"
exit 1
fi
......@@ -690,6 +691,11 @@ formated_output ()
[[ -v "FUNC_STANZA['link']" ]] && write "Link: ${FUNC_STANZA['link']}"
write ""
fi
if [[ -v "FUNC_STANZA['todo']" ]]; then
write "Todo: ${FUNC_STANZA['todo']}"
write ""
fi
}
# @function show_help()
......@@ -764,21 +770,23 @@ output_markdown ()
mdout "# ${BASH_SOURCE[0]} Function Reference"
fi
if [[ -v CODE_AUTHOR ]] || [[ -v CODE_VERSION ]] || [[ -v CODE_LICENSE ]]; then
mdout ""
if [[ -v CODE_AUTHOR ]] || [[ -v CODE_VERSION ]] || [[ -v CODE_LICENSE ]]; then
mdout "| Tag | Value |"
mdout "| - | - |"
[[ -v CODE_AUTHOR ]] && mdout "| Author | ${CODE_AUTHOR} |"
[[ -v CODE_VERSION ]] && mdout "| Version | ${CODE_VERSION} |"
[[ -v CODE_LICENSE ]] && mdout "| License | ${CODE_LICENSE} |"
mdout ""
fi
mdout ""
for IDX in "${!MARKDOWN_RESULT[@]}"; do
mdout "${MARKDOWN_RESULT[$IDX]}"
done
mdout "[^1]: Created by ${PROG_NAME} v${PROG_VERS} on $(date)."
mdout "[^1]: Created by _${PROG_NAME}_ _v${PROG_VERS}_ on $(LC_TIME=C date -u)."
}
#
......
......@@ -99,6 +99,7 @@ readonly CSL_DEFAULT_HELP_TEXT
# @brief returns 0 if debugging is enabled, otherwise it returns 1.
# @return int 0 or 1
# @end
# @todo to be removed soon
is_debug ()
{
is_declared CSL_DEBUG || return 1;
......
......@@ -99,6 +99,7 @@ readonly CSL_DEFAULT_HELP_TEXT
# @brief returns 0 if debugging is enabled, otherwise it returns 1.
# @return int 0 or 1
# @end
# @todo to be removed soon
is_debug ()
{
is_declared CSL_DEBUG || return 1;
......