Drawlib

Illustration & Documentation as Code

Pure-Python declarative visuals and multi-target documentation compiler built for software engineers and AI coding agents.


Official Showcase Deck · v0.3.5 Ready

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Unified Illustration & Documentation Pipeline Git -> Multi-Target Git Source of Truth Python + Markdown Drawlib Compiler Docs Site & API Catalog 16:9 Slide & PPTX Vector PDF & DOCX SVG / PNG / APNG
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 2 / 39

Drawlib — Illustration & Documentation as Code

Drawlib at a Glance

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 4,500+ Vector Icons Across 34 official & neutral suites 38+ High-Level Visuals 18 SmartArts, 9 Charts, 6 Diagrams, 5 Graphs 5 Project Archetypes site, catalog, doc, slide, images 100% Pure Python & Git Zero GUI lock-in, AI self-verifiable
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Four-Layer Architecture Stack From AI CLI & Primitives to Multi-Target Publishing L4 Layer 4 · Multi-Target Compiler HTML · Catalog · Slide · PDF · DOCX · PPTX L3 Layer 3 · Declarative Visual Engines SmartArts · Charts · Diagrams · Graphs · Anim L2 Layer 2 · Primitives, 34 Icon Suites & Semantic Styles 43 Shapes · 4,500+ Vector Icons · Theme Presets L1 Layer 1 · AI Agent CLI rules · show -g Grid Inspection · SQLite Cache
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 3 / 39

Drawlib — Illustration & Documentation as Code

Presentation Roadmap

Six Core Chapters

  • Motivation (Ch. 1): Solving visual documentation drift with Python and Git

  • Visual Engines (Ch. 2–4): Primitives, 34 icon suites, SmartArts, charts, and diagrams

  • Publishing & AI (Ch. 5–6): Five project archetypes, Office export, and AI grid review

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 1 1. Why Drawlib? Solving visual documentation drift 2 2. Primitives & 34 Icon Suites Canvas, 43 shapes, styles & 4,500+ icons 3 3. 18 SmartArts & 9 Charts Infographics, GeoMap & pure-Python plots 4 4. Diagrams, Graphs & Animation Cloud, UML, auto-layout & APNG 5 5. 5 Archetypes & Publishing site, catalog, doc, slide, PDF/DOCX/PPTX 6 6. AI-Native Agent Workflow Rules CLI, -g grid loop & SQLite cache
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ CHAPTER 01 Chapter 1 of 6 Why Drawlib? Solving Visual Documentation Drift in the AI Era 1.1 Why GUI Whiteboards & Text DSLs Break Down 1.2 Illustration & Documentation as Code 1.3 Landscape Comparison Matrix 1.4 Single Source of Truth Across Formats 4 / 39
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 5 / 39

Drawlib — Illustration & Documentation as Code

Why Visual Documentation Breaks Down

Engineering teams are forced to choose between untrackable GUI binaries, rigid text DSLs, and isolated plotting libraries—causing visual architecture docs to drift behind code on every release.

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ GUI Tools (Figma / Draw.io) Opaque Binary Files No Git PR diff review Manual PNG Exports Screenshots rot on release GUI Lock-In Uneditable by AI agents Text DSLs (Mermaid / UML) Rigid Auto-Layout Zero exact (x, y) control Narrow Vocabulary Weak KPIs, tables & maps Snippet-Only Scope No PDF or PPTX compiler Plotting Libs (Matplotlib) Data Plots Only No cloud or UML engines Verbose Boilerplate Ad-hoc fonts and colors Detached Scripts Manual copy into slides The Unmet Gap: Spatial Coordinates + Git PR Review + Unified Docs & Charts + AI Grid Verification
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 6 / 39

Drawlib — Illustration & Documentation as Code

Illustration & Documentation as Code

Pure Python + Markdown

  • Turing-Complete Layout: Loops, variables, and shared utils.py helpers

  • Inline Code Blocks: Embed drawlib visuals directly inside Markdown

  • Deterministic PR Diffs: Review prose and diagram updates together

setup(width=120, height=32)
p = ChevronProcess(style=Styles.Neutral)
for s in ("Code", "Build", "Ship"): p.add(s)
p.draw((6, 8), width=108, height=16)
save()
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Unified Code-to-Artifact Pipeline Code -> Visuals & Docs Single Git Pull Request Markdown (.md) Narrative & Stage Python (drawlib) Visual Logic & Styles Drawlib Compiler (Headless Render + Cache) Vector Visuals SVG · PNG · APNG Published Docs HTML · Slide · PDF · Office
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 7 / 39

Drawlib — Illustration & Documentation as Code

Tooling Landscape Comparison

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Capability GUI Whiteboards Text DSLs Plotting Libs Drawlib Git Diff & PR Review × Binary Blob ✓ Text Syntax ✓ Python Code ✓ Clean Python Spatial Coordinate Control ✓ Manual Drag × Rigid Auto △ Axes Only ✓ Exact + Auto Cloud & UML Diagrams ✓ Manual Icons △ Basic Boxes × Unsupported ✓ 6 Engines + Icons Charts & Infographics △ Manual Shapes × Very Limited ✓ Plots Only ✓ Charts & SmartArts Site / Catalog / Slide / Office × Image Export × Snippet Only × Image Only ✓ 5 Archetypes AI Visual Self-Healing (-g) × GUI Locked × Blind Text △ Ad-Hoc Scripts ✓ Built-In -g CLI
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 8 / 39

Drawlib — Illustration & Documentation as Code

One Git Repository, Every Output Format

A single drawlib.toml manifest with [i18n] structural parity compiles synchronized English and Japanese deliverables across Web, Print, and Office from one Git commit.

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Git Repo: en/ + ja/ + styles.py en/ + ja/ Markdown drawlib.toml + styles.py drawlib build · SQLite SHA-256 Cache HTML Docs & API Catalog A4 Vector PDF (Print-Ready) Editable Word (.docx) 16:9 Web Slide Deck Editable PPTX (PowerPoint)
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ CHAPTER 02 Chapter 2 of 6 Primitives, Styles & Icons 43 Shapes, Semantic Themes & 4,500+ Vector Icons 2.1 Cartesian Canvas & -g Visual Grid 2.2 43 Shapes & Smart Connectors 2.3 Multilingual Typography & Fonts 2.4 34 Icon Suites & 8-Color Themes 9 / 39
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 10 / 39

Drawlib — Illustration & Documentation as Code

Cartesian Canvas & Visual Grid (-g)

Predictable Math Geometry

  • Bottom-Left Origin: (0, 0) starts bottom-left (+X right, +Y up).
  • Center Anchor: (x, y) centers every shape, text, and icon.
  • Visual Grid (-g): Overlay coordinate ticks for exact verification.
setup(width=100, height=60)
st = Styles.PrimaryFlat
rectangle((50, 30), 36, 22, style=st)
save()
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Cartesian Stage: setup(width=100, height=60) + Grid (-g) 20 40 60 80 100 20 40 60 +X +Y Origin (0, 0) (x, y) = (38, 30) Center Anchor width = 36 height = 24 r = 13 (79, 34)
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 11 / 39

Drawlib — Illustration & Documentation as Code

43 Geometric Shapes & Smart Connectors

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 1. Basic & Polygons 2. Block Arrows & Flow 3. 3D & Containers 4. Badges & Callouts 5. Domain Symbols 6. Lines & Curves rectangle circle rhombus regularpolygon star chevron arrow arrow_arc parallelogram cylinder cube document cloud funnel shield bubblespeech tag ribbon pin gear lightning checkmark clock forbidden line (->) lines (ortho) lines_curved (r=2) lines_bezier (->)
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 12 / 39

Drawlib — Illustration & Documentation as Code

Multilingual Typography & Raster Assets

Universal Scripts & Dimage

  • CJK + Latin Default: Font renders English and Japanese together.
  • Regional Packs: FontJapanese, FontArabic, and FontSourceCode.
  • Exact Text Anchors: Control alignment via halign and valign.
  • Raster Dimage: Crop, resize, sepia, mosaic, plus font caching.
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Multilingual Font Families & On-Demand Cache Font.SANSSERIF_BOLD English & 日本語 Default Latin + CJK FontJapanese.SERIF 美しい明朝体表現 Regional CJK & RTL FontSourceCode setup(104, 80) Monospace Code Anchor Alignment (halign) & Raster Assets (Dimage) halign='left' halign='center' halign='right' _assets/linux.png image() .sepia()
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 13 / 39

Drawlib — Illustration & Documentation as Code

34 Icon Suites & 4,500+ Vector Icons

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 1. Phosphor Vector Font Icons (5 Weights) 2. Official Cloud Suites (gcp · aws · azure) 3. 15 Official Domain Brand Suites 4. 15 Original 2D Suites (original_*) thin rocket_launch light cpu regular globe bold sparkle fill shield_check gcp Cloud Run gcp BigQuery aws Lambda aws Amazon S3 azure Cosmos DB ai Gemini cnative Kubernetes devops GitHub data PostgreSQL security Cloudflare cloud multi_cloud ai ai_agent server gpu_server network firewall security zero_trust
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 14 / 39

Drawlib — Illustration & Documentation as Code

8-Color Semantic Styles & Preset Themes

  • Semantic Matrix: Styles.<Color><Variant> combines 8 roles (Primary..Dark) with Flat, Bold, Dashed, and Neutral.
  • Immutable .patch() & Themes: Customize safely via style.patch(...) or switch global themes in drawlib.toml.
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 8 Semantic Roles × Variants (Styles.<Color><Variant>) Role Default Flat Neutral / Dashed Primary .Primary .PrimaryFlat .PrimaryNeutral Secondary .Secondary .SecondaryFlat .SecondaryNeutral Accent .Accent .AccentFlat .AccentNeutral Success .Success .SuccessFlat .SuccessNeutral Warning .Warning .WarningFlat .WarningNeutral Danger .Danger .DangerFlat .DangerNeutral Neutral .Neutral .NeutralFlat .NeutralDashed Dark .Dark .DarkFlat .DarkDashed Preset Themes (drawlib.toml) style = "default" Indigo Editorial Palette style = "google" Google Workspace Blue style = "monochrome" Print & Paper Grayscale
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ CHAPTER 03 Chapter 3 of 6 SmartArts & Pure-Python Charts 18 Structured Infographics & 9 Zero-Dependency Plots 3.1 Process Flows, Cycles & Roadmaps 3.2 KPIs, CardLists, Pyramids & MindMaps 3.3 Tables, SourceCode, Calendars & GeoMap 3.4 9 Declarative Chart Types & Gantt 15 / 39
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 16 / 39

Drawlib — Illustration & Documentation as Code

Process Pipelines, Lifecycles & Roadmaps

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ ChevronProcess — Sequential Delivery Pipeline 4 Stages 1. Author Markdown + Python 2. Render -g Visual Grid Check 3. Cache SQLite Incremental 4. Publish HTML, PDF & PPTX Cycle — Feedback Loop 4-Node Orbit AI Loop Self-Heal 1. Draft Write API 2. Inspect Show -g 3. Refine Tune XY 4. Verify Clean Diff Roadmap — Milestone Timeline Bezier Spine P1 Core Vector Canvas Primitives, icons & theme tokens P2 SmartArts & Charts 18 infographics & 9 declarative plots P3 Diagrams & Graphs 6 diagram engines & layout solvers P4 Multi-Format Export HTML, PDF, PPTX & AI rules CLI
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 17 / 39

Drawlib — Illustration & Documentation as Code

KPIs, Feature Cards, Pyramids & MindMaps

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ KpiCards — Metric Grid 2x2 Layout 18 SmartArt Types Tables to GeoMaps 34 Icon Suites Cloud & Phosphor 0 GUI Lock-In 100% Git Python 4 Theme Palettes Instant re-skin CardList — Feature Stack Icon + Badge L1 Declarative Item Lifecycle Register via .add() and chain .draw() L2 Semantic Design Tokens 50%+ neutral base with focal highlights L3 Animation-Ready Visibility Toggle item.show without shifting layout Pyramid — Layered Hierarchy 3 Tiers Vector Canvas SmartArts Deck MindMapNode — Radial Tree 2-Pass Layout Drawlib SmartArts 9 Charts Diagrams Slide & Doc
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 18 / 39

Drawlib — Illustration & Documentation as Code

Tables, SourceCode, Calendars & GeoMap

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Table — Benchmark Matrix Zebra Rows Output Target Format Cold Build 16:9 Slide Deck HTML / PDF 0.42 s Documentation Site Multi-Page 0.65 s Standalone Diagram SVG / PNG 0.18 s SourceCode — Syntax Box card_demo.py 1 2 3 4 5 6 from drawlib . canvas import save , setup from drawlib . shapes import rectangle from drawlib . styles import Styles setup ( width = 120 , height = 60 ) rectangle ( ( 60 , 30 ) , 80 , 36 , Styles . Primary ) save ( " card.svg " ) WeekCalendar — Sprint Plan ISO 8601 Mon 11/2 Tue 11/3 Wed 11/4 Thu 11/5 Fri 11/6 09:00 12:00 15:00 RC Freeze & Spec QA & Grid Audit v1.0 Launch GeoMap — Global Regions US, EU & JP US-West EU-West Tokyo
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 19 / 39

Drawlib — Illustration & Documentation as Code

Declarative Bar, Line & Area Charts

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 9 Built-In Chart Types Bar, Line, Area, Pie, Radar, Scatter, Gantt, Heatmap 100% Theme-Synchronized Matches Default, Google & Monochrome palettes Auto Nice-Number Axes Clean ticks, legends & progressive draw_ratio
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ BarChart — Quarterly Render Throughput (k/hr) Grouped Mode 0 k 25 k 50 k 75 k 100 k Q1 Q2 Q3 Q4 18 k 34 k 21 k 46 k 24 k 61 k 27 k 76 k v1 Single-Thread v2 Cached Worker AreaChart — Build Pipeline Latency (p50 vs p99) Smooth Spline 0 ms 20 ms 40 ms 60 ms v1.0 v1.2 v1.4 v1.6 v2.0 50 ms 42 ms 34 ms 28 ms 23 ms 19 ms 15 ms 12 ms 9 ms 6 ms p99 Tail Latency p50 Median
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 20 / 39

Drawlib — Illustration & Documentation as Code

Pie, Radar, Scatter & Heatmap Charts

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ PieChart — Donut Share hole_ratio=0.55 100% Vector Slide Decks (42%) Tech Sites (28%) Whitepapers (18%) CLI Previews (12%) RadarChart — 5-Axis Profile Polygon Web Speed Themes Git Diff Vector AI CLI Drawlib Manual GUI ScatterChart — Build Scaling Bubble Series 0 s 1 s 2 s 3 s 4 s 0 figs 25 figs 50 figs 75 figs 100 figs Incremental Cache Cold Full Build HeatmapChart — Latency Auto-Contrast 14ms 18ms 42ms 35ms 19ms 16ms 29ms 54ms 38ms 21ms 22ms 46ms 68ms 49ms 25ms 18ms 34ms 51ms 41ms 22ms US-West EU-West Tokyo Singapore 00:00 06:00 12:00 18:00 22:00
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 21 / 39

Drawlib — Illustration & Documentation as Code

Engineering Roadmaps with GanttChart

  • Declarative Schedule Modeling: Group workstreams with Section, track completion via Task(progress=...), and pin Milestone diamonds.
  • Dependencies & Live Status Markers: Route orthogonal Dependency arrows and overlay vertical Marker lines (Today, Release) in code.
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Task / Phase Jan (M1) Feb (M2) Mar (M3) Apr (M4) May (M5) Jun (M6) 1. Architecture Canvas & Theme Spec 100% SmartArts & Charts API 100% Architecture Freeze 2. Implementation Diagram & Graph Solvers 80% HTML, PDF & PPTX Builders 55% 3. Verification & Launch AI Agent Rules & Grid CLI 35% Bilingual Docs & Showcase v1.0 GA Release Today
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ CHAPTER 04 Chapter 4 of 6 Diagrams, Graphs & Animations 6 Engineering Diagram Engines, 5 Solvers & APNG 4.1 Cloud Topology (ArchitectureDiagram) 4.2 Flowcharts & API Sequence Diagrams 4.3 UML Class, ER & State Machines 4.4 Auto-Layout Graphs & Animations 22 / 39
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 23 / 39

Drawlib — Illustration & Documentation as Code

Cloud Topology with ArchitectureDiagram

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Multi-Tier Cloud Platform Topology GcpIcon + PhosphorIcon + Nested NodeGroup + Orthogonal Bus Routing Production VPC (10.0.0.0/16) HTTPS gRPC SQL Events Stream Global Users & Devices Cloud CDN & Armor WAF GKE API Microservices Cloud Run Async Workers Cloud SQL (PostgreSQL) Pub/Sub Event Bus BigQuery Data Warehouse
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 24 / 39

Drawlib — Illustration & Documentation as Code

Workflows & Protocols: Flow and Sequence

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ FlowDiagram — CI/CD Validation Yes No Retry Start Build & Lint Grid Check OK? Deploy Auto-Fix Loop SequenceDiagram — API Protocol [ALT] JWT OK POST /orders Verify JWT 200 OK INSERT order 201 Created Client API Gateway Auth Order DB
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 25 / 39

Drawlib — Illustration & Documentation as Code

Domain Modeling: Class, ER & State Diagrams

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ ClassDiagram (UML 2.0) «abstract» Exporter + dpi: int + render(): bytes SvgExporter + xml: bool + render(): bytes PdfExporter + cmyk: bool + render(): bytes ERDiagram (Schema) places contains USERS PK id UUID email TEXT ORDERS PK id UUID FK user_id UUID ORDER_ITEMS PK id INT FK order_id UUID StateDiagram (FSM) start ok err Queued Rendering Cached Failed
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 26 / 39

Drawlib — Illustration & Documentation as Code

Declarative Graph Layout (drawlib.graph)

Hybrid Algorithmic + Manual Control

  • Auto-Solve Topology: Crossing-free (x, y) via get_layout()
  • Manual Fine-Tuning: Nudge nodes with offset(dx, dy) anytime
  • No Black-Box Lock-In: Inspect & freeze code via print(layout)
g = LayerGraph(direction="LR")
g.edge("ingest", "validate")
g.edge("validate", "serve")
layout = g.get_layout(margin=8.0)
layout.offset("serve", dy=-4.0)
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ LayerGraph.get_layout() + offset() ETL Stage Ingest Validate Enrich Serve API offset(dy=-4)
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 27 / 39

Drawlib — Illustration & Documentation as Code

Five Specialized Auto-Layout Graph Solvers

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 1. ArchitectureGraph Edge VPC CDN API SQL 2. LayerGraph (DAG Tiers) Src Map A Map B Sink 3. TreeGraph (Tidy Tree) Root Web API Data 4. RadialGraph (Hub & Concentric Spokes) Hub Auth Orders Billing Search 5. GridGraph (2D Matrix & Snake Flow) 1. Plan 2. Code 3. Build 4. Test 5. Stage 6. Prod
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 28 / 39

Drawlib — Illustration & Documentation as Code

Interactive Frame Animations (APNG & WebP)

Motion as Code Across All Modules

  • Multi-Frame Engine: Declarative Animation(fps, loop) API
  • Progressive Reveal: draw_ratio on Lines, Charts & Diagrams
  • Interactive Stage: Live <canvas> (anim_trigger, anim_pause, A)
  • Static Export Ready: Auto-extracts clean frames for PDF & PPTX
anim = Animation(fps=2.0, loop=0)
for r in [0.4, 0.7, 1.0]:
    series.draw_ratio = r
    with anim.frame():
        chart.draw(xy=(10, 6))
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ CHAPTER 05 Chapter 5 of 6 5 Archetypes & Publishing Site, Catalog, Doc, Slide & Images from One Compiler 5.1 Five Project Archetypes Overview 5.2 Web Docs (site) & API Reference (catalog) 5.3 Whitepapers: HTML, Vector PDF & DOCX 5.4 16:9 Slide Stage, Presenter View & PPTX 29 / 39
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 30 / 39

Drawlib — Illustration & Documentation as Code

Five Built-In Project Archetypes

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ uv run drawlib init project <type> <dir> One Compiler • 5 Purpose-Built Scaffolds • Web, PDF & Office site docs_src/<lang>/ Guided narrative docs navbar.md + search Dark mode & i18n e.g. www.drawlib.com HTML Search SVG catalog NEW in v0.3.5 catalog_src/<lang>/ Two-column API ref Auto # H1 / ## H2 Instant / filter e.g. drawlib.com/api HTML / Filter SVG doc doc_src/<lang>/ Linear whitepapers --generate-index Auto Cover & ToC RFCs & Design Specs HTML PDF DOCX slide slide_src/<lang>/ 16:9 visual stage ?presenter=1 sync ::: note scripts Keynotes & Tech Talks HTML PDF PPTX images images_src/*.py Standalone Python Batch illustration CI asset generation README & Paper Art SVG PNG WebP
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 31 / 39

Drawlib — Illustration & Documentation as Code

Web Publishing: Docs Site & API Catalog

  • type = "site" (Narrative Docs): Guided chapter navigation via navbar.md, full-text search, dark mode & i18n (www.drawlib.com).
  • type = "catalog" (API Reference): Zero-navbar.md 1 MD = 1 HTML dictionary extracting # H1 / badged ## H2 items with / instant filter (www.drawlib.com/api).
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ www.drawlib.com — type = "site" Docs Guide SmartArts CLI Search EN/JA navbar.md 01 Overview 02 Primitives 03 SmartArts 04 Diagrams 05 Publishing Chapter 3 • SmartArt Guide Architecture & Panel Layouts MD Src Build Web SVG Guided narrative prose, dark mode, and Prev / Next chapter navigation. ← Primitives Diagrams → www.drawlib.com/api — type = "catalog" panel / # SmartArts (H1) CLASS CardList CLASS Panel FUNC sourcecode # HTTP API (H1) GET /v1/rules POST /v1/build CLASS Panel (## H2) 1 MD = 1 HTML • Zero navbar.md Caller Panel draw() / content_box() variant: 'filled' | 'window' get_content_box() -> Inner Box
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 32 / 39

Drawlib — Illustration & Documentation as Code

Whitepapers: HTML, Vector PDF & MS Word

Linear Specs (type = "doc")

  • Numbered Chapters: Merge 00_cover.md, 01_intro.md into one spec
  • Auto Cover & ToC: --generate-index builds cover & clickable index
  • Triple Export: Compile HTML, A4 Vector PDF, and editable .docx
# Build all 3 deliverables from doc_src/
uv run drawlib build html
uv run drawlib build pdf --generate-index
uv run drawlib build docx --generate-index
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ doc_src/{en,ja}/ 00_cover.md Title & metadata 01_intro.md Context & goals 02_arch.md ```drawlib diagrams 03_security.md Threat tables --generate-index Single-Page HTML WEB Sticky ToC sidebar, dark mode & responsive inline SVG zoom A4 Vector PDF PRINT Auto Cover & clickable ToC Infinite-zoom vector diagrams Editable Word (.docx) OFFICE Native Word headings, tables & crisp 300 DPI illustrations
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 33 / 39

Drawlib — Illustration & Documentation as Code

16:9 Slide Stage, Presenter View & PPTX

  • Dual-Layer Slide Markdown: ::: block places crisp visuals on a 1920×1080 stage while ::: note stores speaker scripts in Git.
  • Live Sync & Office Export: Sync Audience Stage with ?presenter=1 Presenter View via BroadcastChannel, plus Vector PDF & .pptx.
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ slide_src/ ::: block (Stage) 1920x1080 xy=(x, y) Inline Python SVG art ::: note (Script) Speaker script in Git Hidden from audience 1:1 EN / JA Parity Audience Stage Crisp Inline Vector SVG 1920x1080 zero-blur scaling L Key: EN ⇄ JA P Key: Console Broadcast Channel Presenter (?presenter=1) Current Slide Slide 18 / 26 Next Preview Timer 08:42 ::: note Live Speaker Script Scrollable script & Q&A notes 1920x1080 Vector PDF drawlib build pdf • Vector deck Editable 960x540pt .pptx drawlib build pptx • Native slides
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ CHAPTER 06 Chapter 6 of 6 AI-Native Agent Workflow Rules CLI, Visual Self-Correction & SQLite Caching 6.1 On-Demand Context via drawlib rules 6.2 Autonomous -g Grid Verification Loop 6.3 Two-Tier Asset & SQLite Build Cache 34 / 39
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 35 / 39

Drawlib — Illustration & Documentation as Code

Autonomous Multimodal Verification Loop

  • On-Demand Context: AI agents (Gemini, Claude Code, Cursor) query exact API specs via uv run drawlib rules show <topic>.
  • Visual Self-Correction: Agents inspect -g coordinate grid previews multimodally and fix overlaps before publishing.
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 1. Query Rules drawlib rules show Fetch exact API & slide layout specs with zero bloat 2. Author Code Write Python / MD Compose SmartArts, Diagrams & typed ::: block layouts 3. Grid Preview drawlib show -g Render headless PNG with (X, Y) rulers in < 1 second 4. Vision Check Multimodal Inspect Verify margins, text_size balance & zero overlaps Pass Verified Output ✓ Ready to Publish Compile crisp HTML, Vector PDF, DOCX & 16:9 PPTX Overlap / Clipping Found 5. Self-Correct Coordinates Refine (x, y) & text_size via -g rulers Iterate
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 36 / 39

Drawlib — Illustration & Documentation as Code

Two-Tier Caching & Unified CLI

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ < 1s Incremental Builds SQLite SHA-256 .drawlib/cache.db 50+ Agent Rule Topics On-demand via drawlib rules show Zero Broken Links Built-in drawlib serve --check
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ Two-Tier Cache Architecture Tier 1: Asset Cache drawlib cache list / download On-demand fonts, 34 icon packs & headless Chromium binary Tier 2: Build Cache .drawlib/cache.db (SQLite) SHA-256 content + style hash Shared by HTML/PDF/Office Unified CLI — uv run drawlib <command> init 5 Types rules list / show show -g Grid QA build Web/Office serve --check
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ CLOSING 06 • Wrap-Up Summary & Next Steps Start Building Illustrated Documentation as Code 37 / 39
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 38 / 39

Drawlib — Illustration & Documentation as Code

Key Takeaways & Quickstart

image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ 01 1. Pure Python & Git Native Typed Python API, styles.py tokens & clean Git PR diffs — zero GUI lock-in. 03 3. 5 Project Archetypes & Office Export Compile Site, Catalog, Doc, Slide & Images to HTML, Vector PDF, DOCX & PPTX. 02 2. Rich High-Level Components 18 SmartArts, 9 Charts, 6 Diagrams, 5 Graph solvers & 34 Icon Packs built in. 04 4. Built for Autonomous AI Agents 50+ drawlib rules topics, show -g grid QA & < 1s SQLite .drawlib/cache.db builds. QUICKSTART IN 30 SECONDS Requires Python 3.12+ & uv uv add drawlib uv run drawlib init project slide my-deck uv run drawlib serve

Thank You

Start Authoring Visuals & Docs as Code


  • Docs: https://www.drawlib.com/
  • API Catalog: https://www.drawlib.com/api/
  • Examples & GitHub: https://examples.drawlib.com/ · github.com/yuichi110/drawlib
image/svg+xml Matplotlib v3.11.2, https://matplotlib.org/ ILLUSTRATION & DOCS AS CODE Python AI-Native Publish Drawlib — Apache 2.0 Open Source pip / uv install drawlib
English
Slide 1
1 / 39
Slide 2
2 / 39
Slide 3
3 / 39
Slide 4
4 / 39
Slide 5
5 / 39
Slide 6
6 / 39
Slide 7
7 / 39
Slide 8
8 / 39
Slide 9
9 / 39
Slide 10
10 / 39
Slide 11
11 / 39
Slide 12
12 / 39
Slide 13
13 / 39
Slide 14
14 / 39
Slide 15
15 / 39
Slide 16
16 / 39
Slide 17
17 / 39
Slide 18
18 / 39
Slide 19
19 / 39
Slide 20
20 / 39
Slide 21
21 / 39
Slide 22
22 / 39
Slide 23
23 / 39
Slide 24
24 / 39
Slide 25
25 / 39
Slide 26
26 / 39
Slide 27
27 / 39
Slide 28
28 / 39
Slide 29
29 / 39
Slide 30
30 / 39
Slide 31
31 / 39
Slide 32
32 / 39
Slide 33
33 / 39
Slide 34
34 / 39
Slide 35
35 / 39
Slide 36
36 / 39
Slide 37
37 / 39
Slide 38
38 / 39
Slide 39
39 / 39