Markdown
A Markdown file opens laid out as it reads: headings ruled off, lists and tables drawn, code colored by its language. F2 shows the same document typeset as a page, with its pictures in it.
What the keys do
| Key | For a Markdown file |
|---|---|
| Enter | Hands it to the application macOS opens Markdown with |
| F3 | Lays it out, as above |
| ⇧F3 | Shows its text in the text viewer |
| F4 | Opens its text in the built-in editor |
Opening files says how to change them.
Recognized by
The extensions .md, .markdown, .mdown, .mkd and .mkdn. Nothing else is looked at: a
Markdown file called .txt is text.
At a glance
| Key | Action |
|---|---|
| F2 | Typeset |
| F3 | Actual size |
| F5 | Allow what it fetches… |
| F4 | As text |
| ⇧F9 | All it says about itself |
| ⌥→ | Next file |
Reading it laid out
↑ and ↓ move a line, Page Up and Page Down a screen, Home and End to the start and the end; the wheel scrolls. Space goes on to the next file in the pane, as it does in every view with no search.
What each part of a document becomes:
- Front matter
- YAML between two
---lines at the very start of the file is shown first as a block of its own, under a rule labeled “Front matter”: one field to a line, a field inside a field indented, a short list on one line and a longer one bulleted. Fields that are not well-formed YAML are shown as the lines they are. Two---lines around anything that is not fields, such as a heading or a paragraph, are rules, and the document reads as written. A---anywhere else is a rule. - Headings
- The first two levels in bold with a rule under them — double for the title, single for the next.
Levels three to six keep their
#marks, since two weights cannot tell six levels apart. - Paragraphs
- Wrapped to the window. Strong text is bold, emphasis underlined,
struck throughdimmed. - Lists
- Numbered or bulleted, nested, with the lines under an item lined up under its words. A task list
shows
☑and☐. - Tables
- Drawn with lines, each column aligned as the file says. In a narrow window the widest column gives
way first, and a cell cut short ends in
…. - Quotes
- A bar down the side, and dimmer.
- Code
- In a bar, with the language named above it and colored as that language — named, by an alias
such as
js, or by an extension such asyml. Code is cut at the window’s edge rather than wrapped, so no line is shown that is not in the file. - Pictures
- Their description in brackets —
[The gauge on the east pier]— or their file name. The typeset page shows the picture itself. - Links
- Underlined. They are not followed from here; typeset, they are.
- HTML
- A tag inside a paragraph is left out; a block of HTML is shown as it is written, dimmer.
A file larger than 4 MB is not laid out: F3 shows it in the text viewer.
Reading it typeset
F2 shows the document as a page, drawn by macOS’s own web engine: real type sizes, the pictures where the document puts them, code colored as it is laid out, and front matter as a ruled-off block of fields above the first heading. Prose is set in the system’s font, code in the application’s own, all in the screen’s colors. F2 again goes back, as near the same place as the two shapes allow.
- The choice is kept while the application runs, so the next Markdown file opens the same way.
- ↑, ↓ and the page keys scroll the page; + and - zoom it, and F3 puts it back to its own size. The wheel and the mouse reach the page itself.
- A link opens in the application macOS uses for it — a web address in your browser.
- A task list shows a box in place of each bullet, filled with a tick where the item is done.
- Pictures in the document’s own folder, or below it, are shown, up to 96 MB of them.
- A picture on the internet, or outside the document’s folder, is kept back, as a web page’s is: a box across the top says how many, and F5 asks whether to load them this once or always. Web pages load everything loads them from the start.
Finding in it
The laid-out view has no search. F4 shows the file in the text viewer, where F7 searches it — see Searching a file.
What the panel lists
⇧F9 puts a panel in place of the document:
- Outline
- Every heading, with its level as the
#marks the file uses. - Links
- Each link’s words and where it goes.
- Pictures
- Each picture’s description and its address.
- Document
- How many words, and the file’s name.
Typeset, the panel adds every address that was kept back.
Editing it
F4 opens the text in the built-in editor, colored as Markdown. ⌥⌘[ folds by heading, a
section at a time; a # inside a code block is not a heading. There is no laid-out view in the
editor — see Editing files.
Limits
- No search in the laid-out view.
- Links are not followed in the laid-out view.
- The editor does not lay the document out beside what you type.
- The file is read as UTF-8.
- Math is not drawn: a
$is shown as written. .mkdand.mkdnfiles are laid out, but their text is not colored as Markdown.