Inline Formatting
ZiraDocs supports a rich set of inline formatting options to style your text and add various elements directly within your content. This works in both Strict Mode and Flex Mode, though the syntax may vary slightly.
Basic Text Formatting
Section titled “Basic Text Formatting”Standard Markdown
Section titled “Standard Markdown”All standard Markdown formatting is supported:
**bold text** and *italic text* and ***bold italic***~~strikethrough text~~`inline code`Result:
- bold text and italic text and bold italic
strikethrough textinline code
Extended Formatting
Section titled “Extended Formatting”ZiraDocs extends standard Markdown with a highlight syntax:
==highlighted text==Result:
- ==highlighted text== → rendered as
<mark>highlighted text</mark>
Accuracy note. The renderer’s inline pipeline implements a fixed set of formats:
**bold**,*italic*,***bold italic***,~~strikethrough~~,==highlight==,`code`,[text](url)links, and the class-based spans documented below.Superscript, subscript and keyboard keys do exist — as class-based spans (
[x]{.sup},[x]{.sub},[x]{.kbd}), which is the canonical form. What does not exist is the caret/tilde/plus shorthand for them (^x^,~x~,++x++), and that is deliberate:~x~would collide with~~strikethrough~~, and one syntax per thing beats two that disagree at the edges.Footnotes, definition lists, abbreviations, emoji shortcodes and reference-style links are still not transformed — those characters are HTML-escaped and rendered literally. Sections further down that show them describe aspirational behavior, not current output; they are kept for roadmap context and will be reconciled separately.
Class-Based Text Spans
Section titled “Class-Based Text Spans”ZiraDocs supports pandoc-style bracketed spans to apply a small, fixed palette of semantic styles to inline text:
[content]{.token}The content is still fully inline-processed (so [**bold** text]{.danger}
keeps its bold) and still HTML-escaped. The .token is validated against a
fixed allowlist; the renderer emits a hard-coded tag for each known token
and never interpolates the token into a class attribute. An unknown or
malformed token (anything not in the table below, or a token containing spaces,
quotes, or other non-[a-zA-Z0-9-] characters) is left literal and
inert — no markup is injected. This preserves ZiraDocs’s core sanitization
invariant: user content is always escaped, and only renderer-authored tags from
a closed set are ever added.
The [...]{.token} delimiter (bracket + brace) does not collide with the
link syntax [text](url) (bracket + parenthesis).
Token palette
Section titled “Token palette”| Token | Rendered as | Purpose |
|---|---|---|
danger |
<span class="slidelang-text-danger">…</span> |
Red / error-toned text |
info |
<span class="slidelang-text-info">…</span> |
Blue / informational text |
success |
<span class="slidelang-text-success">…</span> |
Green / positive text |
warning |
<span class="slidelang-text-warning">…</span> |
Amber / caution text |
accent |
<span class="slidelang-text-accent">…</span> |
Violet / accent text |
highlight-warning |
<mark class="slidelang-highlight-warning">…</mark> |
Amber-tinted highlight |
highlight-info |
<mark class="slidelang-highlight-info">…</mark> |
Blue-tinted highlight |
highlight-success |
<mark class="slidelang-highlight-success">…</mark> |
Green-tinted highlight |
underline |
<u>…</u> |
Underlined text |
sub |
<sub>…</sub> |
Subscript — H[2]{.sub}O |
sup |
<sup>…</sup> |
Superscript — O(n[2]{.sup}) |
kbd |
<kbd class="slidelang-kbd">…</kbd> |
A key or key combination — [Ctrl+C]{.kbd} |
small |
<small class="slidelang-text-small">…</small> |
Smaller text (0.875em) |
large |
<span class="slidelang-text-large">…</span> |
Larger, semi-bold text (1.25em) |
sub,supandkbdrequirev2.32.4or newer. Inv2.26.0those three render literally, with their brackets and braces on the page. The other eleven work inv2.26.0— but only in SlideLang’shtml,json. That binary’s PPTX and DocLang’s DOCX left all fourteen literal; the table’s version notes say where.
Which outputs honour the tokens
Section titled “Which outputs honour the tokens”A token is inline formatting, and not every output format has somewhere to put it. One rule holds
everywhere: the text always survives. What varies is how much of the formatting comes with it,
and whether the token’s own syntax comes along — in the rendered outputs it never does, but DocLang’s
markdown passes the source through verbatim. The table below is the authority, row by row.
| Output | Tokens |
|---|---|
SlideLang html, pdf |
Every token produces its markup. kbd is the one exception to the styling: SlideLang ships no CSS rule for .slidelang-kbd, so the key renders in the browser’s default monospace instead of as a key (toolchain#286) |
SlideLang json |
Full in contentHTML; content deliberately keeps the token source |
SlideLang pptx |
v2.32.4 or newer — in v2.26.0 all fourteen reach the slide with their brackets and braces on it. From v2.32.4, twelve of the fourteen carry formatting into the run: the five colours and the three highlight-* as srgbClr (the highlight keeps its text colour and loses the background), underline as u="sng", kbd as a monospace typeface, and small/large as sz. Only sub and sup reach the slide with no run properties at all — PowerPoint runs have no baseline property here |
DocLang html, pdf |
Full, kbd included |
DocLang docx |
v2.32.4 or newer — a v2.26.0 binary left all fourteen literal here too, brackets and braces included. From v2.32.4: underline becomes underline and kbd a monospace run; sub, sup, small, large, the colour tokens and the highlight-* tokens flatten to plain text — H[2]{.sub}O reads H2O. Formatting inside a token composes: [**Ctrl**]{.kbd} is a bold monospace run |
DocLang markdown |
Not interpreted. The token source is passed through verbatim, brackets and all |
Two caveats worth knowing about PPTX. Colours do not follow your theme: the generator reads no
theme at all, so a deck built with --theme startup-tech shows one accent colour in HTML and
another on the slide (toolchain#295). And
tables are still untouched — no token, and no **bold** either, is interpreted inside a table
cell (toolchain#294).
The Markdown gap is tracked in
ziradocs/toolchain#283, along with the DOCX
colour and highlight-* gaps — the library exposes both a colour and a highlight run property
(SetColor, SetHighlight), so those are bugs rather than limits. Subscript and superscript in
DOCX are the one genuine limit: the library exposes no vertical-alignment run property.
Examples
Section titled “Examples”This is [critical]{.danger} and this is [a note]{.highlight-warning}.You can [**combine**]{.danger} spans with other inline formatting.Fine print goes [here]{.small}, and [KEY POINTS]{.large} can stand out.An [unknown]{.mystery} token renders literally: [unknown]{.mystery}.Styling. The CLI ships reference CSS for every class except .slidelang-kbd (see
slidelang CSS assets, and toolchain#286 for
the missing one). Every color is overridable per theme via CSS
custom properties with accessible neutral fallbacks, e.g.:
.slidelang-text-danger { color: var(--slidelang-danger-color, #dc2626); }Links and References
Section titled “Links and References”Basic Links
Section titled “Basic Links”[Link text](https://example.com)[Link with title](https://example.com "Hover title")Images
Section titled “Images”Image Links
Section titled “Image Links”Combine images and links:
[](https://example.com)Footnotes
Section titled “Footnotes”Add footnotes for additional context:
This is text with a footnote[^1] and another one[^2].
[^1]: This is the first footnote content[^2]: Second footnote with a [link](https://example.com)Reference Links
Section titled “Reference Links”Use reference-style links for cleaner text:
Check out [ZiraDocs][slidelang] and [GitHub][gh].
[slidelang]: https://ziradocs.com[gh]: https://github.comLists and Tasks
Section titled “Lists and Tasks”Task Lists
Section titled “Task Lists”Create interactive checklists:
- [x] Completed task- [ ] Pending task- [~] In progress taskDefinition Lists
Section titled “Definition Lists”Define terms clearly:
ZiraDocs: A presentation language optimized for AI generation
Markdown: A lightweight markup language for formatting textMathematical Expressions
Section titled “Mathematical Expressions”Inline Math
Section titled “Inline Math”Use single dollar signs for inline mathematical expressions:
The formula is $E = mc^2$ where E is energy.Block Math
Section titled “Block Math”Use double dollar signs for centered mathematical blocks:
$$\sum_{i=1}^{n} x_i = \frac{a + b}{c}$$Math Examples:
- Inline: The quadratic formula is $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$
- Block equations: For complex formulas, use block notation
Tables with Alignment
Section titled “Tables with Alignment”Create tables with custom alignment:
| Left Aligned | Center Aligned | Right Aligned ||:-------------|:--------------:|--------------:|| Text | Text | Text || More data | Centered | Right-aligned |Result:
| Left Aligned | Center Aligned | Right Aligned |
|---|---|---|
| Text | Text | Text |
| More data | Centered | Right-aligned |
Special Elements
Section titled “Special Elements”Keyboard Shortcuts
Section titled “Keyboard Shortcuts”Display keyboard combinations:
Press [Ctrl+Alt+Del]{.kbd} to restartUse [Cmd+C]{.kbd} to copy on MacAbbreviations
Section titled “Abbreviations”Define abbreviations with hover tooltips:
HTML is widely used on the web.CSS makes it look good.
*[HTML]: HyperText Markup Language*[CSS]: Cascading Style SheetsEmojis
Section titled “Emojis”Use emoji codes or direct Unicode:
:smile: :heart: :rocket: :thumbsup:Or directly: 😊 ❤️ 🚀 👍HTML Integration
Section titled “HTML Integration”Accuracy note — raw HTML is NOT passed through. ZiraDocs’s renderer escapes all user-supplied HTML as a security invariant (see Sanitization architecture). The examples below describe an aspirational “safe HTML” capability that the implementation does not provide.
There is one thing that happens before that escaping, and it is worth knowing. Seven inline tags are rewritten to their DSL equivalent by the content normalizer, because Markdown has no way to write underline, subscript, superscript or a key, so people reach for the tag. This runs in the flex dialects only —
strictis never normalized, so there the tag comes out escaped and literal like any other. Written on one line, opening and closing in that line, they become:
You write It is normalized to And renders as <u>text</u>[text]{.underline}<u>text</u><sub>2</sub>[2]{.sub}<sub>2</sub><sup>2</sup>[2]{.sup}<sup>2</sup><kbd>Ctrl</kbd>[Ctrl]{.kbd}<kbd class="slidelang-kbd">Ctrl</kbd><mark>text</mark>==text==<mark>text</mark><small>text</small>[text]{.small}<small class="slidelang-text-small">text</small><code>x</code>`x`<code>x</code>This is a convenience, not a passthrough — and it has limits, each one there to avoid mangling content that works today. It never touches anything inside a code fence, inside a
`span, inside a<code>block, or inside an embedded<<…>>block; it ignores an unclosed tag, because the scope of one cannot be guessed; and it ignores a tag whose content contains<,>,[or]— a nested tag, or the target syntax itself. Attributes are dropped.Prefer the token.
[Ctrl]{.kbd}is the canonical form and it is what the formatter emits. Any tag outside those seven —<span style="color: red;">,<div>,<script>— still comes out as escaped, literal text. What each output format does with a token is listed under Which outputs honour the tokens.
Instead of raw HTML Use <mark>text</mark>==text==or[text]{.highlight-warning}<span style="color: red;">text</span>[text]{.danger}<u>text</u>[text]{.underline}<sub>2</sub>/<sup>2</sup>[2]{.sub}/[2]{.sup}<kbd>Ctrl</kbd>[Ctrl]{.kbd}small / large text via inline styles [text]{.small}/[text]{.large}See Class-Based Text Spans for the full token palette. Raw HTML passthrough is intentionally not supported and is not on the roadmap.
Complete Example
Section titled “Complete Example”Here’s a comprehensive example showing multiple formatting options:
# Advanced Text Formatting Demo
## Basic FormattingThis presentation covers **essential concepts** in *modern web development*,including ~~outdated practices~~ and ==key highlights==.
## Mathematical ContentThe algorithm complexity is O(n[2]{.sup}) where n represents the input size.For detailed calculations: $complexity = \frac{n!}{(n-k)!}$
## Reference MaterialCheck our documentation[^1] and community guidelines[^2].
### Tasks for Today- [x] Review formatting options- [ ] Create sample presentation- [~] Test with live audience
### Technical TermsAPI: Application Programming Interface
REST: Representational State Transfer
## Quick Actions- Copy: [Ctrl+C]{.kbd}- Paste: [Ctrl+V]{.kbd}- Save: [Ctrl+S]{.kbd}
**Remember:** Practice makes perfect! 🚀
[^1]: Available at [docs.ziradocs.com](https://docs.ziradocs.com)[^2]: See our [GitHub community](https://github.com/ziradocs)Mode-Specific Considerations
Section titled “Mode-Specific Considerations”Strict Mode
Section titled “Strict Mode”In Strict Mode, inline formatting is used within TEXT blocks:
SLIDE: contentTEXT: "This is **bold** and *italic* text with `code`"Flex Mode
Section titled “Flex Mode”In Flex Mode, use inline formatting directly in Markdown:
# My Slide
This is **bold** and *italic* text with `code`.Best Practices
Section titled “Best Practices”- Be Consistent - Use the same formatting patterns throughout your presentation
- Don’t Overformat - Too much formatting can be distracting
- Test Math Rendering - Complex mathematical expressions should be tested
- Use the tokens, not tags -
[x]{.kbd}over<kbd>x</kbd>: the token is canonical, works in every output format, and survivesslidelang fmt - Check Accessibility - Ensure formatted text remains readable
Performance Notes
Section titled “Performance Notes”- Math Rendering - Mathematical expressions require additional processing time
- Image Links - External images may slow down presentation loading
- Inline spans - each one is a regex pass over the line; hundreds per slide are fine, thousands are not
Related Documentation
Section titled “Related Documentation”- Strict Mode Syntax - How formatting works in strict mode
- Flex Mode Syntax - Markdown-style formatting
- Special Blocks - Block-level formatting elements
- Advanced Elements - Charts, diagrams, and interactive content
- Variables & Templates - Dynamic text formatting
Migration Notes
Section titled “Migration Notes”If migrating from other tools:
- PowerPoint/Keynote: Most text formatting translates directly to Markdown
- LaTeX: Mathematical expressions use standard LaTeX syntax
- HTML: raw HTML is not preserved. Seven inline tags are normalized to their token (see above); everything else comes out as escaped, literal text