Fossil

Help: pikchr
Login

The "pikchr" command:

Usage: fossil pikchr [options] ?INFILE? ?OUTFILE?

Accepts a pikchr script as input and outputs the rendered script as an SVG graphic. The INFILE and OUTFILE options default to stdin resp. stdout, and the names "-" can be used as aliases for those streams.

Options:

-div
On success, adds a DIV wrapper around the resulting SVG output which limits its max-width to its computed maximum ideal size.

-div-indent
Like -div but indents the div.

-div-center
Like -div but centers the div.

-div-left
Like -div but floats the div left.

-div-right
Like -div but floats the div right.

-div-toggle
Sets the 'toggle' CSS class on the div (used by the JavaScript-side post-processor).

-div-source
Sets the 'source' CSS class on the div, which tells CSS to hide the SVG and reveal the source by default.

-src
Stores the input pikchr's source code in the output as a separate element adjacent to the SVG one. Implied by -div-source.

-th
Process the input using TH1 before passing it to pikchr.

-th-novar
Disable $var and $<var> TH1 processing. Use this if the pikchr script uses '$' for its own purposes and that causes issues. This only affects parsing of '$' outside of TH1 script blocks. Code in such blocks is unaffected.

-th-nosvg
When using -th, output the post-TH1'd script instead of the pikchr-rendered output.

-th-trace
Trace TH1 execution (for debugging purposes).

The -div-indent/center/left/right flags may not be combined.

TH1-related Notes and Caveats:

If the -th flag is used, this command must open a fossil database for certain functionality to work (via a checkout or the -R REPO flag). If opening a db fails, execution will continue but any TH1 commands which require a db will trigger a fatal error.

In Fossil skins, TH1 variables in the form $varName are expanded as-is and those in the form $<varName> are htmlized in the resulting output. This processor disables the htmlizing step, so $x and $<x> are equivalent unless the TH1-processed pikchr script invokes the TH1 command [enable_htmlify 1] to enable it. Normally that option will interfere with pikchr output, however, e.g. by HTML-encoding double-quotes.

Many of the fossil-installed TH1 functions simply do not make any sense for pikchr scripts.