Rendering
Every kind of file you have, drawn as a page worth reading
Open a file and Leaftext draws it as a clean page in your theme. Markdown reads the way GitHub draws it, and data files, email, Office documents and books get pages of their own.
- Notes: Markdown with tables, diagrams, math and footnotes.
- Data: JSON, YAML, XML, INI and CSV as readable sections and tables.
- Mail and documents: saved emails, Word, Excel, PowerPoint and OpenDocument files.
- Books: EPUB and Kindle books, one chapter after another.
- Code: any source file, colored in your theme.
Summary
| File | Drawn as |
|---|---|
| Markdown | The page GitHub would draw, with diagrams and math |
| XML | Sections and tables; a sitemap becomes a table of addresses |
| JSON and YAML | Headed sections and tables of records |
| HTML | The page itself, scripts and all |
| The message: headers, body, pictures and attachments | |
| Office files | The document, sheet or slides, editable in place |
| EPUB and Kindle books | The whole book, in reading order |
| Text, INI, CSS, CSV | The file name as a heading over its content |
| Source code | Colored code in your theme |
See every detail of rendering →
Pipeline
Each file is read on your computer and drawn by the same renderer the website uses. Nothing is fetched from the internet to draw it.
See the details →
EPUB books
An EPUB opens as the whole book on one page: the cover, its contents page, then every chapter in order. Each book takes your theme's type, not its publisher's.
Read Le Morte d'Arthur here, with its glossary →
See the details →
Kindle books
A Kindle book without copy protection opens the same way, as one document. Protected books say Leaftext cannot open them.
See the details →
Plain text files

A .txt file is drawn as its file name over its text, with your lines kept as written.
See the details →
INI files

An .ini file shows each section as a heading, with its keys in a list beneath.
See the details →
CSS files
A stylesheet opens as colored code, with a small square beside each color it names.
See the details →
CSV files
A .csv or .tsv file opens as a table you can sort, filter, and type in.
See the details →
Source files

Any source file opens as colored code in your theme, with its language named above it.
See the details →
Reading at a prompt
Read any file in a terminal with leaftext --print notes.md, drawn in the terminal's own colors.
See the details →
A book a chapter at a time
leaftext --print book.epub --contents lists a book's chapters, so you can print one at a time.
See the details →
Checking a file's diagrams
leaftext --diagrams notes.md checks every diagram in a file, and says which ones draw.
See the details →
Markdown
Leaftext draws CommonMark and GitHub-flavored Markdown, plus a few extras of its own.
Headings
Six levels, # to ######, each one a step smaller.
Text formatting
Bold, italic, struck, code and highlighted words.
Lists
Bulleted, numbered, and nested lists, drawn as you wrote them.
Blockquotes and alerts
Alerts like this one come in five kinds: note, tip, important, warning and caution.
Code
Fenced code is colored in your theme, with a button to copy it.
fn main() {
println!("Leaftext");
}
Tables
Tables keep their alignment and scroll sideways when they are wide. On a narrow screen, each row becomes a card.
| Feature | Works |
|---|---|
| Sorting | ✅ |
| Cards | ✅ |
Task lists
- Tick a box with a click
- Add a date, and it shows as a badge
Links and autolinks
Links open in the app, and a bare web address becomes a link by itself. A link alone on its line draws as a card, and a card to an HTML page on your disk plays that page live in the note.
See the details →
Wiki links
[[Note name]] links to a note by its name.
Tabs (Leaf extension)
Leaftext can draw a group of tabs in a note, written as plain headings any other reader can still follow.
See the details →
Buttons (Leaf extension)
A link can be drawn as a button, with one of the app's own marks on it.
See the details →
Badges (Leaf extension)
Done Waiting Blocked
A word in code with a color in a comment after it becomes a badge.
See the details →
Bars (Leaf extension)
A list whose items end in an amount can be drawn as bars on one scale.
See the details →
Framed figures (Leaf extension)
A titled box with a caption, for a figure or a worked example.
See the details →
Cards across the page (Leaf extension)
A row of cards, each with a title, a few words and a picture.
See the details →
Images
Pictures beside the note are drawn in place. Hover one to open it on the whole window.
See the details →
Math
Math is written between dollar signs: E = mc^2.
Mermaid diagrams
flowchart LR
A["Write it"] --> B["See it drawn"]
Diagrams take your theme's colors. Hover one to open it big or to edit it.
See the details →
Emoji
GitHub shortcodes such as :rocket: become 🚀.
GitHub references
Issue numbers stay as you wrote them, so a list item is never mistaken for an issue.
See the details →
Footnotes
Footnotes collect at the foot of the page, and a press on one opens it over the page.
See the details →
Frontmatter

A note's fields at the top, such as its status and tags, are drawn as a tidy card.
See the details →
Collapsible sections
Press to open
A section folded away until you need it.
Inline HTML
A safe set of HTML tags works inside a note, kept in a box of its own.
See the details →
Horizontal rules
Three dashes draw a line across the page.
Text in any language
Every script reads, including right-to-left languages.
See the details →
XML

An XML file is drawn from its structure. A sitemap becomes a table of addresses, and a feed becomes its stories.
See the details →
Any XML

Tag names are read as words, so lastBuildDate reads as "Last build date".
See the details →
TEI XML

A scholarly TEI edition is drawn as an edition, with its front matter folded away.
See the details →
Data files (JSON and YAML)

A JSON or YAML file is drawn as headed sections and tables of records, not punctuation.
See the details →
HTML files
A web page runs as a browser runs it, so a page built by its own script opens finished.
See the details →
Email (.eml)

A saved email opens as the message: its subject, who sent it, the body, pictures and attachments.
See the details →
Office and OpenDocument files
Word, Excel, PowerPoint and OpenDocument files open as the document, sheet or slides. You can type into them, and everything Leaftext never read is kept on save.
See the details →
File encodings
Files in older encodings are read correctly, and saved back the way they came.
See the details →