monospace_core/lib.rs
1//! Core library for Monospace, a toolkit for drawing diagrams with ASCII characters.
2//!
3//! This crate is where all domain logic lives: parsing a diagram description, computing a layout on
4//! a character grid, and rendering that grid as text. The first slice of it exists — stamping cells
5//! into a [`Buffer`] and [`render`]-ing them to text — with an input format, layout and everything
6//! above the buffer still to come.
7//!
8//! The crate deliberately carries no dependency on any terminal, command-line or user-interface
9//! concern, so that the same code can later back an interactive application and a WebAssembly
10//! build. That constraint is checked on every commit by compiling this crate for
11//! `wasm32-unknown-unknown`.
12
13mod buffer;
14mod cell;
15mod footprint;
16mod geometry;
17mod glyph;
18mod identity;
19mod render;
20mod shape;
21mod stroke;
22
23pub use buffer::{Buffer, CellReader, OwnerReader, StampMode, StampSink};
24pub use cell::{Arm, Cell, StrokeCell};
25pub use footprint::FootprintSink;
26pub use geometry::{Direction, Footprint, Offset, Orientation, Pos, Size, Window};
27pub use glyph::{Glyph, GlyphCatalog, GlyphKey, Symbol, SymbolCell, SymbolStyleName};
28pub use identity::ShapeId;
29pub use render::render;
30pub use shape::{
31 BoxShape, Connector, Endpoint, FigureLayer, Line, Shape, Surface, Terminal, Text, TextShape,
32};
33pub use stroke::Stroke;