Skip to the text
Parseh
پParseh guide The Markdown dialect›How the studio reads a document
On this page

How the studio reads a document

A studio document is one text file: a short front matter at the top, between two --- lines, and then the body. The studio reads the body from the top, one line at a time, and decides for each line what kind of block it starts. Two renderers then draw the same blocks: one as the web page you read and edit in the studio (the reading view, and the editor’s live preview), one as the PDF. They are written as twins, so a figure lands in the same place on the screen and on paper, and a colour is the same colour.

Parseh Markdown
---title: Verbs of motionsubtitle: رفتن and آمدنlang: entarget: fa---## GoingThe verb رفتن = *to go* has the past stem رفت.> **Remember.** The past stem is the infinitive without its *-an*.
Result

Verbs of motion

رفتن and آمدن

1. Going#

The verb رفتن = to go has the past stem رفت.

Remember. The past stem is the infinitive without its -an.

1. The order in which a line is tried#

For every line, the studio asks these questions in this order, and the first yes decides:

The line is…It becomes…Page
blankthe end of the paragraph (or list, or table) above itParagraphs
---, *** or ___ alonenothing: a rule is droppedLeft out
:::exercise and a typean exercise, up to a line :::Writing exercises
:::matha formula, up to a line :::Mathematics
[^id]: texta footnote’s text, drawn where it is citedFootnotes
# , ## or ### and texta title, a numbered section, a subsection — or a vocabulary entryHeadings
> and texta box, with every following > lineBoxes
a line holding |, over a line of dashesa tableTables
![caption](images/…) or ![caption](audio/…) alonea picture, or a recordingMedia
@[caption](a YouTube address) alonea videoMedia
- , * , + , 1. or 1) a list, with the items after itLists
anything elsea line of a paragraphParagraphs

Two consequences are worth knowing from the start:

An exercise and a formula are read first
, so everything between :::exercise and its closing ::: belongs to the exercise, however much it looks like a list or a heading. The same holds for :::math.
A paragraph is what is left over.
Lines next to each other that are none of the above are one paragraph; the studio then looks at the paragraph as a whole, and a paragraph that is entirely […]{la}, entirely […]{tl}, or entirely in the target language’s script becomes a block of its own (Boxes and Latin blocks, Target-language text).

2. Inside a line#

Within a paragraph — and a heading, a list item, a table cell, a caption, a footnote — the studio reads the marks of the dialect. The order matters, because it decides what may sit inside what:

  1. Footnotes, both kinds, are set aside first, so a note may hold almost anything.
  2. Stretches of the target language, […]{tl}, and formulas, […]{math}, are set aside next, whole: nothing inside them is read as Markdown. A * in a Persian sentence marked {tl} is a star.
  3. Links, then colours and transliterations, are found round their text.
  4. Runs of the target script — Persian words in English prose, say — are found and set aside: they are never read as Markdown either, and emphasis never crosses them.
  5. What is left is ordinary prose: **bold**, *italic*, `code`, the arrow →, the line break ⏎, the signs ✗ and ✅.
  6. Last, an = right after a target-language word is greyed: that is a gloss.
Parseh Markdown
A formula [a^2+b^2]{math}, a **bold** word, an *italic* one, [کتاب]{teal} incolour, [تند]{translit:tond} with its transliteration,[a link](https://www.youtube.com/watch?v=aqz-KE-bpKQ), and کتاب = *book*.
Result

A formula a^2+b^2, a bold word, an italic one, کتاب in colour, تند with its transliteration, a link, and کتاب = book.

3. What of ordinary Markdown is there#

The dialect started from the Markdown most people know, and kept the part a lesson needs. Much of the rest is simply not read: typed, it shows as the characters you typed.

Ordinary MarkdownIn the studio
#, ##, ### headingsyes — ## is numbered, # is the title (Headings)
#### and deeper, headings underlined with === or ---no: they are text
paragraphs, blank lines between themyes; lines of one paragraph are joined with a space
a line break by two trailing spaces or a backslashno: use ⏎ (Special characters)
**bold**, *italic*yes, never inside a word or across the target language
__bold__, _italic_, ***both***, ~~struck~~no
`code`yes, one backtick each side — but what is inside is still read
code blocks, fenced or indentedno: a fence is text, and indentation is dropped
-, *, + and 1., 1) listsyes, one level of nesting (Lists)
tables with | and a row of dashesyes, with alignment (Tables)
> quotationa tinted box, which can hold anything (Boxes)
[text](https://…)yes; [label](doc:Name) links another document (Links)
reference links, <https://…>, a bare addressno: text
![caption](images/x.png) on its own lineyes, with a layout in braces (Media)
a picture inside a sentenceno (except inside an exercise)
footnotes [^1]yes, and notes written in place, ^[…] (Footnotes)
--- ruledropped: sections give a document its shape
HTML, <!-- comments -->shown as text
\* backslash escapes, &amp; entitiesno: the backslash and the entity are shown
$x$ mathematicsno: [x]{math} (Mathematics)

What the studio leaves out goes through each of these, and says what you see when you type one.

4. Why the studio’s own rules#

A document here is mostly prose about a language, in another language, and the dialect is built round that. A few of its choices follow from it:

Lines are joined, and a break is asked for.
A source line can wrap wherever it likes — you may paste a paragraph an assistant wrapped at 70 characters — and the paragraph still reads as one. The price is that Japanese and Chinese, which put no spaces between words, gain a space where a line of the source ended: keep each of their sentences on one line.
Target-language text is opaque.
A stretch of the target language is set aside before any Markdown is read, so it stays one unit, laid out in its own direction and face, and nothing can break it up — and a star beside it, which a linguist writes before a form that does not exist, stays a star instead of starting italics.
Every mark looks the same
: a text in square brackets and a word in braces after it — […]{tl}, […]{teal}, […]{translit:…}, […]{la}, […]{math}. Once you know one, you can read them all.

5. This guide is not the studio#

The pages of this guide are Markdown files too, and the guide draws them with the studio’s own code — but it also reads Hugo’s Markdown, which the studio does not: _italic_, ~~struck~~, code blocks, #### headings, reference links, typographic quotes and dashes. Where the two read the same text differently, the guide takes the studio’s reading; the table Where Parseh wins lists every such case, and Hugo’s Markdown lists what the guide adds.

So a construct that works on a page of this guide may not work in a studio document. Everything in this section is the studio’s: where the guide would draw something differently, the example is given as source only, and the text says what the studio does.