Skip to content

Latest commit

 

History

History
41 lines (35 loc) · 2.25 KB

README.md

File metadata and controls

41 lines (35 loc) · 2.25 KB

The site

https://shergin.github.io/malevich/ — the documentation site, generated by this crate and deployed from main by .github/workflows/pages.yml.

The repository's rule holds here: no chart on the site is drawn by hand. Every figure is a plot built in figures/ — one block per file, both include!d and include_str!ed, so the code shown beside a plate is the code that ran — and rendered by the library at build time as the SVG terminal card, as the ANSI a tty would receive, or as the plain text a pipe would see. The repository's own docs (docs/*.md, the READMEs, the changelog) are the text of most pages; the site adds plates under their headings and rewrites their links. The site-authored chapters live in content/.

cargo run -p malevich-site                  # writes site/dist (pages and figures)
./site/build.sh                             # the same, plus the wasm for the live pages
python3 -m http.server 4173 --directory site/dist

A {{directive}} on a line of its own in any page becomes a figure: {{figure name}} (the card and its code), {{plain name}}, {{ansi name Ansi16}}, {{charsets name}}, {{colors name}}, {{sizes name 80x20 40x10}}, {{pair a b}}, {{html name}}, {{pixelcard name}} (to_svg above to_svg_pixels), {{json name}}, {{example gallery_name}}, and the wasm-driven {{explorer}} and {{resizer}}. A caption follows a |. SITE_CONTACT_SHEET=1 cargo run -p malevich-site also writes dist/contact/, every figure on one page, for proofing. --api-docs target/doc, after cargo doc --no-deps --all-features, fails the build on any docs.rs link into the API that names no item, as CI does.

The pages that draw in the browser — the gallery plates, the ladder explorer, the playground — use the wasm build of the JS rim (js/native) through the scripts in static/.

Gallery cards are generated with the docs. cargo run --example regen_docs writes examples/cards/<name>.svg from each example's --svg path — the dark quadrant card of the same plot values in the same frames as the pipe text, one <svg> per plot or grid pane — and checks those files the same way it checks EXAMPLES.md. The gallery shows the card. "What a pipe sees" reveals the pipe text.