Convert ADOC to SVG
Max file size 100mb.
ADOC vs SVG Format Comparison
| Aspect | ADOC (Source Format) | SVG (Target Format) |
|---|---|---|
| Format Overview |
ADOC
AsciiDoc Markup Language
AsciiDoc is a lightweight markup language for writing documentation, articles, and books. Created in 2002, it offers rich semantic markup with a focus on technical documentation. Supports complex structures like tables, admonitions, cross-references, and embedded diagrams. Documentation Format Technical Writing |
SVG
Scalable Vector Graphics
SVG is an XML-based vector image format for two-dimensional graphics. Developed by W3C in 1999, it supports interactivity and animation. SVG images scale infinitely without quality loss, making them ideal for web graphics, icons, logos, and diagrams. Vector Graphics Web Standard |
| Technical Specifications |
Structure: Plain text with semantic markup
Encoding: UTF-8 Format: Human-readable text Parser: Asciidoctor, AsciiDoc-py Extensions: .adoc, .asciidoc, .asc |
Structure: XML-based markup
Encoding: UTF-8 Format: Vector graphics (XML) Parser: Web browsers, vector editors Extensions: .svg, .svgz (compressed) |
| Syntax Examples |
AsciiDoc diagram syntax: = Workflow Diagram [plantuml] ---- @startuml start :Step 1; :Step 2; stop @enduml ---- == Process Flow * Input stage * Processing stage * Output stage |
SVG syntax (vector graphics): <svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 400 200">
<rect x="10" y="10"
width="100" height="50"
fill="#3498db"/>
<text x="60" y="40">Step 1</text>
<line x1="110" y1="35"
x2="150" y2="35"
stroke="#333"/>
</svg>
|
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 2002 (Stuart Rackham)
Current Version: Asciidoctor 2.x Status: Actively developed Evolution: Python to Ruby implementation |
Introduced: 1999 (W3C)
Current Version: SVG 2.0 (2018) Status: W3C Recommendation Evolution: SVG 1.0, 1.1, Tiny, 2.0 |
| Software Support |
Editors: VS Code, IntelliJ, Atom
Processors: Asciidoctor, AsciiDoc-py Platforms: GitHub, GitLab, Antora Other: Jekyll, Hugo, Docbook |
Browsers: Chrome, Firefox, Safari, Edge
Editors: Inkscape, Illustrator, Figma Libraries: D3.js, Snap.svg, SVG.js Other: All modern vector software |
Why Convert ADOC to SVG?
Converting AsciiDoc documents to SVG is particularly valuable when you need to transform text-based diagrams, flowcharts, or document visualizations into scalable vector graphics. AsciiDoc supports embedded diagram definitions using PlantUML, Mermaid, or Graphviz, which can be rendered as high-quality SVG images.
AsciiDoc excels at describing complex processes, architectures, and workflows using text-based diagram notation. The conversion to SVG takes these textual descriptions and transforms them into visual graphics that can be embedded in web pages, presentations, or printed documents at any resolution without quality loss.
SVG output is ideal for technical documentation because it maintains text as selectable, searchable content rather than rasterized pixels. Diagrams converted to SVG can be styled with CSS, animated for interactive presentations, and scaled to any size for responsive web design or high-resolution printing.
This conversion is especially useful for developers and technical writers who document software architectures, database schemas, API flows, or business processes in AsciiDoc format. The resulting SVG files integrate seamlessly with modern web frameworks and documentation platforms.
Key Benefits of Converting ADOC to SVG:
- Infinite Scalability: SVG graphics scale perfectly at any size
- Web Ready: Native browser support without plugins
- Diagram Visualization: Convert PlantUML/Mermaid to graphics
- Print Quality: High-resolution output for any DPI
- Interactive: Add CSS styling and JavaScript events
- Accessible: Text remains selectable and searchable
- Small File Size: Efficient for simple diagrams and charts
Practical Examples
Example 1: Flowchart Diagram to SVG
Input ADOC file (workflow.adoc):
= User Registration Workflow [plantuml] ---- @startuml start :User submits form; if (Valid data?) then (yes) :Create account; :Send confirmation email; else (no) :Show errors; stop endif :Redirect to dashboard; stop @enduml ----
Output SVG file (workflow.svg):
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 400"> <!-- Start node --> <circle cx="150" cy="30" r="15" fill="#27ae60"/> <!-- Process boxes --> <rect x="50" y="60" width="200" height="40" rx="5" fill="#3498db"/> <text x="150" y="85" text-anchor="middle" fill="white">User submits form</text> <!-- Decision diamond --> <polygon points="150,120 200,160 150,200 100,160" fill="#f39c12"/> <text x="150" y="165" text-anchor="middle">Valid?</text> <!-- Connecting arrows and more elements... --> </svg>
Example 2: Architecture Diagram to SVG
Input ADOC file (architecture.adoc):
= System Architecture
[mermaid]
----
graph LR
A[Web Browser] --> B[Load Balancer]
B --> C[Web Server 1]
B --> D[Web Server 2]
C --> E[Database]
D --> E[Database]
C --> F[Cache]
D --> F[Cache]
----
== Components
* Load Balancer: Distributes traffic
* Web Servers: Handle requests
* Database: Stores data
* Cache: Improves performance
Output SVG file (architecture.svg):
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 300">
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10"
refX="9" refY="3" orient="auto">
<path d="M0,0 L0,6 L9,3 z" fill="#333"/>
</marker>
</defs>
<!-- Web Browser -->
<rect x="20" y="120" width="100" height="50" rx="5" fill="#e74c3c"/>
<text x="70" y="150" text-anchor="middle" fill="white">Browser</text>
<!-- Load Balancer -->
<rect x="160" y="120" width="100" height="50" rx="5" fill="#9b59b6"/>
<text x="210" y="150" text-anchor="middle" fill="white">Load Balancer</text>
<!-- Connecting lines with arrows... -->
</svg>
Example 3: Sequence Diagram to SVG
Input ADOC file (api_flow.adoc):
= API Authentication Flow [plantuml] ---- @startuml Client -> Server: POST /login Server -> Database: Validate credentials Database --> Server: User data Server --> Client: JWT token Client -> Server: GET /api/data (with token) Server -> Server: Verify JWT Server --> Client: Protected data @enduml ----
Output SVG file (api_flow.svg):
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 350"> <!-- Participant lifelines --> <rect x="40" y="20" width="80" height="30" fill="#3498db"/> <text x="80" y="40" text-anchor="middle" fill="white">Client</text> <line x1="80" y1="50" x2="80" y2="320" stroke="#333" stroke-dasharray="5,5"/> <rect x="200" y="20" width="80" height="30" fill="#27ae60"/> <text x="240" y="40" text-anchor="middle" fill="white">Server</text> <line x1="240" y1="50" x2="240" y2="320" stroke="#333" stroke-dasharray="5,5"/> <rect x="360" y="20" width="80" height="30" fill="#e74c3c"/> <text x="400" y="40" text-anchor="middle" fill="white">Database</text> <!-- Message arrows... --> </svg>
Frequently Asked Questions (FAQ)
Q: What types of AsciiDoc content can be converted to SVG?
A: The converter primarily processes diagram blocks (PlantUML, Mermaid, Graphviz, Ditaa) embedded in AsciiDoc documents and renders them as SVG graphics. Text content, tables, and lists can also be converted to styled SVG representations, though diagrams produce the most useful visual output.
Q: Will the SVG work in all browsers?
A: Yes! SVG is natively supported by all modern browsers including Chrome, Firefox, Safari, and Edge. The generated SVG uses standard elements and attributes for maximum compatibility. For older browsers like Internet Explorer 11, basic SVG works but some advanced features may have limited support.
Q: Can I edit the generated SVG?
A: Absolutely! SVG files are XML-based text files that you can edit with any text editor. For visual editing, you can open SVG files in vector graphics software like Inkscape (free), Adobe Illustrator, Figma, or Sketch. You can modify colors, shapes, text, and add new elements.
Q: How do PlantUML diagrams in AsciiDoc get converted?
A: PlantUML blocks marked with [plantuml] in AsciiDoc are processed by the PlantUML engine, which generates SVG output directly. The resulting SVG contains all the diagram elements (boxes, arrows, text labels) as vector graphics that can be scaled and styled.
Q: What about Mermaid diagrams?
A: Mermaid diagram blocks ([mermaid]) are similarly processed by the Mermaid rendering engine to produce SVG output. Mermaid supports flowcharts, sequence diagrams, class diagrams, state diagrams, Gantt charts, and more. All these render cleanly as scalable SVG graphics.
Q: Can I use CSS to style the SVG?
A: Yes! SVG supports CSS styling both inline and via external stylesheets. You can modify colors, fonts, stroke widths, and apply transformations using CSS. When embedding SVG inline in HTML, it inherits document styles. This makes it easy to match your website's design.
Q: What is the file size of generated SVG files?
A: SVG files are typically very small for simple diagrams, often just a few kilobytes. Complex diagrams with many elements may be larger but are still usually smaller than equivalent raster images. For even smaller files, SVG can be compressed to SVGZ format (gzip-compressed SVG).
Q: Can I convert the SVG to other image formats?
A: Yes! SVG can be converted to PNG, JPEG, or PDF using various tools. Inkscape, ImageMagick, and browser-based tools can rasterize SVG at any resolution. For documentation, you might export to PDF for print or PNG for email. The SVG remains your master file for future edits.