LaurentRDC / pandoc-plot

Render and include figures in Pandoc documents using your plotting toolkit of choice
https://laurentrdc.github.io/pandoc-plot/
GNU General Public License v2.0
216 stars 8 forks source link

Support pikchr diagrams #56

Open bugsbugsbux opened 1 year ago

bugsbugsbux commented 1 year ago

Please support pikchr diagrams!

You can install pikchr by downloading the .c file from https://pikchr.org/home/file/pikchr.c?ci=trunk (always gives latest version) and compiling it with gcc -DPIKCHR_SHELL -o pikchr pikchr.c -lm.

Example script:

arrow right 200% "Markdown" "Source"
box rad 10px "Markdown" "Formatter" "(markdown.c)" fit
arrow right 200% "HTML+SVG" "Output"
arrow <-> down 70% from last box.s
box same "Pikchr" "Formatter" "(pikchr.c)" fit

compile like so: ./pikchr --svg-only file.pik >file.svg or cat file.pik | ./pikchr --svg-only - > file.svg

You can find more examples at https://pikchr.org/home/doc/trunk/doc/examples.md.

kind regards

LaurentRDC commented 1 year ago

Thank you for the suggestion! I don't have much time to devote to this these days, but I'm happy to review pull requests.

mgajda commented 10 months ago

Unfortunately current framework assumes that renderer command is returned as shell text that writes output to file

That is, there is no output capture, so you would need a wrapper script that redirects it.

mgajda commented 10 months ago

See https://github.com/drhsqlite/pikchr/issues/5

mgajda commented 10 months ago

It is possible to support pikchr with a shim shell script, but I will wait for #61 to be accepted first.