Crates.io | pikchr-cli |
lib.rs | pikchr-cli |
version | 0.1.2 |
source | src |
created_at | 2023-08-08 19:36:33.871574 |
updated_at | 2023-08-08 19:36:33.871574 |
description | PIC-like diagramming language to SVG converter |
homepage | |
repository | https://github.com/kinnison/pikchr |
max_upload_size | |
id | 939458 |
size | 11,871 |
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 8th May 2021.
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).