HyperDoc 2.0 Examples
TODO: Rewrite this document to be explaining instead of showing
§1 Paragraphs and Inline Text
This paragraph shows plain text mixed with emphasis, strike-through, and monospaced spans.
Dieser Absatz zeigt das Attribut lang auf Blockebene.
This paragraph uses a string literal body instead of a list.
Inline scripts support const version = "2.0"; as well as sub/superscripts like H2O and x2.
Links can target other blocks or external resources.
§2 Lists
§2.1 Unordered Lists
-
Apples
-
Bananas
-
Cucumbers with inline markup.
§2.2 Ordered Lists
-
Start counting at three.
-
Continue with a string item.
-
Finish the sequence.
§3 Admonitions
Tips provide actionable hints1.
Tips can also include multiple paragraphs and even lists:
-
Item 1
-
Item 2
Notes highlight supportive information.
Warnings call out risky behavior2.
Danger paragraphs emphasize critical hazards2.
Quotes include sourced or emphasized wording.
- Unknown author
Spoilers hide key story information until revealed.
-
You can also write footnotes this way
-
You can even share the same footnote in multiple locations.,
§4 Literal and Preformatted Blocks
Literal blocks keep exact content and skip parsing, so characters like \{ \} are not special. They are introduced by a trailing colon. You can capture snippets without escaping anything.
test {
const message = "HyperDoc";
const answer = 42;
}
§5 Figures
The image below has a caption, alt text, and a relative asset path.
§6 Dates and Times
The event was announced on at . A combined timestamp looks like .
§7 References
In chapter 1. Paragraphs and Inline Text we've read about how we can format paragraphs. This chapter here teaches about references.
References to another chapter can use the numeric value (like 2.2.), use only the name (like Tables) or we can use a custom name like with regular links.
§8 Tables
See the dedicated tables example file for row groups and colspan usage.
|
Item |
Quantity |
Notes |
|
|---|---|---|---|
| Fresh Produce | |||
| Fruit |
Apples |
12 |
Delivered on . |
| Vegetables |
Carrots |
7 |
Store at . |
| Pantry | |||
| Dry Goods |
Rice |
3 |
Packed on . |
| Bulk |
This cell spans two columns. |
Requires label |
|