We wouldn't embed this directly in pandoc (trying to avoid
C dependencies), but it would be easy to create a filter
to intercept specially marked code blocks and convert them
to pictures. (There are examples of this kind of thing in the
pandoc/lua-filters repository.)
John, what is needed to help make a Pikchr filter happen?
The obvious place at least initially for such code blocks to appear is in Markdown. Pikchr is intended (just like PIC was) to be used as a plugin/filter in any context, but it's main development environment to date has been in the Fossil variant of Markdown, see https://www.fossil-scm.org/xfer/md_rules. Pandoc doesn't support Fossil Markdown, but it seems like it would not be hard to do so.