Skip to content

Latest commit

 

History

History
917 lines (726 loc) · 30.3 KB

pantcl-tutorial.md

File metadata and controls

917 lines (726 loc) · 30.3 KB
title shorttitle author date standalone toc css mainfont monofont tcl abstract
Tutorial for the Pandoc Tcl filter
pantcl tutorial
Detlef Groth
2023-01-12
true
true
mini.css
Georgia
Monaco
eval
1
The Pantcl Pandoc Tcl filter allows you the embed Tcl code in code blocks and short Tcl statements as well in the normal text of a Markdown document. The code fragments will be executed dynamically and the output of the Tcl commands can be shown in an extra code block or can replace the code block as well. The pantcl application as well embeds other filters written in Tcl for other tools like GraphViz dot, LateX etc.

include header.md

Name

Tutorial Pantcl Tcl filter for Pandoc - Tcl based pandoc filter to execute programming and other Markup code within Markdown documents and use code results for documentation.

Usage

  • works as filter for pandoc or just standalone (then only conversion to HTML or Markdown is possible)
  • embedded graphical user interface, see filter-view.html
  • evaluation of Tcl and other programming language code with textual Markup files like Markdown or Asciidoc and adding the results, figures, tables etc from the code evaluation to a resulting document like HTML, PDF, DOCX, Markdown etc
  • easy to extend, many filters for other programming languages like (Python, Octave, R) are already embedded
  • filters for many graphical tools such as GraphViz, Pikchr, PlantUML, mermaid, LaTeX like
  • generic filter for all type of terminal applications such as LilyPond, C/C++ compilers etc. where examples are given
  • all tools and filters can be applied within a single document
  • can be used to extract and process embedded Markdown documentation in source code of different programming languages, such as C/C++, Tcl, Python, etc.
  • the packed Tcl script with these features has a size of just around 1Mb

Here some call syntax examples:

 pandoc input.md -s --filter pantcl.bin -o output.html

 # or using the Tcl script from the unpacked application (not recommended)
 pandoc input.md -s  --filter pantcl.tcl -o output.html

 # code documentation tool for extracting Markdown based documentation
 # and evaluating code within code chunks as in standard Markdown documents
 pantcl.bin sourcefile.tcl sourcfile.html --css file.css -s

 #  the same but not using pandoc but the internal Markdown library
 # only conversion to HTML is possible
 pantcl.bin sourcefile.tcl sourcfile.html --css file.css --no-pandoc

 # graphical user interface 
 # files must have filter name extensions like 
 # .abc, .dot, .eqn, .mmd, .pic, .pik etc
 pantcl.bin --gui somefile   

Installation

The easiest way to install the pantcl Tcl filter application is by using the standalone executable from the Github repository https://github.com/mittelmark/pantcl Download this file, rename the binary to pantcl.bin or just pantcl and make it executable and place it a directory belonging to your PATH variable. Windows user should use a Bash like environment like the Git-Bash to make files executable. The only prerequisite the application has is a working Tcl installation. The required Tcl libraries are all wrapped into the standalone exectuable.

Alternatively the application can be installed by specifying the correct path to the Tcl script in your pandoc command line call. Programmers which like to add their own filters can as well download and modify the filters or add new filters in the filter directory. The direct link to the github repository folder is: https://downgit.github.io/#/home?url=https://github.com/mittelmark/pantcl/tree/master/ Just unpack the folder and make the Tcl script pantcl.tcl executable. Your pandoc call should then point to this directory.

The filter requires the Tcl package rl_json which is available from Github: https://github.com/RubyLane/rl_json. The standalone application already contains precompiled binaries for 64bit Linu, Windows and Mac-OSX. Unix users should be able to install the rl_json package via the standard configure/make pipeline. A Linux binary, complied on a recent Fedora system is included in the download link at the GitHub page as well to simplify the use of the Pandoc filter. Windows users should install the rl_json package via the Magicplats Tcl-Installer: https://www.magicsplat.com/tcl-installer

Tcl filter

Below some basic information about the Tcl filter, more examples are given in the Pantcl filter documentation file here: pantcl.html.

Tcl code can be embedded either within single backtick marks where the first backtick is immediately followed by the string tcl and the Tcl code such as in the following example:

The variable is now `tcl set x 5` or five times three is `tcl expr {3*5}`.

This document was processed using Tcl `tcl package provide Tcl`.

Here the output:

The variable is now tcl set x 5 or five times three is tcl expr {3*5}.

This document was processed using Tcl tcl package provide Tcl.

The results from the code execution will be directly embedded in the text and will replace the Tcl code. Such inline statements should be short and concise and should not break over several lines. Currently single backtick statements must be within non-list environments only.

Larger chunks of code can be placed within triple backticks such as in the example below.

     ```{.tcl eval=true}
     # please remove the spaces before these lines 
     #  they are used to guard against code evaluation
     set x 3
     proc add {x y} {
         return [expr {$x+$y}]
     }
     add $x 7
     ```

In the code above a space was added to avoid confusing the pandoc interpreter by nested triple tickmarks, remove those spaces in your code.

And here the output:

set x 3
proc add {x y} {
    return [expr {$x+$y}]
}
add $x 7

Please note, that only the last statement is shown in code block after the Tcl code. To show more output you can use the puts command.

Code chunk attributes

Within the curly braces the following attributes are currently supported:

  • eval=false|true - evaluate the Tcl code
  • results=show|hide - show the output of the Tcl code execution
  • echo=true|false - show the Tcl code

Please note, that since version 0.9.9 the default for the eval option is false (0), so you should enable this code evaluation manually for each code chunk by writing in the code chunk options something like eval=true or in the YAML header using eval: 1 - here you can't use true or false.

Here an example for a YAML header:

---
tcl:
    eval: 1
--- 

Errors in the Tcl code will be usually trapped and the error info is shown instead of the regular output.

Images

As Tcl has no standard library in the core to create graphics without the Tk toolkit we will create a small object using a minimal object oriented system which can be used to create svg files easily.

Thingy svg example

;# the onliner OO system thingy see here
;# https://wiki.tcl-lang.org/page/Thingy%3A+a+one%2Dliner+OO+system
proc thingy name {
    proc $name args "namespace eval $name \$args"
} 
;# our object
thingy svg

;# some variables
svg set code "" ;# the svg code
svg set header {<?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" height="__HEIGHT__" width="__WIDTH__">}    
svg set footer {</svg>}
svg set width 100
svg set height 100

;# lets look what variables are there
info vars svg::* 

We now need a method unknown which catches all command on the object and forward this to the tag creation method.

;# the actual tag svg creation method
svg proc tag {args} {
    variable code
    set tag [lindex $args 0]
    set args [lrange $args 1 end]
    set ret "\n<$tag"
    foreach {key val} $args {
        if {$val eq ""} {
            append ret ">\n$key\n</$tag>\n"
            break
        } else {
            append ret " $key=\"$val\""
        }
    }
    if {$val ne ""} {
        append ret " />\n"
    }
    append code $ret
}

;# any unknown should forward to the tag method
namespace eval svg {
    namespace unknown svg::tag
}

; # write out the current svg code 
svg proc write {filename} {
    variable width
    variable height
    variable header
    variable footer
    variable code
    set out [open $filename w 0600]
    set head [regsub {__HEIGHT__} $header $height]
    set head [regsub {__WIDTH__} $head $width]
    puts $out $head
    puts $out $code
    puts $out $footer
    close $out
}

;# what methods we have
info commands svg::*

Ok we are now ready to go: Let's create the typical "Hello World!" example, the first argument will be the tag every remaining pairs will be the attribute and the value, remaining single arguments will be placed within the tag as content:

svg circle cx 50 cy 50 r 45 stroke black stroke-width 2 fill salmon
svg text x 29 y 45 Hello
svg text x 27 y 65 World!
svg write images/hello-world.svg

Let's now display the image:

 ![](images/hello-world.svg)

Here the image displayed:

Let's now clean up the svg code:

svg set code ""

We can now create an other image, let's create a chessboard:

svg set width 420
svg set height 420
for {set i 0} {$i < 8} {incr i} {
    if {[expr {$i % 2}] == 0} {
        set cols [join [lrepeat 4 [list cornsilk burlywood]]]
    } else {
        set cols [join [lrepeat 4 [list burlywood cornsilk ]]]
    }   
    for {set j 0} {$j < 8} {incr j} {
        set x [expr {10+$i*50}]
        set y [expr {10+$j*50}]
        svg rect x $x y $y width 50 height 50 fill [lindex $cols $j] stroke-width 3
    }
    svg rect x 6 y 6 width 408 height 408 stroke sienna stroke-width 7 fill transparent
}   
svg write images/chessboard.svg

Great! Let's now illustrate a few more basic shapes. We will follow the examples at https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Basic_Shapes

But first let's rewrite the svg tag function so that we can as well take a list of attributes.

svg proc tag {args} {
    variable code
    set tag [lindex $args 0]
    set args [lrange $args 1 end]
    set ret "\n<$tag"
    # new check if attr="val" syntax  
    if {[regexp {=} [lindex $args 0]]} {
        set nargs [list]
        foreach kval $args {
            set idx [string first = $kval]
            set key [string range $kval 0 $idx-1]
            set val [string range $kval $idx+2 end-1]
            lappend nargs $key
            lappend nargs $val
        }
        set args $nargs
    } 
    # end of new check
    foreach {key val} $args {
       if {$val eq ""} {
           append ret ">\n$key\n</$tag>\n"
           break
       } else {
           append ret " $key=\"$val\""
       }
    }
    if {$val ne ""} {
        append ret " />\n"
    }
    append code $ret
}

With this redefinition of the tag method we can now very easily copy the svg code from the website. We just have to remove the greater, smaller and slash tag signs from the svg code. As arguments to functions in Tcl are separated by spaces we have to protect attributes containing spaces with curly braces for the last three shapes, the polyline, the polygon and the path.

svg set code "" ;# cleanup chessboard
svg set width 200 ;# new size as on the webpage
svg set height 250 
svg rect x="10" y="10" width="30" height="30" stroke="black" fill="transparent" stroke-width="5"
svg rect x="60" y="10" rx="10" ry="10" width="30" height="30" \
    stroke="black" fill="transparent" stroke-width="5"
svg circle cx="25" cy="75" r="20" stroke="red" fill="transparent" stroke-width="5"
svg ellipse cx="75" cy="75" rx="20" ry="5" stroke="red" fill="transparent" stroke-width="5"
svg line x1="10" x2="50" y1="110" y2="150" stroke="orange" stroke-width="5"
svg polyline {points="60 110 65 120 70 115 75 130 80 125 85 140 90 135 95 150 100 145"} \
     stroke="orange" fill="transparent" stroke-width="5"
svg polygon {points="50 160 55 180 70 180 60 190 65 205 50 195 35 205 40 190 30 180 45 180"} \
     stroke="green" fill="transparent" stroke-width="5"
svg path {d="M20,230 Q40,205 50,230 T90,230"} fill="none" stroke="blue" stroke-width="5"
svg write images/basic-shapes.svg

Ok, great basic shapes can be directly copied from svg code and with a few modifications we can create valid Tcl code out of the svg code. Please note, that from the code shown in this Readme the package tsvg was derived which does not need this protecting of the spaces within the attributes. See below the section about the tsvg plugin for more details.

Code chunk attributes for svg figures

Let's introduce now a few code chunk attributes for figures as they are known for instance in R.

Below an example:

    ```{.tcl fig=true fig.width=400 fig.height=400}
    # some figure code
    ```

This code should call some procedure figure with the arguments of a basic filename, fig.width, fig.height and it should return a filename with an extension like .svg

Here an outline of such a function:

proc figure {filename width height args} {
    # parse args, get width, get height
    # write file
    # return filename with extension
}

Ok, lets now implement our figure procedure for our svg:

proc figure {filename width height args} {
    svg set width $width
    svg set height $height
    svg write images/$filename.svg
    return $filename.svg
}

Now in the next code chunk we create a new figure:

 ` ``{.tcl label=figsample fig=true width=80 height=80}
 svg set code ""
 svg rect x 0 y 0 width 80 height 80 fill cornsilk
 svg rect x 10 y 10 width 60 height 60 fill salmon
 ` ``
   
 ![](images/figsample.svg)

Here the actual code (the space between the backticks was added to avoid interpretation problems by pandoc):

svg set code ""
svg rect x 0 y 0 width 80 height 80 fill cornsilk
svg rect x 10 y 10 width 60 height 60 fill salmon

  • TODO: autoembedding of figures by chunk number

Other filters

The pantcl filter supports as well generation of filters for other tools and programming languages using the Tcl programming language. The standalone application pantcl.bin comes with the following filters:

filter Tool URL
.abc ABC music http://moinejf.free.fr/
.cmd Bash scripts
.dot dot/neato (GraphViz) https://graphviz.org/
.emf Jasspa MicroEmacs (me) http://www.jasspa.com
.eqn eqn2graph (groff) https://www.gnu.org/software/groff/
.mmd mmdc (Mermaid-cli) https://www.npmjs.com/package/mermaid.cli
.mtex LaTex https://www.latex-project.org/
.pic pic2graph (groff) https://www.gnu.org/software/groff/
.pik pikchr/fossil pikchr https://www.fossil-scm.org/home/doc/trunk/www/pikchr.md
.pipe R, python, octave
.puml plantuml https://plantuml.com/
.rplot Rscript https://www.r-project.org
.sqlite sqlite3 https://www.sqlite.org
.tcl tclsh https://www.tcl.tk
.tcrd Tcl (chords for songs)
.tdot Tcl tdot package https://github.com/mittelmark/DGTcl
.tsvg Tcl tsvg package https://github.com/mittelmark/DGTcl

Dot file filter

Let's finish our small tutorial with the implementation of a filter for a command line application. Below you see the code for the GraphViz dot application.

Here the code example (remove the space after the first backtick, space was added to avoid interpretation):

` ``{.dot label=digraph echo=true eval=true}
digraph G {
  main -> parse -> execute;
  main -> init [dir=none];
  main -> cleanup;
  execute -> make_string;
  execute -> printf
  init -> make_string;
  main -> printf;
  execute -> compare;
}
` ``

Which will produce the following output:

digraph G {
  main -> parse -> execute;
  main -> init [dir=none];
  main -> cleanup;
  execute -> make_string;
  execute -> printf
  init -> make_string;
  main -> printf;
  execute -> compare;
}

Using the chunk option echo=false, we can as well hide the source code. If you would like to see the code you now have to consult the Markdown file.

digraph G {
  main [shape=box,style=filled,fillcolor=".5 .8 1.0"] ;
  main -> parse -> execute;
  main -> init [style=dotted];
  main -> cleanup;
  execute -> make_string;
  execute -> printf
  edge [color="red",dir=none];
  init -> make_string;
  main -> printf;
  execute -> compare;
}

To avoid automatic placement of figures you can as well set the option include to false include=false and then create the usual Markdown code for the figure where the basename is defined by a images subfolder the chunk label.

` ``{.dot label=digraph3 echo=false include=false eval=true}
digraph G {
  main [shape=box,style=filled,fillcolor=".5 .8 1.0"] ;
  main -> parse -> execute;
  main -> init [style=dotted];
  main -> cleanup;
  execute -> make_string;
  execute -> printf
  edge [color="red"];
  init -> make_string;
  edge [dir="none"]; // no arrows
  main -> printf;
  execute -> compare;
}
` ``
![](images/digraph3.svg)

This will produce the following:

digraph G {
  main [shape=box,style=filled,fillcolor="0.95 0.90 .90"] ;
  main -> parse -> execute;
  main -> init [style=dotted];
  main -> cleanup;
  execute -> make_string;
  execute -> printf
  edge [color="red"];
  init -> make_string;
  edge [dir="none"];
  main -> printf;
  execute -> compare;
}

OK, now you know what was the code to create the graphic above.

The dot filter supports as well the other command line applications from the GraphViz toolbox. To switch for instance from the dot command line application to the neato application give the chunk argument app=neato and you can enter neato code in your code chunk here an example:

` ``{.dot label=neato app=neato eval=true}
graph G {
    node [shape=box,style=filled,fillcolor=skyblue,
        color=black,width=0.4,height=0.4];
    n0 -- n1 -- n2 -- n3 -- n0 ;
}
` ``

Which will produce this:

graph G {
    node [shape=box,style=filled,fillcolor=skyblue,
        color=black,width=0.4,height=0.4];
    n0 -- n1 -- n2 -- n3 -- n0 ;
}

You can try out as well the GraphViz layout engines yourself. Please have a look at the GraphViz homepage at https://www.graphviz.org/docs/layouts/.

tsvg plugin

The code shown above creating svg files using the thingy object was as well saved as a plugin with some modifications and extensions. That way you can include code creating svg files using the described syntax above. Please not that the plugin object is named tsvg. Here an example.

` ``{.tsvg label=tsvg-hello-world results=hide echo=false eval=true}
tsvg circle cx 50 cy 50 r 45 stroke black stroke-width 2 fill salmon
tsvg text x 29 y 45 Hello
tsvg text x 26 y 65 World!
` ```

Which will produce this:

tsvg circle cx 50 cy 50 r 45 stroke black stroke-width 2 fill salmon
tsvg text x 29 y 45 Hello
tsvg text x 26 y 65 World!

In contrast to the svg code developed above the tsvg plugin allows you to send the attributes containing as well spaces as they are, the tag method will clean up the lists arguments by using the paired quotes. This greatly simplifies the copy and paste procedure for existing svg examples, you in many cases just have to remove the leading and trailing greater and lower signs. Here is an example using different syntax types:

tsvg set code ""
tsvg set width 180
tsvg set height 200
tsvg rect x 10 y 10 width 160 height 180 style "fill:#ddeeff;"
tsvg circle cx="130" cy="120" r="20" stroke="red" stroke-width="2" fill="salmon"
tsvg polyline points="0,40 40,40 40,80 80,80 80,120 120,120 120,160" \
   style="fill:white;stroke:red;stroke-width:4"

For more information about the tsvg package visit the tsvg manual page.

Filter for Math-Tex

This filter requires a LaTeX installation and the texlive-standalone package. The plugin uses in the background conversion of a LaTeX formula using the latex command line application and thereafter a conversion to png using the dvipgn application which is part of the LaTeX installation. Please note that currently only single line equations are supported:

Here two examples:

$ E = m \times c^2 $

And here the second example:

$ F(x) = \int^a_b \frac{1}{3}x^3 $

May be later version will support aligned sets of equations or matrices.

PIC and EQN filters

The groff typesetting systems comes with the tools eqn2graph which converts EQN equations into PNG graphics and and pic2graph which converts diagram code written in the PIC programming language into PNG graphics. Below are two examples, one for each tool:

Here an example for the PIC language:

     ```{.pic ext=png eval=true}
     circle "circle" rad 0.5 fill 0.3; arrow ;
     ellipse "ellipse" wid 1.4 ht 1 fill 0.1 ; line;
     box wid 1 ht 1 fill 0.05 "A";
     spline;
     box wid 0.4 ht 0.4 fill 0.05 "B";
     arc;
     box wid 0.2 ht 0.2 fill 0.05 "C";
     ```

And here the output:

circle "circle" rad 0.5 fill 0.3; arrow ;
ellipse "ellipse" wid 1.4 ht 1 fill 0.1 ; line;
box wid 1 ht 1 fill 0.05 "A";
spline;
box wid 0.4 ht 0.4 fill 0.05 "B";
arc;
box wid 0.2 ht 0.2 fill 0.05 "C";

The complete code was:

     ```{.pic ext=png eval=true}
     circle "circle" rad 0.5 fill 0.3; arrow ;
     ellipse "ellipse" wid 1.4 ht 1 fill 0.1 ; line;
     box wid 1 ht 1 fill 0.05 "A";
     spline;
     box wid 0.4 ht 0.4 fill 0.05 "B";
     arc;
     box wid 0.2 ht 0.2 fill 0.05 "C";
     ```

And here an example for the EQN language:

x = {-b +- sqrt{b sup 2 - 4ac}} over 2a

The code here was (the indentation of five spaces is just to avoid interpretation), density 144 was used to make the equation smaller:

     ```{.eqn echo=false eval=true density=144}
     x = {-b +- sqrt{b sup 2 - 4ac}} over 2a
     ```

Pikchr filter

The PIC diagram language has a modern successor, the Pikchr diagram language used on the Sqlite webpage to display syntax diagrams. The homepage of the pikchr tool is at: https://pikchr.org/. The tool can be compiled easily, but even easier you can as well download the fossil application which has a subcommand pikchr which allows you to create as well diagrams. The downloads of fossil for various platforms can be found here https://www.fossil-scm.org/home/uv/download.html.

If the fossil application is in your PATH ou can create easily as well pikchr diagrams. Here an example:

box "box"
circle "circle" fill cornsilk at 1 right of previous
ellipse "ellipse" at 1 right of previous
oval "oval" at .8 below first box
cylinder "cylinder" at 1 right of previous
file "file" at 1 right of previous

The code for this diagram follows below:

` ``{.pikchr app=fossil ext=pdf eval=true}
box "box"
circle "circle" fill cornsilk at 1 right of previous
ellipse "ellipse" at 1 right of previous
oval "oval" at .8 below first box
cylinder "cylinder" at 1 right of previous
file "file" at 1 right of previous
` ``

Please note, that at least fossil in version 2.13 or higher is required.

We can as well resize the image. In this case we have to create a png extension. As conversion from svg to png is then required we need a tool called cairosvg which can be installed as a Python packagte using pip:

pip3 install cairosvg --user

Should do this. The advantage if using this tool is, that we beside resizing we can as well create PDF's for inclusion into LaTeX documents. Here an example for a PNG image.

box "box"
circle "circle" fill cornsilk at 1 right of previous
ellipse "ellipse" at 1 right of previous
oval "oval" at .8 below first box
cylinder "cylinder" at 1 right of previous
file "file" at 1 right of previous

Here is the code:

` ``{.pikchr app=fossil ext=png  width=500 height=300 eval=true}
` ``

As you can see using the ext=png setting and the width and height options, we can resize the image.

Rplot filter

The usual way to embed R code in Markdown is using the R-knitr library and then use R to execute the code embedded within the R-Markdown file. This type of execution is however not compatible with pandoc as knitr modifies the code chunks without R-code as well. So it is not easily possible to embed other filters in documents processed with R/knitr first. Although the R-knitr command is useful if the main focus is on R, it is however not favourable if you just would like to add a few plots or execute a few statements. For a few simple plots you can use the filter .rplot to embed them within your document. Here an example.

data(iris)
pairs(iris[,1:3],pch=19,col=as.numeric(iris$Species)+1)
x=1

Here is the code:

` ``{.rplot label=iris echo=true results="hide" width=800 height=600 eval=true}
data(iris)
pairs(iris[,1:3],pch=19,col=as.numeric(iris$Species)+1)
` ``

And here just some code without a figure.

print(head(iris))

That is the code:

` ``{.rplot fig=false eval=true} 
print(head(iris))
` ``

Session are as well retained, so you can use variables created in code chunks before.

print(x)

Here the code:

` ``{.rplot fig=false eval=true} 
print(x)
` ``

In contrast to the R-knitr tool this filter will start for each chunk a new process, so it is much slower then the R-knitr tool, so as I have written above, it should be used mostly for Markdown documents with just a few code chunks and with simple outputs. Thre is no support for sophisticated features like nice tables etc..

Lua filters

Pandoc since version 2.0 has embedded support for Lua filters. To no reinvent every filter again you should use Lua filters if they are available. Below an example for a Lua filter:

 **strong** should be converted to smallcaps using the Lua filter _smallcaps.lua_!

strong should be converted to smallcaps using the Lua filter smallcaps.lua! To apply Lua filters use the pandoc option --lua-filter=path/to/smallcaps.lua.

For more details see the Pandoc documentation at https://pandoc.org/lua-filters.html and for examples of Lua filter look at GitHub https://github.com/pandoc/lua-filters.

Summary

In this Readme I explained on how to use the Tcl pandoc filter to embed and process Tcl code during the creation of HTML or PDF documents. The Tcl filter was generalized so that as well filters for other tools, especially command line application can be easily programmed using the Tcl programming language. Examples for a filter for the GraphViz tool dot to create flowcharts and graphs, a package to create SVG images using Tcl, the new tsvg package, a little renderer for single TeX equations, filters for the PIC and EQN langauges and as well for the Pikchr diagram tools are as well included in the pantcl.bin file. The provided infrastructure has the advantage that Tcl programmers can stay within their favourite programming language but still can use other nice tools easily for their documentation. In case of new may be complex things look for existing Lua filters. As Lua is embedded into Pandoc have a look for an existing Lua filter to not reinvent the (filter) wheel.

Documentation

The HTML version of this document was generated using the following commandline:

pantcl.bin pantcl-tutorial.md pantcl-tutorial.html --css mini.css -s
     --toc --lua-filter=lib/tclfilters/smallcaps.lua

Please look at the source Markdown file to see which Markdown code was the input.

Links

Todo

  • code block labels (label=chunkname) - done
  • code block figures (include=false fig=true) - done
  • regular filter infrastructure for Tcl support for for instance other filters like .csv to include csv files .dot to include dot file graphics etc. - done (examples for dot code and tsvg plugin)
  • Windows exe / starkit containing the rl_json library as well (adding linux library)

Author

@2021-2023: Detlef Groth, Caputh-Schwielowsee, Germany

License

BSD license.