Dark theme PDF from Markdown
One switch restyles everything for dark, including math, diagrams and barcodes, not only the page and text colors.
The whole document restyled for dark: page, text, tables, code, math, diagrams, barcodes and SVG icons. Feature: "theme": "dark".
Markdown source
Markdown · 41 lines# Dark theme
Everything follows the theme: page background, body and heading text, tables, quotes, rules, code palettes, diagram colors, math glyphs and the icons drawn from bare path data.
| Element | Themed |
|:--------|:------:|
| tables | yes |
| code | yes |
| math | yes |
| diagrams | yes |
```python
# the dark code palette
def area(r: float) -> float:
return 3.14159 * r ** 2
```
Math takes the text color: $\displaystyle \int_0^{\infty} e^{-x^2}\,\mathrm{d}x = \frac{\sqrt{\pi}}{2}$
```svg
M12 2 L2 22 H22 Z
```
```mermaid
flowchart LR
a[Draft] --> b{Review} -->|approved| c([Published])
b -->|changes| a
```
```barcode
type: qr
data: https://example.com/dark
module-color: #e2e8f0
background: #0f172a
width: 140
```
> Quotes and alerts adapt as well.
> [!TIP]
> Set `"theme": "dark"` in the request, or flip the switch in the editor.
Rendered pages
PDF · 1 page · 22 KBThe sample documents describe invented organizations in several countries. All names and figures are illustrative.
Whole documents from Markdown to PDF: every sampleIn the Markdown reference
