dgtools::dgtutils 0.1

Detlef Groth, Schwielowsee, Germany

2020-03-22

NAME

dgtools::dgtutils - internal helper procedures for the dgtools package

TABLE OF CONTENTS

SYNOPSIS

package require dgtools::dgtutils
dgtools::getVersion filename
dgtools::install filename
dgtools::manual mode filename
dgtools::runExample filename boolean

DESCRIPTION

The dgtools::dgtutils package provide a few helper commands for other packages in the dgtools package to format the documentation, to extract the help pages and to show and run example code embedded within the package documentation.

COMMANDS

dgtools::getVersion filename

Returns the package version of a given file. Please note, that the package must have the same name as the file basename.

dgtools::install filename

Installs the fiven file as Tcl module within the Tcl module path. Please note, that the package must have the same name as the file basename.

dgtools::manual mode filename

Extracts and formats the embedded documentation. Option mode can bei either -html, -man or -markdown. -man is pandoc markdown, an extended version for the pandoc document converter. Documentation in Markdown must be prefix with a #' comment sign.

dgtools::runExample filename ?eval:boolean?

Extracts and executes the code of the example section in the Markdown formatted documentation. Documentation must be prefixed with a #' comment indicator and must be followed directly the example section header after two '##' signs. If the option eval is set to false the code is only returned.

DOCUMENTATION

The script contains embedded the documentation in Markdown format. To extract the documentation you should use the following command line:

$ tclsh recover.tcl --man

The output of this command can be used to create a markdown document for conversion into a markdown document that can be converted thereafter into a html or pdf document. If, for instance, you have pandoc installed you could execute the following commands:

tclsh recover.tcl --man > recover.md
pandoc -i recover.md -s -o recover.html
pandoc -i recover.md -s -o recover.tex
pdflatex recover.tex

Alternatively if the Markdown package of tcllib is available you can convert the documentation as well directly to html using the --html flag:

$ tclsh recover.tcl --html

AUTHOR

The dgtools::recover command was written Detlef Groth, Schwielowsee, Germany.

COPYRIGHT

Copyright (c) 2020 Dr. Detlef Groth, E-mail: detlef(at)dgroth(dot)de

LICENSE

dgtools::dgtutils package 0.1 - private procedures to be used within the dgtools packages.

Copyright (c) 2020 Dr. Detlef Groth, E-mail: detlef(at)dgroth(dot)de

This library is free software; you can use, modify, and redistribute it for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions.

This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.