Odd choice, usually that's how you'd show the (possibly syntax-highlighted) code as-is, not execute/render it in situ.
E.g. what if I want a document that says 'this pikchr code generates this'? I'd expect to write something like:
```pikchr
arrow 200% "whatever"
```
renders:
$pikchr
arrow 200% "whatever"
$
(Or some other syntax) not the code block twice, once with some kind of escaping.If you want to see it both ways, Fossil renders the diagrams with an Alt or Ctrl-click handler attached (depending on platform) that toggles between the SVG and the fixed-width source code view.
And if you don't like the modifier key, you can tag a diagram "pikchr toggle" to make it toggle with a simple left-click.
You could reasonably put options on the fenced-code-block header line:
```pikchr --source
...
```
```pikchr --caption # caption rendered figure with source
...
```
I don't know if pikchr supports anything like this, but it seems like you could add it pretty easily if you wanted to.But at that point, you might as well just use Fossil as a CMS. :)
It's a great little diagram language that's quite capable, and I think of it like a modern web upgrade to Brian Kernighan's PIC.
Here is my earliest Pikchr effort: https://lumosql.org/src/not-forking (click to see source.)
Pikchr diagrams are crisp and precise with zero configuration. Mermaid diagrams are difficult to make render as nicely as the screenshots show (https://mermaid-js.github.io ) and easier to confuse with ambiguous syntax.
With the addition of 5 lines Lua, Pandoc now handles Pikchr in Markdown documents: https://groups.google.com/g/pandoc-discuss/c/zZSspnHHsg0/m/m...