cli + tui to publish to leaflet (wip) & manage tasks, notes & watch/read lists 🍃
charm
leaflet
readability
golang
1---
2title: Leaflet Rich Text and Blocks
3sidebar_label: Rich Text
4description: How markdown maps to leaflet blocks and formatting.
5sidebar_position: 5
6---
7
8# Leaflet Rich Text and Blocks
9
10## Document Structure
11
12Leaflet documents consist of blocks—discrete content units:
13
14**Text Blocks**: Paragraphs of formatted text
15**Header Blocks**: Section titles (level 1-6)
16**Code Blocks**: Syntax-highlighted code with language annotation
17**Quote Blocks**: Blockquotes for citations
18**List Blocks**: Ordered or unordered lists
19**Rule Blocks**: Horizontal rules for visual separation
20
21## Text Formatting
22
23Text within blocks can have inline formatting called facets:
24
25**Bold**: `**bold text**` → Bold facet
26**Italic**: `*italic text*` → Italic facet
27**Code**: `` `inline code` `` → Code facet
28**Links**: `[text](url)` → Link facet with URL
29**Strikethrough**: `~~struck~~` → Strikethrough facet
30
31Multiple formats can be combined:
32
33```markdown
34**bold and *italic* text with [a link](https://example.com)**
35```
36
37## Code Blocks
38
39Code blocks preserve language information for syntax highlighting:
40
41````markdown
42```python
43def hello():
44 print("Hello, leaflet!")
45```
46````
47
48Converts to a code block with language="python".
49
50Supported languages: Any language identifier is preserved, but rendering depends on leaflet.pub's syntax highlighter support.
51
52## Blockquotes
53
54Markdown blockquotes become quote blocks:
55
56```markdown
57> This is a quote from another source.
58> It can span multiple lines.
59```
60
61Nested blockquotes are flattened (leaflet doesn't support nesting).
62
63## Lists
64
65Both ordered and unordered lists are supported:
66
67```markdown
68- Unordered item 1
69- Unordered item 2
70 - Nested item
71
721. Ordered item 1
732. Ordered item 2
74 1. Nested ordered item
75```
76
77Nesting is preserved up to leaflet's limits.
78
79## Horizontal Rules
80
81Markdown horizontal rules become rule blocks:
82
83```markdown
84---
85```
86
87Use for section breaks.
88
89## Images and Media
90
91**Current status**: Image support is not yet implemented in the Noteleaf-to-leaflet converter.
92
93**Future plans**: Images will be uploaded to blob storage and embedded in documents with image blocks.
94
95**Workaround**: For now, images in markdown are either skipped or converted to links.