Skip to the text
Parseh
پParseh guide Writing this guide›The Parseh dialect
On this page

The Parseh dialect

Everything a document in Parseh’s studio can hold, a page of the guide can hold too, and it is drawn by the studio’s own code: the parser that reads the dialect and the renderer that draws it are the studio’s, imported by the compiler, never copied. A lemma heading here is a lemma heading there, down to the pixel. The studio’s own reference for the dialect is markdown/README.md; this page shows each construct working, with a parseh-example block: the Markdown above, what it becomes below.

Every example here is Persian unless it says otherwise — a page is read as Persian when its front matter names no target:, as a studio document is. An example may carry its own front matter, as a document does, and name another language.

1. Target-language text#

In a script language — Persian, Arabic, Hindi, Japanese, Chinese — text in the target’s script is found on its own, set in the language’s face and, for Persian and Arabic, right to left. A paragraph with no Latin letters in it becomes a whole block in the target language. […]{tl} marks a stretch by hand, which is how a Latin word goes inside a Persian sentence, and the only way at all in a Latin-script target, where nothing can be found by its script.

Parseh Markdown
The word کتاب means *book*, and کتاب‌ها is its plural.[این یک PDF است]{tl} — a Persian sentence with a Latin word in it.من کتاب را خواندم، و بعد به خانه رفتم.
Result

The word کتاب means book, and کتاب‌ها is its plural.

این یک PDF است — a Persian sentence with a Latin word in it.

من کتاب را خواندم، و بعد به خانه رفتم.

Parseh Markdown
---target: it---In an Italian lesson every run is marked: [bello]{tl} = *beautiful*,[libro]{translit:ˈli.bro} = *book*, and [la casa]{teal} = *the house*.
Result

In an Italian lesson every run is marked: bello = beautiful, libro = book, and la casa = the house.

A target-language stretch is opaque: nothing inside […]{tl} is read as Markdown, so a * there is a star.

Its attributes#

Parseh Markdown
[تو را من چشم در راهم ⏎ شباهنگام]{tl font=nastaliq bg=quote}
Result

تو را من چشم در راهم
شباهنگام

font=nastaliq sets a block in the language’s alternate face, bg= tints it (quote, sand, rose, sage, lilac), and in Japanese and Chinese vertical sets it in columns, height= of them in em. ⏎ breaks a line.

Parseh Markdown
---target: ja---[春はあけぼの。やうやう白くなりゆく山ぎは、すこしあかりて、紫だちたる雲のほそくたなびきたる。]{tl vertical height=12}
Result

春はあけぼの。やうやう白くなりゆく山ぎは、 すこしあかりて、紫だちたる雲のほそくたなびきたる。

2. Colours, transliterations, readings#

Parseh Markdown
[تند]{teal} fast, [آهسته]{translit:âheste} slow, [کتاب]{#8E2B34 translit:ketâb}in a colour of your own, and [خانه]{crimson} = *house*.
Result

تند fast, آهسته slow, کتاب in a colour of your own, and خانه = house.

The colours are the studio’s five — crimson, indigo, teal, violet, amber — or any #RRGGBB. translit: (and in Japanese kana:) are shown over the word when you point at it. After a target word, = *gloss* greys the =: that is a gloss, and the studio collects glosses into a table.

Parseh Markdown
---target: ja---[漢字]{kana:かんじ translit:kanji} = *Chinese characters*
Result

漢字 = Chinese characters

3. Lemma headings#

A ## heading whose fields are separated by | and which starts with a target-language word is a lemma: the headword, its transliteration, its etymology. In Japanese the reading comes second.

Parseh Markdown
## [کتاب]{teal} | ketâb | Arabic *kitāb* | = *book*The entry itself, as ordinary paragraphs.
Result
کتاب
ketâb
Arabic kitāb

The entry itself, as ordinary paragraphs.

4. Boxes#

A > block is the studio’s tinted box, not a quotation, and it can hold anything a page can: lists, tables, even an exercise.

Parseh Markdown
> **Remember.** A box holds anything:> - a list,> - a formula, [e^{i\pi} + 1 = 0]{math},> - a word, [کتاب]{tl}.
Result

Remember. A box holds anything:

  • a list,
  • a formula, e^{i\pi} + 1 = 0,
  • a word, کتاب.

5. Latin blocks and marks#

Parseh Markdown
[A paragraph of *Latin-script* prose laid out on its own, centred and tinted.]{la align=center bg=sage width=70}A form that is wrong: ✗[کتابا]{tl}; one that is right: ✅ [کتاب‌ها]{tl}.From here -> to there, → and ⏎ a line break.
Result
A paragraph of Latin-script prose laid out on its own, centred and tinted.

A form that is wrong: ❌کتابا; one that is right: ✅ کتاب‌ها. From here → to there, → and
a line break.

6. Formulas#

[…]{math} inside a line and :::math … ::: on lines of their own are LaTeX, drawn by MathJax. $…$ is not a formula, here or in the studio.

Parseh Markdown
The area of a circle is [\pi r^2]{math}.:::math\int_0^1 x^2\,dx = \frac{1}{3}:::
Result

The area of a circle is \pi r^2.

\int_0^1 x^2\,dx = \frac{1}{3}

7. LaTeX drawings#

What MathJax cannot draw — a reaction, a molecule, a plot — LaTeX draws: in a line with […]{latex}, or on lines of their own between ::::latex and ::::, four colons. The guide is compiled where there may be no TeX, so these are pictures made beforehand and kept in markdown/drawings/: a new one is made with build.py --draw, and a compile that finds one missing says so (Compiling and publishing).

Parseh Markdown
Water, [\ce{H2O}]{latex chemistry}, from hydrogen and oxygen:::::latex chemistry {width=45 align=center}\ce{2H2 + O2 -> 2H2O}::::
Result

Water, A drawing made by LaTeX, from hydrogen and oxygen:

A drawing made by LaTeX

8. Exercises#

:::exercise <type> … ::: is one of the studio’s fourteen exercises, and it works on the page as it does in the studio: blocks to drag or tap into place, answers to choose, cards to turn. Check exercises at the end of the page marks them all.

Parseh Markdown
:::exercise fill-blanksprompt: Put the words where they belong.text: من [[blank1]] را خواندم- [blank1] کتاب- [ ] خانهexplanation-correct: کتاب — *the book*.:::
Result
Fill the blanks
Put the words where they belong.
من را خواندم
Parseh Markdown
:::exercise flashcardtarget: کتابtransliteration: ketâbmeaning: book:::
Result
Flashcard
کتاب
ketâb
tap to reveal
Parseh Markdown
:::exercise match-translationsprompt: Match each word with its translation.- [کتاب]{tl} => book- [خانه]{tl} => house- [آب]{tl} => water:::
Result
Match translations
Match each word with its translation.
کتاب
خانه
آب

The showcase has one of each kind, in Persian, Japanese and English. The fields each exercise takes are listed in docs/studio-exercises.md.

9. Recordings and videos#

A picture line whose file is a recording — .mp3, .m4a, .ogg, .wav and the other formats the studio plays — is a player, and @[…](…) is a YouTube video, both laid out as the studio lays out a figure:

Markdown
![The word, read aloud](sounds/ketab.mp3){width=60 start=0:01.5 end=0:03}@[The lesson on YouTube](https://www.youtube.com/watch?v=dQw4w9WgXcQ){width=80 align=center start=30}

Pictures, recordings and videos has more.

The studio’s [label](doc:…) links one document to another; here it links to the page of the guide whose title is given: Shortcodes, and [](doc:Code blocks), left empty, shows the title: Code blocks.

11. Where Parseh wins#

Some text means one thing to Hugo and another to the studio. In every such case the page reads it the studio’s way:

You writeHugo would drawThe guide draws
> texta quotationthe studio’s tinted box; every line needs its >
## a | b | ca heading “a | b | c”a lemma: headword, transliteration, etymology
## Titlea headinga numbered section, “1. Title”, with Hugo’s address
## 3. Title, ## Title = *x*the heading as written“1. Title”: the typed number and the gloss are taken off
[text]{…}the text, then {…}a mark: {tl}, a colour, {translit:…}, {math}, {la}…
![cap](pic.png){width=50}a picture, then {width=50}the studio’s figure, laid out as the braces say
![cap](sound.mp3)a broken picturea player
@[cap](youtube address)texta video
*x*, **x**emphasis anywherethe studio’s: never inside a word, never across a target-language run
- **Label** text, every itema listthe studio’s description list
a line under a list item, at the marginmore of the itema paragraph after the list; indented two spaces, more of the item
[^1] twiceone note, cited twicetwo notes, one per reference, each with its hover cloud
^[a note]texta footnote written in place
a tableGFM’s rulesGFM’s, with the studio’s look; a cell of —, -- or - is empty; the rows end at the first line without a |
->->an arrow, →
✗word, ✅, ⏎textwrong form, tick, line break
word = *gloss* after a target runtexta gloss, its = greyed
:::exercise, :::mathtextan exercise, a formula
[label](doc:Title)a link to “doc:Title”a link to the page with that title
<b>html</b>nothing (Hugo leaves raw HTML out)the tag shown as text, as in the studio; an HTML comment is left out
lines indented four spacesa code blockordinary text: code is always fenced

And where the studio has no reading of its own, Hugo’s holds: code spans are opaque (`**b**` is two stars, a b and two stars — in the studio it would be bold), links take titles and reference definitions, lists nest to any depth and keep their start number, a heading may be written with === or --- under it and go down to level six, and the rest of Hugo’s Markdown.

One case goes Hugo’s way on purpose: a blank line between two list items makes one spaced-out list, numbered on. The studio would end the list there and number the next one from 1 again — it has no list item of more than one line — but a page of this guide needs items that hold more paragraphs, a code block or a box, and lists that count on across them.