#svg #markdown #pic #html #md

pikchr

PIC-like diagramming language to SVG converter

5 releases

0.1.4 Mar 1, 2025
0.1.3 Sep 20, 2023
0.1.2 Aug 8, 2023
0.1.1 May 8, 2021
0.1.0 Oct 24, 2020

#329 in Visualization

Download history 68/week @ 2026-01-07 319/week @ 2026-01-14 175/week @ 2026-01-21 177/week @ 2026-01-28 165/week @ 2026-02-04 183/week @ 2026-02-11 465/week @ 2026-02-18 324/week @ 2026-02-25 379/week @ 2026-03-04 206/week @ 2026-03-11 237/week @ 2026-03-18 237/week @ 2026-03-25 168/week @ 2026-04-01 154/week @ 2026-04-08 120/week @ 2026-04-15 128/week @ 2026-04-22

634 downloads per month
Used in 17 crates (4 directly)

MIT/Apache

300KB
7K SLoC

C 7K SLoC // 0.1% comments Rust 163 SLoC // 0.0% comments

Pikchr - Diagram renderer

Taken from the pikchr homepage:

Pikchr (pronounced like "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 in similar mechanisms in other markup languages) to provide a convenient means of showing diagrams.

This crate wrappers the pikchr.c version downloaded from that website on the 28th February 2025.

You can use it as follows:

use pikchr::{Pikchr, PikchrFlags};

let piccy = Pikchr::render(
    diagram_str,
    None,
    PikchrFlags::default()).unwrap();

println!("{}", piccy);

There is a little helper program that reads a Pikchr file named on the command line and renders it as SVG to the standard output:

cargo run -p pikchr-cli -q foo.pikchr > foo.svg

You can install it with cargo install pikchr-cli (cargo install --path=pikchr-cli from the source tree).

Dependencies

~0.4–270KB