RDTMDRDTMD is a standalone, native technical markup language and VS Code extension built entirely from scratch without runtime dependencies or external libraries. It replaces the fragmented Markdown ecosystem by integrating mathematical formulas, interactive charts, nine kinds of structured diagrams, tabbed interfaces, metric dashboards, conversations, footnotes, and modular files into a single, cohesive specification, with one-click export to HTML and PDF. Table of Contents
Overview and PhilosophyTraditional Markdown was designed in 2004 as an email-friendly shorthand for simple HTML prose. Over the past two decades, technical writing and scientific documentation have evolved: researchers and engineers now require complex mathematical notation, interactive code snippets, architectural diagrams, metric tracking, and modular document structures. To meet these requirements, the industry historically adopted a fragmented approach:
RDTMD redesigns technical documentation from the ground up:
Why RDTMD: Comparison with Markdown
The Three Design PrinciplesRDTMD adheres to three strict architectural rules to guarantee predictability for both human authors and LLM/AI code assistants: 1. Predictable Syntax and NestingNested directives must never break the parser. RDTMD introduces variable-length colon fences ( 2. Legible Plain-Text FallbackA technical document must remain readable in terminal environments, headless git viewers, and raw text editors without any graphical renderer. RDTMD syntax mirrors structured human notes:
3. Unambiguous Data SemanticsIn machine learning and systems engineering, numerical variations are context-dependent:
Syntax ReferenceHeadings and Typography
Lists and ChecklistsRDTMD supports nested unordered lists, ordered lists with custom start offsets, and styled task checklists. Task boxes are rendered as scalable SVG vectors rather than OS-dependent form controls.
TablesTables support column alignment syntax (
Callouts and QuotesStandard blockquotes use
Custom LaTeX MathematicsThe mathematical engine parses LaTeX grammar directly into a specialized DOM tree without external JavaScript or web fonts. It handles baseline alignments, horizontal vinculums, dynamic parentheses scaling, and multi-line matrices. Inline math uses
Supported Mathematical Features
Native SVG ChartsCharts are declared via
The series on a chart with an Bar Chart
Stacked and Horizontal Bars
Line Chart
Secondary Axis
Area Chart
Scatter PlotEach series is a list of
Pie and Donut Charts
Native SVG DiagramsRDTMD ships nine diagram generators with client-side layout algorithms: 1. Flowchart (
|
| Syntax | Shape |
|---|---|
id[Label] |
Rectangle |
id(Label) |
Rounded |
id{Label} |
Diamond (decision) |
id((Label)) |
Circle |
id[(Label)] |
Cylinder (database) |
id{{Label}} |
Hexagon |
:::diagram flow "Order Validation"
Start((Begin)) -> Check{In stock?}
Check -> Pay(Payment) : yes
Check -> Wait[Waiting] : no
Wait --> Check : retry
Pay -> Db[(Database)] -> Ship{{Shipping}}
Ship -> Done((End))
:::

Groups. group Name ... end draws a titled frame around the nodes first mentioned inside it. Groups can be nested.
:::diagram flow "Architecture"
group Frontend
UI[Interface] -> Router
end
group Backend
API -> Auth
API -> Db[(PostgreSQL)]
end
Router -> API : HTTPS
Auth --> Db
:::

2. State Machine (state)
Same syntax as flow, plus [*] for the initial and final states. The default direction is top-to-bottom.
:::diagram state "Task Lifecycle"
[*] -> Waiting
Waiting -> Running : start
Running -> Waiting : pause
Running -> Done : finish
Done -> [*]
:::

3. Sequence Diagram (sequence)
Generates vertical actor lifelines, synchronous calls, dashed return messages, and self-referential loops. The distance between two lifelines adapts to the labels that cross it, and each label has its own background so that a lifeline never strikes through the text.
:::diagram sequence "Authentication Flow"
Client -> Gateway : POST /login
Gateway -> AuthServer : ValidateToken
AuthServer -> DB : LookupUser
DB --> AuthServer : UserRecord
AuthServer --> Gateway : 200 JWT
Gateway --> Client : Set-Cookie
:::

Additional statements, one per line:
| Statement | Effect |
|---|---|
participant Name as Label / actor Name |
Declare a participant (fixes the order, sets a display label). |
activate Name / deactivate Name |
Draw an activation bar on a lifeline. |
note over A,B : text |
Note spanning one or two participants. |
note left of A : text / note right of A : text |
Note beside a lifeline. |
alt cond ... else cond ... end |
Alternative branches. |
opt cond ... end |
Optional block. |
loop cond ... end |
Loop. |
par label ... and label ... end |
Parallel branches. |
@autonumber |
Number the messages. |
:::diagram sequence "Authentication"
@autonumber
participant UI as Browser
participant API
participant DB
UI -> API : POST /login
activate API
API -> DB : SELECT user
DB --> API : row
note over API,DB : password hashed with bcrypt
alt valid credentials
API --> UI : 200 + JWT
else invalid credentials
API --> UI : 401
end
deactivate API
loop every 5 min
UI -> API : GET /refresh
end
:::

4. Mindmap (mindmap)
Parses indentation hierarchies (2 spaces per level, no depth limit) and generates a central-root tree structure. Child branches are balanced across the left and right sides according to their number of leaves, with Bézier curves and distinct branch colors. Click a node to collapse or expand its branch. End a line with {#hex} or {colorname} to color a branch and everything under it.
:::diagram mindmap "RDTMD Ecosystem"
RDTMD
Parser
AST Schema
Diagnostics
Renderer
Math Engine
SVG Visuals
VS Code
Live Preview
Language Grammar
:::

:::diagram mindmap "Ecosystem"
RDTMD
Parser {#e6794e}
Blocks
Directives
Includes
Inline
Renderer {#4e9de6}
SVG
Math
Extension {#5cc08a}
Preview
Export
:::

5. Timeline (timeline)
Constructs chronological roadmaps. Milestone cards alternate above and below the central temporal axis, supporting multiple concurrent milestones separated by |. Long texts are wrapped inside their card, and cards are sized from the measured text so that nothing overflows or overlaps.
:::diagram timeline "Project Roadmap"
2024: Architecture design | Initial parser
2025: Native math engine | SVG diagram algorithms
2026: RDTMD v1.1 release | Gantt & quadrant
:::

section Name groups the following periods and gives them their own color (with a legend). @orient vertical lays the timeline out top-to-bottom.
:::diagram timeline "Roadmap"
@orient vertical
section Past
2024: First prototype
2025: Public release | Marketplace
section Future
2026: Version 1.1 with new diagrams
:::

6. Gantt Chart (gantt)
One task per line: Name: [flags,] start[, duration or end].
- Start: a date
YYYY-MM-DD, orafter Task(a task defined earlier). Omit it to start right after the previous task. - Duration:
5d(days) or2w(weeks); or an end date (inclusive). - Flags:
done,active,crit,milestone(a single-day diamond). section Namegroups tasks.@todaydraws a line at the current date.
:::diagram gantt "Release Plan"
section Design
Specification: done, 2026-10-01, 5d
Mockups: done, after Specification, 4d
section Build
Parser: active, 2026-10-08, 10d
Rendering: after Parser, 2w
HTML export: crit, 2026-10-20, 8d
section Ship
Tests: 2026-11-01, 6d
Release: milestone, after Tests
:::

7. Quadrant (quadrant)
A four-cell matrix for prioritization. Points use coordinates from 0 to 1 (x left to right, y bottom to top). @quadrants names the cells in the order top-left, top-right, bottom-left, bottom-right.
:::diagram quadrant "Idea Prioritization"
@x Effort: Low -> High
@y Impact: Low -> High
@quadrants Plan | Major projects | Quick wins | Avoid
PDF export: 0.25, 0.85
Gantt: 0.55, 0.8
Themes: 0.2, 0.3
Collaboration: 0.9, 0.9
Snippets: 0.15, 0.65
:::

8. Entity-Relationship (er)
entity Name followed by indented attributes (name: type, optionally ending with PK, FK, or UK). Relations are A <card>--<card> B : label with the cardinalities 1, 0..1, *, 1..*, and 0..*, drawn with crow's-foot notation.
:::diagram er "Database Schema"
entity User
id: int PK
email: text UK
org_id: int FK
entity Org
id: int PK
name: text
entity Post
id: int PK
user_id: int FK
title: text
Org 1--* User : employs
User 1--0..* Post : writes
:::

9. Class Diagram (class)
class Name (optionally <<stereotype>>) followed by indented members; members containing ( are shown as methods. Parents and containers are placed above their children.
| Relation | Meaning |
|---|---|
A --\|> B or B <\|-- A |
Inheritance |
A ..\|> B |
Realization |
A *-- B or B --* A |
Composition (A owns B) |
A o-- B or B --o A |
Aggregation |
A --> B |
Association |
A ..> B |
Dependency |
A -- B / A .. B |
Plain / dotted link |
:::diagram class "Class Hierarchy"
class Animal <<abstract>>
+name: string
+age: int
+speak()
class Dog
+fetch()
class Cat
+purr()
class Owner
+pets: Animal[]
Dog --|> Animal
Cat --|> Animal
Owner o-- Animal : owns
:::

Common Block Options
Every chart and diagram accepts three options on their own line:
| Option | Values | Effect |
|---|---|---|
@theme name |
default, warm, cool, mono, pastel, vivid |
Color palette of the block. |
@width px |
120 to 4000 | Maximum width of the figure. |
@align side |
left, center, right |
Alignment of the figure. |
Interactive Tabs
The :::tabs directive provides instant client-side tab switching without reloading or manipulating query parameters. Each tab begins with === Tab Name. Any valid RDTMD block (code blocks, tables, math, charts, diagrams, callouts) can be placed inside a tab.
:::tabs
=== Python
```python
def forward(x):
return self.layer(x)
=== JavaScript
function forward(x) {
return this.layer.run(x);
}
=== Rust
fn forward(&self, x: &Tensor) -> Tensor {
self.layer.forward(x)
}
:::

### Unambiguous Metric Cards
The `:::metrics` (or `:::kpi`) block creates responsive KPI grids. Variations can be enriched with explicit polarity qualifiers so improvements and regressions are categorized correctly:
```rdtmd
:::metrics "Benchmark Evaluation"
Validation Loss: 0.18 (-14%, good)
Latency: 42 ms (+6 ms, bad)
Accuracy: 98.4% (+1.2%, pos)
Parameters: 7B (+1B, neutral)
:::

- Positive / Improvement (
diff-pos, green badge):good,pos,amelioration(or prefixgood: -14%). - Negative / Regression (
diff-neg, red badge):bad,neg,regression(or prefixbad: +6 ms). - Neutral (
diff-neutral, gray badge):neutral,neutre(or prefixneutral: +1B). - Default: Without a qualifier, leading
+defaults to positive, and-defaults to negative.
Conversational Dialogue
The :::chat (or :::dialog) block renders human-to-AI or multi-agent conversations with avatar badges, sender tags, and styled chat bubbles.
:::chat "Technical Consultation"
user: How can we reduce inference latency while keeping perplexity intact?
ia: You can implement structured INT8 quantization or speculative decoding with a draft model.
system: Benchmark session concluded
:::

Recognized roles:
user,utilisateur,human,me-> Right-aligned user bubble.ia,ai,assistant,model,bot-> Left-aligned assistant bubble.system,systeme-> Centered italicized system badge.- Any custom sender name is supported and labeled.
Collapsible Details
The :::details (or :::accordion) block provides collapsible disclosure sections with an animated rotating vector chevron.
:::details "Training Hyperparameters" @open
- **Optimizer**: AdamW (beta1=0.9, beta2=0.999)
- **Base learning rate**: 3e-4 with cosine decay
- **Global batch size**: 128
- **Precision**: Mixed FP16 / BF16
:::

- An optional
@openparameter renders the section expanded by default.
Table of Contents, Anchors and Footnotes
# Release Notes {#top}
@toc 2
## Highlights
RDTMD 1.1 adds nine diagram types, export to HTML and PDF, themes, and footnotes[^1].
See [the charts](#charts) for the details.
[^1]: Footnotes are numbered in order of first citation.
@tocinserts a table of contents built from the headings of the document (the optional number is the deepest level, default 3).{#id}at the end of a heading gives it a stable anchor; without it the anchor is derived from the title (accents and punctuation removed, duplicates numbered). Link to it with[text](#id).[^id]cites a footnote and[^id]: textdefines it (indent the following lines to continue it). Notes are numbered by first citation and collected at the end of the document, each with a link back to the text. The editor reports citations without a definition and definitions that are never cited.

Fenced Code Blocks and Syntax Highlighting
Code blocks include enhanced headers displaying the language tag, file name, line numbering, line highlighting, and a one-click copy button:
```python title="train.py" lines hl="2,4-5"
import torch
import torch.nn as nn
class LinearModel(nn.Module):
def __init__(self):
super().__init__()
```

Code Fence Metadata Options
title="filename.ext": Displays the file name in the header bar.linesornum: Activates line numbers.hl="3,5-7": Highlights the specified line numbers and ranges.- Language alias:
```py:train.pyis also supported as a concise shorthand.
Custom Syntax Tokenizer
The built-in tokenizer recognizes 25+ programming languages, CLI utilities, and config formats:
- Languages: Python, JavaScript, TypeScript, Rust, C, C++, C#, Java, Go, PHP, Ruby, Kotlin, Swift, Lua, PowerShell, Batch, Shell, SQL, R, Perl, LaTeX.
- Config / Data: JSON, YAML, TOML, INI, HTML, XML, Nginx, GraphQL, Dockerfile, Makefile, Regex, Diff.
- Diff Enhancements: Multi-line diff blocks automatically compute outer boundary radiuses, keeping interior line seams square while rounding exterior corners.
```diff title="version_bump.diff"
@@ -1,4 +1,5 @@
-const version = "1.0.3";
+const version = "1.1.0";
+// Gantt, quadrant, ER and class diagrams
```

Modular Document Includes
The @include directive embeds external .rdtmd documents cleanly:
@include chapters/introduction.rdtmd
@include architecture/diagrams.rdtmd
- Relative Path Resolution: Resolves target files relative to the current file on disk.
- Cycle Detection: Automatically flags and halts recursive loops.
- Depth Limiting: Clamps recursion to a maximum depth of 8 levels.
- Image Localization: Automatically remaps relative image paths within included documents to absolute system paths.
Security and CSP Compliance
Many VS Code markdown preview extensions encounter security warnings or rendering failures when strict Content Security Policies (CSP) are enforced in enterprise environments.
RDTMD is designed to adhere to the strictest CSP constraints:
- No
innerHTML: Code paths never assign raw string templates toelement.innerHTML. - No
eval()or dynamic scripts: Calculations and layouts execute through pure arithmetic routines. - No inline style attribute assignments: Elements avoid
setAttribute('style', ...)in favor of direct property manipulation (element.style.width) or CSS utility classes. - Safe URI validation: Links beginning with
javascript:,vbscript:, or maliciousdata:schemes are blocked at the inline parser stage. - Safe exports: The document data embedded in an exported HTML file is escaped so that no text, however hostile, can close the surrounding script tag; images are embedded as
data:URIs and nothing is loaded from the network.
AST Architecture
The RDTMD core exports two primary methods:
parse(text): Transforms a raw string into an Abstract Syntax Tree (AST) alongside an array of diagnostic warnings or errors. Each diagnostic has aline, aseverity, amessage, and, when relevant, a machine-readablecodeanddataused by the editor's quick fixes.plainText(ast): Serializes the AST into plain text for fallback display, indexing, or search.
AST Node Example
{
"type": "root",
"children": [
{
"type": "heading",
"level": 1,
"inline": [{ "type": "text", "value": "Model Architecture" }],
"line": 0
},
{
"type": "metrics",
"title": "Performance Summary",
"items": [
{
"label": "Throughput",
"value": "120 tokens/s",
"diff": "+15 tokens/s",
"diffType": "pos",
"line": 3
}
],
"line": 2
}
]
}
VS Code Extension
Live Preview and Interactive Figures
RDTMD: Open Preview opens a live preview next to the editor. It updates as you type, and the editor and the preview stay scrolled to the same place (rdtmd.syncScroll).
Every chart and diagram shows a small toolbar when you hover it:
- Zoom and pan (diagrams):
+,-, reset,Ctrl+ mouse wheel, drag when zoomed, double-click to reset. - Highlight on hover: pointing at a node (or a participant, or a task) dims the rest and keeps its links lit.
- Collapse: click a mindmap node to fold or unfold its branch.
- Save as SVG or PNG: the file is self-contained (styles are embedded), PNG is rendered at twice the size.
Export to HTML and PDF
- RDTMD: Export as HTML writes a single self-contained
.htmlfile: styles, scripts, data, and local images are embedded, includes are expanded, and nothing is fetched from the network. It follows the system light/dark preference unlessrdtmd.themeforces a theme, and the figure toolbar still works in the exported page. - RDTMD: Export as PDF prints the document with a Chromium-based browser found on your machine (Microsoft Edge, Google Chrome, Chromium, or Brave; set
rdtmd.browserPathto choose one). The PDF uses a light theme (orpaper), shows every tab, keeps figures together with their captions, and avoids splitting tables and code blocks across pages. If no browser is found, the document opens in your default browser so you can use its "Save as PDF".
Both commands are in the Command Palette and in the editor title menu of .rdtmd files.
Themes and Palettes
rdtmd.theme selects the look of the preview and of HTML exports:
| Value | Look |
|---|---|
auto |
Follows the VS Code color theme (default). |
light / dark |
Forces a light or dark preview, including code highlighting. |
paper |
Warm paper tones, pleasant to read and to print. |
contrast |
White on black. |
rdtmd.palette replaces the default chart and diagram colors with your own hex list, for example ["#4e9de6", "#e6794e", "#5cc08a"]. A single block can override it with @theme (default, warm, cool, mono, pastel, vivid).
Editing Features
- Completion: directive names after
:::, chart and diagram types,@optionsfor the block you are in, and block keywords (group,participant,note over,alt,section,entity,class,milestone, ...). - Snippets: type
rdt-(for examplerdt-gantt,rdt-flow,rdt-seq,rdt-er,rdt-stack,rdt-scatter,rdt-tabs,rdt-toc,rdt-fn) for a ready-to-edit block. - Quick fixes (lightbulb on a diagnostic): fix a misspelled directive, chart or diagram type, or option (with "did you mean"); pad or trim a chart series to the right number of values; add a missing closing
:::,end, or footnote definition; remove a strayendorelse. - Diagnostics with line numbers for every block, including unknown tasks in
after, dates that do not exist, and values outside 0 to 1 in a quadrant. - Folding of every
:::block, the document outline from headings, and clickable@includelinks. - Syntax highlighting for the new constructs (shapes, relations, dates, durations, footnotes,
@toc).
Settings and Commands
Settings
rdtmd.preserveLineBreaks(boolean, default:true): Preserves source file line breaks in paragraphs and quotes within the preview.rdtmd.inlineIncludes(boolean, default:false): Embeds the content of@includefiles directly into the current preview. When disabled, displays a clickable navigation chip-> path.rdtmdthat opens the target file in the editor. Exports always embed includes.rdtmd.theme(auto,light,dark,paper,contrast, default:auto): Color theme of the preview and of HTML exports.rdtmd.palette(array of hex colors, default: empty): Colors of charts and diagrams.rdtmd.syncScroll(boolean, default:true): Keeps the editor and the preview scrolled to the same place.rdtmd.browserPath(string, default: empty): Chromium-based browser used for PDF export; auto-detected when empty.
Commands
- RDTMD: Open Preview (
rdtmd.preview): Opens the synchronized live preview in the side editor pane. - RDTMD: Show AST (JSON) (
rdtmd.showAst): Opens a split view displaying the generated JSON Abstract Syntax Tree for debugging and introspection. - RDTMD: Export as HTML (
rdtmd.exportHtml): Saves a self-contained HTML file. - RDTMD: Export as PDF (
rdtmd.exportPdf): Saves a PDF.
Installation and Usage
Installing the VSIX Extension Package
Run the following command in your terminal:
code --install-extension dist/rdtmd-1.1.0.vsix --force
Or search for RDTMD directly in the Visual Studio Code Extensions view (Ctrl+Shift+X).
After installation, reload your VS Code window:
- Press
Ctrl+Shift+P(orCmd+Shift+Pon macOS). - Type
Developer: Reload Windowand pressEnter.
Creating Your First RDTMD Document
- Create a new file with the
.rdtmdextension (for example,report.rdtmd). - Add your content:
# Project Report :::metrics "System Health" CPU Usage: 42% (-5%, good) Memory: 8.2 GB (+0.4 GB, neutral) ::: :::diagram flow "Pipeline" Input -> Processor -> Storage ::: - Click the preview button in the top-right corner of the editor tab, or press
Ctrl+Shift+Pand chooseRDTMD: Open Preview. - A complete tour of the language is in
example/demo.rdtmd.
License
MIT License. Designed and maintained by Théo (RDTvlokip).










