Pikchr (pronounced "picture") is a PIC-like markup language for diagrams in technical documentation. Pikchr is designed to be embedded in fenced code blocks of Markdown or similar mechanisms of other documentation markup languages.
For example, the diagram:
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
Is generated by 7 lines of Markdown:
``` pikchr
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
```
Pikchr diagrams can appear in:
- Documentation
- Wiki pages
- Tickets and bug reports
- Forum posts
- Check-in comments
- Anywhere else that Markdown or similar markup languages are used
Pikchr diagrams are easy to generate. The language is simple. There is lots of documentation and examples on-line (links below). Anyone who is comfortable using Markdown should be able to pick up Pikchr with minimal extra effort.
Pikchr is safe for use in internet-facing applications. Hostile Pikchr scripts cause no harm (apart from generating ugly diagrams).
Demos
- Example Pikchr Scripts (light-mode or dark-mode)
- /pikchrshow ← Enter Pikchr text and see the result on-line
- Source text for this page
Pikchr Documentation
- Purpose And Scope Of Pikchr
- Pikchr User Manual
- An Example Of How A Pikchr Script Is Written
- Pikchr Language Spec
- Differences From PIC
- Invoking Pikchr From Markdown
- How To Build Pikchr From Source
- Use Case: SQLite Syntax Diagrams
Copies Of Historical PIC Documentation
Source Code
External Links
- Go port of pikchr and a blog post about how that port came to be, both by Zellyn Hunter.
- mdbook-pikchr, by Konstantin Podsvirov, is a pikchr-aware preprocessor for mdBook.
- Support for pikchr in IntelliJ-based IDEs by Yann Cébron.
- pikchr has been integrated into the kroki.io diagram-rendering service.
- The 8th programming language added pikchr support in version 22.04.
- Node.js pikchr module by David Weil.
- A pikchr filter for pandoc implemented in Lua.
- Adamantine Pick adds pikchr support to the Obsidian knowledge-base app.
- pikchr-cmd, by Michael Thornburgh, is a command-line Pikchr preprocessor tool for use with any Markdown formatter.
Source-Code License: 0-clause BSD
The Pikchr source code is a self-contained original work. It has no
external dependencies apart from the standard C library and does not
use code taken from the internet or other external sources. All of the Pikchr
source code is released under a zero-clause BSD license. After being
processed using Lemon, the Pikchr source code is a single
file of C89 named "pikchr.c
". These features
are designed to make Pikchr easy to integrate into other systems.