Skip to main content

svg++ reference renderer

Project description

diagramagic

svg++ reference renderer for humans and LLMs. Feed it svg++ input and it emits plain SVG—no runtime, no exotic format. What is "svg++"? Just something we made up here: it's simply svg plus a few additions to support text layout and templates.

Quick Start

  • Spec + motivation: PROJECTSPEC.md
  • Agent cheat sheet: AGENTS.md (diagramagic --cheatsheet prints it after install)
  • CLI: diagramagic input.svg++ > output.svg
  • Tests/fixtures: python tests/run_tests.py
  • Library use: from diagramagic import diagramagic (module lives in src/).

svg++ basics: wrap your document in <diag:diagram> with the diag: namespace, use <diag:flex> for layout, and diag:wrap="true" on <text> to wrap. Everything compiles to pure SVG 1.1.

Need reusable pieces? Define <diag:template name="card">…</diag:template> once, then drop <diag:instance template="card"> wherever you need consistent cards or packets.

Example:

<diag:diagram xmlns="http://www.w3.org/2000/svg"
              xmlns:diag="https://example.com/diag"
              width="300" height="160">
  <style>
    .card { fill:#fff; stroke:#999; rx:10; ry:10; }
    .title { font-size:16; font-weight:600; }
    .body { font-size:12; }
  </style>

  <diag:flex x="20" y="20" width="260" padding="14" gap="8" background-class="card">
    <text class="title" diag:wrap="false">Hello svg++</text>
    <text class="body" diag:wrap="true">
      This paragraph wraps to the flex width automatically.
    </text>
  </diag:flex>
</diag:diagram>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diagramagic-0.1.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diagramagic-0.1.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file diagramagic-0.1.1.tar.gz.

File metadata

  • Download URL: diagramagic-0.1.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for diagramagic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f0a4e14df777e80dba0b2804e9ea54a5b3dbf97250e355e8cb959b1aa396bd92
MD5 48ba8701588b3ff662f3e52af4c7dda7
BLAKE2b-256 90c81078b2e3024fc2ee237fd612db02fa7ad4334e69cabd71d540db30b09b58

See more details on using hashes here.

File details

Details for the file diagramagic-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: diagramagic-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for diagramagic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0748c48ae839ce2e38b290bda89bddbe711c3f9cea2b4a1c40dd615ac7f37be9
MD5 c70314a933acdcd96c0176026b73b1ae
BLAKE2b-256 ab385515ee647c5f3c94a9660911688c95c834798e8e02aa7d02c3e351925b6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page