-
Notifications
You must be signed in to change notification settings - Fork 0
/
pantcl.html
682 lines (680 loc) · 31 KB
/
pantcl.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
<!DOCTYPE html>
<html lang="" xml:lang="" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta content="pandoc" name="generator"/>
<meta content="width=device-width, initial-scale=1.0, user-scalable=yes" name="viewport"/>
<meta content="Detlef Groth, Schwielowsee, Germany" name="author"/>
<meta content="2024-11-25" name="dcterms.date"/>
<title>pantcl filter documentation - 0.9.14</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
/* The extra [class] is a hack that increases specificity enough to
override a similar rule in reveal.js */
ul.task-list[class]{list-style: none;}
ul.task-list li input[type="checkbox"] {
font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<link href="data:text/css,%20%20%20%20html%20%7B%0A%20%20%20%20%20%20%20%20overflow-y%3A%20scroll%3B%0A%20%20%20%20%7D%0A%20%20%20%20body%20%7B%0A%20%20%20%20%20%20%20%20color%3A%20%23444%3B%0A%20%20%20%20%20%20%20%20font-family%3A%20Georgia%2C%20Palatino%2C%20%27Palatino%20Linotype%27%2C%20Times%2C%20%27Times%20New%20Roman%27%2C%20serif%3B%0A%20%20%20%20%20%20%20%20line-height%3A%201.2%3B%0A%20%20%20%20%20%20%20%20padding%3A%201em%3B%0A%20%20%20%20%20%20%20%20margin%3A%20auto%3B%0A%20%20%20%20%20%20%20%20max-width%3A%20%20900px%3B%0A%20%20%20%20%7D%0A%20%20%20%20a%20%7B%0A%20%20%20%20%20%20%20%20color%3A%20%230645ad%3B%0A%20%20%20%20%20%20%20%20text-decoration%3A%20none%3B%0A%20%20%20%20%7D%0A%20%20%20%20a%3Avisited%20%7B%0A%20%20%20%20%20%20%20%20color%3A%20%230b0080%3B%0A%20%20%20%20%7D%0A%20%20%20%20a%3Ahover%20%7B%0A%20%20%20%20%20%20%20%20color%3A%20%2306e%3B%0A%20%20%20%20%7D%0A%20%20%20%20a%3Aactive%20%7B%0A%20%20%20%20%20%20%20%20color%3A%20%23faa700%3B%0A%20%20%20%20%7D%0A%20%20%20%20a%3Afocus%20%7B%0A%20%20%20%20%20%20%20%20outline%3A%20thin%20dotted%3B%0A%20%20%20%20%7D%0A%20%20%20%20p%20%7B%0A%20%20%20%20%20%20%20%20margin%3A%200.5em%200%3B%0A%20%20%20%20%7D%0A%20%20%20%20p.date%20%7B%0A%20%20%20%20%20%20%20%20text-align%3A%20center%3B%0A%20%20%20%20%7D%0A%20%20%20%20img%20%7B%0A%20%20%20%20%20%20%20%20max-width%3A%20100%25%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20h1%2C%20h2%2C%20h3%2C%20h4%2C%20h5%2C%20h6%20%7B%0A%20%20%20%20%20%20%20%20color%3A%20%23111%3B%0A%20%20%20%20%20%20%20%20line-height%3A%20115%25%3B%0A%20%20%20%20%20%20%20%20margin-top%3A%201em%3B%0A%20%20%20%20%20%20%20%20font-weight%3A%20normal%3B%0A%20%20%20%20%7D%0A%20%20%20%20h1%20%7B%0A%20%20%20%20%20%20%20%20text-align%3A%20center%3B%0A%20%20%20%20%20%20%20%20font-size%3A%20120%25%3B%0A%20%20%20%20%7D%0A%20%20%20%20h2.author%2C%20h2.date%20%7B%0A%20%20%20%20%20%20%20%20text-align%3Acenter%3B%0A%20%20%20%20%20%20%20%20font-size%3A%20100%25%0A%20%20%20%20%7D%0A%20%20%20%20p.author%2C%20p.date%20%7B%0A%20%20%20%20%20%20%20%20font-size%3A%20110%25%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A/%2A%20%20%20%20h2%20%7B%0A%20%20%20%20%20%20%20%20text-transform%3A%20uppercase%3B%0A%20%20%20%20%7D%0A%20%20%20%20%2A/%0A%20%20%20%20pre%2C%20blockquote%20pre%20%7B%0A%20%20%20%20%20%20%20%20border-top%3A%200.1em%20%239ac%20solid%3B%0A%20%20%20%20%20%20%20%20background%3A%20%23e9f6ff%3B%0A%20%20%20%20%20%20%20%20padding%3A%2010px%3B%0A%20%20%20%20%20%20%20%20border-bottom%3A%200.1em%20%239ac%20solid%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20blockquote%20%7B%0A%20%20%20%20%20%20%20%20margin%3A%200%3B%0A%20%20%20%20%20%20%20%20padding-left%3A%203em%3B%20%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20hr%20%7B%0A%20%20%20%20%20%20%20%20display%3A%20block%3B%0A%20%20%20%20%20%20%20%20height%3A%202px%3B%0A%20%20%20%20%20%20%20%20border%3A%200%3B%0A%20%20%20%20%20%20%20%20border-top%3A%201px%20solid%20%23aaa%3B%0A%20%20%20%20%20%20%20%20border-bottom%3A%201px%20solid%20%23eee%3B%0A%20%20%20%20%20%20%20%20margin%3A%201em%200%3B%0A%20%20%20%20%20%20%20%20padding%3A%200%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20pre%2C%20code%2C%20kbd%2C%20samp%20%7B%0A%20%20%20%20%20%20%20%20color%3A%20%23000%3B%0A%20%20%20%20%20%20%20%20font-family%3A%20Monaco%2C%20%27courier%20new%27%2C%20monospace%3B%0A%20%20%20%20%20%20%20%20font-size%3A%2090%25%3B%20%0A%20%20%20%20%7D%0A%20%20%20%20code.r%20%7B%0A%20%20%20%20%20%20%20%20color%3A%20%23770000%3B%0A%20%20%20%20%7D%0A%20%20%20%20pre%3Ahas%28code.tclout%29%20%7B%0A%20%20%20%20%20%20%20%20background%3A%20%23ffeeee%3B%0A%20%20%20%20%7D%0A%20%20%20%20pre%20%7B%0A%20%20%20%20%20%20%20%20white-space%3A%20pre%3B%0A%20%20%20%20%20%20%20%20white-space%3A%20pre-wrap%3B%0A%20%20%20%20%20%20%20%20word-wrap%3A%20break-word%3B%0A%20%20%20%20%7D%0A%20%20%20%20/%2A%20fix%2C%20do%20not%20like%20bold%20for%20every%20keyword%20%2A/%0A%20%20%20%20code%20span.kw%20%7B%20color%3A%20%23007020%3B%20font-weight%3A%20normal%3B%20%7D%20/%2A%20Keyword%20%2A/%0A%20%20%20%20%20pre.sourceCode%20%7B%0A%20%20%20%20%20%20%20%20background%3A%20%23fff6f6%3B%0A%20%20%20%20%7D%20%0A%20%20%20%20figure%2C%20p.author%20%7B%0A%20%20%20%20%20%20%20%20text-align%3A%20center%3B%0A%20%20%20%20%7D%0A%20%20%20%20table%20%7B%20%20%20%20%0A%20%20%20%20%20%20%20%20border-collapse%3A%20collapse%3B%0A%20%20%20%20%20%20%20%20border-bottom%3A%202px%20solid%3B%0A%20%20%20%20%20%20%20%20border-spacing%3A%205px%3B%0A%20%20%20%20%20%20%20%20min-width%3A%20400px%3B%0A%20%20%20%20%7D%0A%20%20%20%20table%20thead%20tr%20th%20%7B%20%0A%20%20%20%20%20%20%20%20background-color%3A%20%23fde9d9%3B%0A%20%20%20%20%20%20%20%20text-align%3A%20left%3B%20%0A%20%20%20%20%20%20%20%20padding%3A%2010px%3B%0A%20%20%20%20%20%20%20%20border-top%3A%202px%20solid%3B%0A%20%20%20%20%20%20%20%20border-bottom%3A%202px%20solid%3B%0A%20%20%20%20%7D%0A%20%20%20%20table%20td%20%7B%20%0A%20%20%20%20%20%20%20%20background-color%3A%20%23fff9e9%3B%0A%0A%20%20%20%20%20%20%20%20text-align%3A%20left%3B%20%0A%20%20%20%20%20%20%20%20padding%3A%2010px%3B%0A%20%20%20%20%7D%0A" rel="stylesheet"/><!--URL:mini.css-->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header id="title-block-header">
<h1 class="title">pantcl filter documentation - 0.9.14</h1>
<p class="author">Detlef Groth, Schwielowsee, Germany</p>
<p class="date">2024-11-25</p>
</header>
<hr/>
<center>
<p>Filters: <a href="lib/tclfilters/filter-abc.html">filter-abc</a> - <a href="lib/tclfilters/filter-cmd.html">filter-cmd</a> - <a href="lib/tclfilters/filter-dot.html">filter-dot</a> - <a href="lib/tclfilters/filter-eqn.html">filter-eqn</a> - <a href="lib/tclfilters/filter-mmd.html">filter-mmd</a> - <a href="lib/tclfilters/filter-mtex.html">filter-mtex</a> - <a href="lib/tclfilters/filter-pic.html">filter-pic</a> - <a href="lib/tclfilters/filter-pik.html">filter-pik</a> - <a href="lib/tclfilters/filter-pipe.html">filter-pipe</a> - <a href="lib/tclfilters/filter-puml.html">filter-puml</a> - <a href="lib/tclfilters/filter-rplot.html">filter-rplot</a> - <a href="lib/tclfilters/filter-sqlite.html">filter-sqlite</a> - <a href="lib/tclfilters/filter-tcrd.html">filter-tcrd</a> - <a href="lib/tclfilters/filter-tcl.html">filter-tcl</a> - <a href="lib/tclfilters/filter-tdot.html">filter-tdot</a> - <a href="lib/tclfilters/filter-tsvg.html">filter-tsvg</a> <br/></p>
Documentation: <a href="pantcl.html">Pantcl documentation</a> - <a href="pantcl-tutorial.html">Pantcl Tutorial</a> - <a href="README.html">Pantcl Readme</a> - <a href="lib/fview/filter-view.html">Pantcl GUI filter viewer</a>
</center>
<hr/>
<h2 id="name">NAME</h2>
<p><em>pantcl.tcl</em> - filter application for the pandoc command line
application to convert Markdown files into other formats. The filter
allows you to embed Tcl code into your Markdown documentation and offers
a plugin architecture to add other command line filters easily using Tcl
and the <code>exec</code> command. As examples are given in the filter
folder of the project:</p>
<ul>
<li>Tcl filter {.tcl}: <code>filter-tcl.tcl</code> <a href="filter/filter-tcl.html">filter/filter-tcl.html</a></li>
<li>ABC music filter {.abc}: <code>filter-abc.tcl</code> <a href="filter/filter-abc.html">filter/filter-abc.html</a></li>
<li>command line application filter {.cmd}: <code>filter-cmd.tcl</code>
<a href="filter/filter-cmd.html">filter/filter-abc.html</a></li>
<li>Graphviz dot filter {.dot}: <code>filter-dot.tcl</code> <a href="filter/filter-dot.html">filter/filter-dot.html</a></li>
<li>EQN filter plugin for equations written in the EQN language {.eqn}:
<code>filter-eqn</code> <a href="filter/filter-eqn.html">filter/filter-eqn.html</a></li>
<li>Julia filter plugin for Julia clode {.julia}:
<code>filter-julia</code> <a href="filter/filter-julia.html">filter/filter-julia.html</a></li>
<li>Math TeX filter for single line equations {.mtex}:
<code>filter-mtex.tcl</code> <a href="filter/filter-mtex.html">filter/filter-mtex.html</a></li>
<li>Mermaid filter for diagrams {.mmd}: <code>filter-mmd.tcl</code> <a href="filter/filter-mmd.html">filter/filter-mmd.html</a></li>
<li>Pikchr filter plugin for diagram creation {.pikchr}:
<code>filter-pik.tcl</code> <a href="filter/filter-pik.html">filter/filter-pik.html</a></li>
<li>PIC filter plugin for diagram creation (older version) {.pic}:
<code>filter-pic.tcl</code> <a href="filter/filter-pic.html">filter/filter-pic.html</a></li>
<li>pipe filter for R, Python and Octave {.pipe}:
<code>filter-pipe.tcl</code> <a href="filter/filter-pipe.html">filter/filter-pipe.html</a></li>
<li>PlantUMLfilter plugin for diagram creation {.puml}:
<code>filter-puml.tcl</code> <a href="filter/filter-puml.html">filter/filter-puml.html</a></li>
<li>R plot filter plugin for displaying plots in the R statistical
language {.rplot}: <code>filter-rplot.tcl</code> <a href="filter/filter-rplot.html">filter/filter-rplot.html</a></li>
<li>sqlite3 filter plugin to evaluate SQL code {.sqlite}:
<code>filter-sqlite.tcl</code> <a href="filter/filter-sqlite.html">filter/filter-sqlite.html</a></li>
<li>tcrd filter for music songs with chords {.tcrd}:
<code>filter-tcrd.tcl</code> <a href="filter/filter-tcrd.html">filter/filter-tcrd.html</a></li>
<li>tdot package filter {.tsvg}: <code>filter-tdot.tcl</code> <a href="filter/filter-tdot.html">filter/filter-tdot.html</a></li>
<li>tsvg package filter {.tsvg}: <code>filter-tsvg.tcl</code> <a href="filter/filter-tsvg.html">filter/filter-tsvg.html</a></li>
</ul>
<h2 id="synopsis">SYNOPSIS</h2>
<p>We assume that you renamed the standalone file
<code>pantcl.tapp</code> to <code>pantcl</code> and that this file is in
your path.</p>
<pre><code># standalone application
pantcl infile outfile ?options?
# as filter
pandoc infile --filter pantcl ?options?
# as graphics user interface
pantcl --gui [filename]</code></pre>
<p>Where options for the filter and the standalone mode are the usual
pandoc options. For HTML conversion you should use for instance:</p>
<pre><code>pantcl infile.md outfile.html --css style.css -s --toc</code></pre>
<p>Please note, that you can rename as well the file
<code>pantcl.tapp</code> into other names like <code>pantcl.bin</code>,
however the basename <code>pantcl</code> must stay the same.</p>
<h2 id="code-embedding">Code embedding</h2>
<p>Embed code either inline or in form of code chunks like here (triple
ticks):</p>
<pre><code> ```{.tcl}
set x 4
incr x
set x
```
Hello this is Tcl `tcl package provide Tcl`!</code></pre>
<h2 id="filter-overview">Filter Overview</h2>
<p>The markers for the other filters are:</p>
<p><code class="sourceCode dot"><span class="ot">{</span><span class="co">.</span><span class="va">abc</span><span class="ot">}</span>,</code><code class="eqn">,</code><code class="sourceCode julia">,</code><code class="sourceCode markdown">,</code><code class="mtex">,</code><code class="pic">,</code><code class="pikchr">,</code>, <code>{.puml}</code>,
<code>{.rplot}</code>,<code>{.sqlite}</code> and
<code>{.tsvg}</code>.</p>
<p>For details on how to use them have a look at the manual page links
on top.</p>
<p>You can combine all filters in one document just by using the
appropiate markers.</p>
<p>Here an overview about the required tools to use a filter:</p>
<center>
<table>
<colgroup>
<col style="width: 22%"/>
<col style="width: 18%"/>
<col style="width: 14%"/>
<col style="width: 14%"/>
<col style="width: 14%"/>
<col style="width: 14%"/>
</colgroup>
<thead>
<tr class="header">
<th>filter</th>
<th>tool</th>
<th>svg</th>
<th>png</th>
<th>pdf</th>
<th>comment</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>.tcl</td>
<td>tclsh</td>
<td>tsvg</td>
<td>cairosvg</td>
<td>cairosvg</td>
<td>programming</td>
</tr>
<tr class="even">
<td>.abc</td>
<td>abcm2ps</td>
<td>abcm2ps</td>
<td>cairosvg</td>
<td>cairosvg</td>
<td>music</td>
</tr>
<tr class="odd">
<td>.dot</td>
<td>dot</td>
<td>native</td>
<td>native</td>
<td>native</td>
<td>diagrams</td>
</tr>
<tr class="even">
<td>.emf</td>
<td>jasspa microemacs</td>
<td>no</td>
<td>no</td>
<td>no</td>
<td>editor</td>
</tr>
<tr class="odd">
<td>.eqn</td>
<td>eqn2graph</td>
<td>no</td>
<td>convert</td>
<td>no</td>
<td>math</td>
</tr>
<tr class="even">
<td>.julia</td>
<td>julia</td>
<td>native</td>
<td>native</td>
<td>native</td>
<td>statistics</td>
</tr>
<tr class="odd">
<td>.mmd</td>
<td>mermaid-cli (mmdc)</td>
<td>native</td>
<td>native</td>
<td>native</td>
<td>diagrams</td>
</tr>
<tr class="even">
<td>.mtex</td>
<td>latex</td>
<td>dvisgm</td>
<td>dvipng</td>
<td>dvipdfm</td>
<td>math, diagrams, games</td>
</tr>
<tr class="odd">
<td>.pic</td>
<td>pic2graph</td>
<td>no</td>
<td>convert</td>
<td>no</td>
<td>diagrams</td>
</tr>
<tr class="even">
<td>.pik</td>
<td>fossil</td>
<td>native</td>
<td>cairosvg</td>
<td>cairosvg</td>
<td>diagrams</td>
</tr>
<tr class="odd">
<td>.pipe</td>
<td>R / python / octave</td>
<td>native</td>
<td>native</td>
<td>native</td>
<td>Statistics, Programming</td>
</tr>
<tr class="even">
<td>.puml</td>
<td>plantuml</td>
<td>native</td>
<td>native</td>
<td>native</td>
<td>diagrams</td>
</tr>
<tr class="odd">
<td>.rplot</td>
<td>R</td>
<td>native</td>
<td>native</td>
<td>native</td>
<td>statistics, graphics</td>
</tr>
<tr class="even">
<td>.tcrd</td>
<td>tclsh</td>
<td>no</td>
<td>no</td>
<td>no</td>
<td>music, songs with chords</td>
</tr>
<tr class="odd">
<td>.tdot</td>
<td>tclsh/dot</td>
<td>native</td>
<td>native</td>
<td>native</td>
<td>diagrams</td>
</tr>
<tr class="even">
<td>.tsvg</td>
<td>tclsh</td>
<td>native</td>
<td>cairosvg</td>
<td>cairosvg</td>
<td>graphics</td>
</tr>
</tbody>
</table>
</center>
<p>The Markdown document within this file could be extracted and
converted as follows:</p>
<pre><code> pantcl pantcl.tcl pantcl.html \
--css mini.css -s</code></pre>
<h2 id="example-tcl-filter">Example Tcl Filter</h2>
<h4 id="tcl-filter">Tcl-filter</h4>
<pre><code> ```{.tcl}
set x 1
puts $x
```</code></pre>
<p>And here the output:</p>
<pre class="tclinn"><code>set x 1
puts $x</code></pre>
<pre class="tclout"><code>1</code></pre>
<p>Does indented code blocks works as well?</p>
<blockquote>
<pre class="tclinn"><code>set x 2
puts $x</code></pre>
</blockquote>
<blockquote>
<pre class="tclout"><code>2</code></pre>
</blockquote>
<blockquote>
<p>Yes, since version 0.7.0!!</p>
</blockquote>
<p>There is as well the possibility to inline Tcl code like here:</p>
<pre><code>This document was processed using Tcl `tcl set tcl_patchLevel`!</code></pre>
<p>will produce:</p>
<p>This document was processed using Tcl 8.6.13!</p>
<p>This works as well in nested structures like lists or quotes.</p>
<blockquote>
<p>This document was processed using Tcl 8.6.13!</p>
</blockquote>
<blockquote>
<ul>
<li>This document was processed using Tcl 8.6.13!</li>
</ul>
</blockquote>
<h2 id="filter---plugins">Filter - Plugins</h2>
<p>The pantcl.tcl application allows to create custom filters for other
command line application quite easily. The Tcl files has to be named
<code>filter-NAME.tcl</code> where NAME hast to match the code chunk
marker. Below an example:</p>
<pre><code> ` ``{.dot label=dotgraph}
digraph G {
main -> parse -> execute;
main -> init;
main -> cleanup;
execute -> make_string;
execute -> printf
init -> make_string;
main -> printf;
execute -> compare;
}
![](dotgraph.svg)
` ``</code></pre>
<p>The main script <code>pantcl.tcl</code> evaluates if in the same
folder as the script is, if there any other files named
<code>filter/filter-NAME.tcl</code> and sources them. In case of the dot
filter the file is named <code>filter-dot.tcl</code> and its filter
function <code>filter-dot</code> is executed. Below is the simplified
code: of this file <code>filter-dot.tcl</code>:</p>
<pre class="tclinn"><code># a simple pandoc filter using Tcl
# the script pantcl.tcl
# must be in the same filter directoy of the pantcl.tcl file
proc filter-dot {cont dict} {
global n
incr n
set def [dict create app dot results show eval true fig true
label null ext svg width 400 height 400 \
include true imagepath images]
# fuse code chunk options with defaults
set dict [dict merge $def $dict]
set ret ""
if {[dict get $dict label] eq "null"} {
set fname dot-$n
} else {
set fname [dict get $dict label]
}
# save dot file
set out [open $fname.dot w 0600]
puts $out $cont
close $out
# TODO: error catching
set res [exec [dict get $dict app] -Tsvg $fname.dot -o $fname.svg]
if {[dict get $dict results] eq "show"} {
# should be usually empty
set res $res
} else {
set res ""
}
set img ""
if {[dict get $dict fig]} {
if {[dict get $dict include]} {
set img $fname.svg
}
}
return [list $res $img]
}</code></pre>
<p>Using the label and the option <code>include=false</code> we could
create an image link manually using Markdown syntax. The The image
filename should be then images/label.svg for instance.</p>
<h2 id="dot-example">Dot Example</h2>
<p>Here a longer dot-example where the code is include in</p>
<pre class="dotinn"><code>digraph G {
margin=0.1;
node[fontname="Linux Libertine";fontsize=18];
node[shape=box,style=filled;fillcolor=skyblue,width=1.2,height=0.9];
{ rank=same; Rst[group=g0,fillcolor=salmon] ;
Docx [group=g1,fillcolor=salmon]
}
{ rank=same; Md[group=g0,fillcolor=salmon] ;
pandoc ; AST1 ; filter[fillcolor=cornsilk] ; AST2 ; pandoc2;
Html[group=g1,fillcolor=salmon]
}
{ rank=same; Tex[group=g0,fillcolor=salmon] ;
Pdf[group=g1,fillcolor=salmon]; filters[fillcolor=cornsilk];
}
node[fillcolor=cornsilk];
{ rank=same; dot ; eqn; mtex; pic; pik; rplot; tsvg;}
Rst -> pandoc -> AST1 -> filter -> AST2 -> pandoc2 -> Html ;
Md -> pandoc;
Tex -> pandoc;
Rst -> Md -> Tex -> dot[style=invis] ;
pandoc2 -> Docx;
pandoc2 -> Pdf ;
Docx -> Html -> Pdf -> tsvg[style=invis];
pandoc2[label=pandoc];
filter[label="pantcl\nfilter"];
filter->filters;
filters -> dot ;
filters -> eqn ;
filters -> mtex;
filters -> pic ;
filters -> pik ;
filters -> rplot;
filters -> tsvg;
}</code></pre>
<h2 id="creating-markdown-code">Creating Markdown Code</h2>
<p>Since version 0.5.0 it is as well possible to create Markup code
within code blocks and to return it. To achieve this you to set use code
chunk option results like this: <code>results="asis"</code> - which
should be usually used together with <code>echo=false</code>. Here an
example:</p>
<pre><code> ```{.tcl echo=false results="asis"}
return "**this is bold** and _this is italic_ text!"
``` </code></pre>
<p>which gives this output:</p>
<p><strong>this is bold</strong> and <em>this is italic</em> text!</p>
<p>This can be as well used to include other Markup files. Here an
example:</p>
<pre><code> ```{.tcl results="asis"}
include tests/inc.md
```</code></pre>
<p>And here is the result:</p>
<pre class="tclinn"><code>include tests/inc.md</code></pre>
<p>I am test.md and here some text is written in
<strong>bold</strong>.</p>
<p>Please note, that currently no filters are applied on the included
files. You should process them before using the pandoc filters and
choose output format Markdown to include them later in your master
document.</p>
<p>To just show some file content as it is, remove the results=“asis”,
this can be as well useful to display some source code, let’s here
simply show here the content of <em>tests/inc.md</em> without
interpreting it as Markdown in a source code block:</p>
<pre><code> ```{.tcl results="show"}
include tests/inc.md
```</code></pre>
<p>And here is the result:</p>
<pre class="tclinn"><code>include tests/inc.md</code></pre>
<pre class="tclout"><code>I am test.md and here some text is written in **bold**.</code></pre>
<h2 id="documentation">Documentation</h2>
<p>To use this pipeline and to create pantcl.html out of the code
documentation in pantcl.tapp your command in the terminal is still
just:</p>
<pre><code>pantcl.tapp pantcl.tcl pantcl.html -s --css mini.css</code></pre>
<p>The result should be the file which you are looking currently.</p>
<h2 id="changelog">ChangeLog</h2>
<ul>
<li>2021-08-22 Version 0.1</li>
<li>2021-08-28 Version 0.2
<ul>
<li>adding custom filters structure (dot, tsvg examples)</li>
<li>adding attributes label, width, height, results</li>
</ul></li>
<li>2021-08-31 Version 0.3
<ul>
<li>moved filters into filter folder</li>
<li>plugin example mtex</li>
<li>default image path <em>images</em></li>
</ul></li>
<li>2021-11-03 Version 0.3.1
<ul>
<li>fix for parray and “puts stdout”</li>
</ul></li>
<li>2021-11-15 Version 0.3.2
<ul>
<li>–help argument support</li>
<li>–version argument support</li>
<li>filters for Pikchr, PIC and EQN</li>
</ul></li>
<li>2021-11-30 Version 0.3.3
<ul>
<li>filter for R plots: <code>.rplot</code></li>
</ul></li>
<li>2021-12-04 Version 0.4.0
<ul>
<li>pandoc-tcl-filter can be as well directly used for conversion being
then a frontend which calls pandoc internally with itself as a filter
…</li>
</ul></li>
<li>2021-12-12 Version 0.5.0
<ul>
<li>support for Markdown code creation in the Tcl filter with
results=“asis”</li>
<li>adding list2mdtab proc to the Tcl filter</li>
<li>adding include proc to the Tcl filter with results=‘asis’ other
Markdown files can be included.</li>
<li>support for <code>pandoc-tcl-filter.tcl infile --tangle .tcl</code>
to extract code chunks to the terminal</li>
<li>support for Mermaid diagrams</li>
<li>support for PlantUML diagrams</li>
<li>support for ABC music notation</li>
<li>bug fix for Tcl filters for <code>eval=false</code></li>
<li>documentation improvements for the filters and for the
pandoc-tcl-filter</li>
</ul></li>
<li>2022-01-09 - version 0.6.0
<ul>
<li>adding filter-cmd.tcl for shell scripts for all type of programming
languages and tools</li>
<li>filter-mtex.tcl with more examples for different LaTeX packages like
tikz, pgfplot, skak, sudoku, etc.</li>
<li>adding filter-tdot.tcl for tdot Tcl package</li>
<li>adding filter-tcrd.tcl for writing music chords above song
lyrics</li>
</ul></li>
<li>2022-02-05 - version 0.7.0
<ul>
<li>graphical user interface to the graphical filters (abc, dot, eqn,
mmd, mtex, pic, pikchr, puml, rplot, tdot, tsvg) using the command line
option <em>–gui</em></li>
<li>can now as well work without pandoc standalone for conversion of
Markdown with code chunks into Markdown with evaluated code chunks and
HTML code using the Markdown library of tcllib</li>
<li>that way it deprecates the use of tmdoc::tmdoc and mkdoc::mkdoc as
it contains now the same functionality</li>
<li>support for inline code evaluations for Tcl, Python (pipe filter)
and R (pipe filter) statements as well in nested paragraphs, lists and
headers</li>
<li>support for indented code blocks with evaluation</li>
<li>new - filter-pipe:
<ul>
<li>initial support for R code block features and inline evaluation and
error catching</li>
<li>initial support for Python with code block features and inline
evaluation and error catching</li>
<li>initial support for Octave with code block features and error
checking</li>
</ul></li>
<li>more examples filter-mtex, filter-puml, filter-pikchr</li>
<li>fix for filter-tcl making variables chunk and res namespace
variables, avoiding variable collisions</li>
</ul></li>
<li>2023-01-10 - version 0.9.0
<ul>
<li>renamed to pantcl.tcl and creating it’s own repository</li>
</ul></li>
<li>2023-03-05 - fixing a problem with the <span class="citation" data-cites="symbol">@symbol</span> in text</li>
<li>2023-03-11 - version 0.9.11
<ul>
<li>eval is now per default <code>false</code> for all filters</li>
<li>support for Rst and LaTeX as input if pantcl is used as a
filter</li>
</ul></li>
<li>2023-04-06 - version 0.9.12
<ul>
<li>adding filter-emf.tcl for MicroEmacs macro language</li>
<li>adding external Tcl filter support via YAML declaration</li>
<li>adding example user/filter-geasy.tcl as example for the latter</li>
<li>standalone mode now with Unicode support</li>
<li>fix for standalone mode</li>
<li>standalone check and working now as well for pipes and inline single
backticks, tested with R</li>
<li>filter for Julia code, however Julia is slow at startup and even
slower at plotting</li>
<li>support for pandoc single percent title, author, date at the
beginning of documents</li>
<li>extending support for tangle for non Tcl code chunks</li>
</ul></li>
<li>2023-09-07 - version 0.9.13
<ul>
<li>support for –inline option to allow inlining of images and css
files</li>
<li>bug fix for image/img-tag</li>
</ul></li>
<li>2024-11-27 - version 0.9.14
<ul>
<li>updating to newer mkdoc with support for mathjax equations and
highlightjs library</li>
<li>support for refresh option</li>
<li>bugfix for working as filter pandoc version 3</li>
<li>support for single backticks for line-filter for R and Python</li>
<li>documentation updates and fixes</li>
</ul></li>
</ul>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="Readme.html">Readme.html</a> - more information and small
tutorial</li>
<li><a href="examples/example-eqn.html">Examples</a> - more examples for
the filters</li>
<li><a href="https://wiki.tcl-lang.org/page/pandoc%2Dtcl%2Dfilter">Tclers Wiki
page</a> - place for discussion</li>
<li><a href="https://pandoc.org/filters.html">Pandoc filter
documentation</a> - more background and information on how to implement
filters in Haskell and Lua</li>
<li><a href="https://github.com/pandoc/lua-filters">Lua filters on
GitHub</a></li>
<li><a href="https://github.com/LaurentRDC/pandoc-plot">Plotting filters
on Github</a></li>
<li><a href="https://github.com/topics/pandoc-filter">Github Pandoc
filter list</a></li>
</ul>
<h2 id="author">AUTHOR</h2>
<p>Detlef Groth, Caputh-Schwielowsee, Germany,
detlef(<em>at</em>)dgroth(<em>dot</em>).de</p>
<h2 id="license">LICENSE</h2>
<p>Copyright (c) 2021-2023 Detlef Groth, Caputh-Schwielowsee,
Germany</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
</body>
</html><!--Generated by HTMLArk 2024-11-26 19:27:58.293429. Original URL pantcl.html-->