@@ -1,350 +0,0 @@
8−_thanks to ~rovnys-ricfer for writing this_
10−# Urbit-Flavored Markdown
14−Urbit-Flavored Markdown (UFM) is a minimal markup language for creating and rendering text documents,
15−with a [Markdown](https://en.wikipedia.org/wiki/Markdown)-inspired syntax. It's integrated with the Hoon programming
16−language, allowing it to be used as standalone prose in its own file or inside
17−a hoon source file, in which case it will be parsed into a tree of HTML nodes
18−using Hoon's `sail` datatype.
20−UFM is stricter than Markdown and generally supports only one syntax for each
21−type of HTML node that it emits.
25−Headers in UFM begin with one or more `#` characters, followed by a space. The
26−number of leading `#`s corresponds to the resulting HTML element: `#` yields an
27−`<h1>`; `##` yields the slightly smaller `<h2>`; and so on, through `<h6>`.
43−A line beginning with a `-` or `+` followed by a space is interpreted as an
44−element of a list. `-` means unordered list (`<ul>`) and `+` means ordered list
51− text on newline shows up on same line
53− text on newline after `\` puts in <br> line break
55−- unordered after 1 blank line
62− + nested ordered '+' item 1
63− + nested ordered '+' item 2
73− text on newline shows up on same line
75− text on newline after `\` puts in <br> line break
77− - unordered after 1 blank line
84− + nested ordered '+' item 1
85− + nested ordered '+' item 2
93−A section of text beginning with `> ` and indented by two spaces yields a
94−`<blockquote>` element. This blockquote can itself turn contain more UFM,
95−including more blockquotes to render nested levels of quotation.
100−> As Gregor Samsa awoke one morning from uneasy dreams
101− he found himself _transformed_ in his bed into a *monstrous* vermin.
106−> > As Gregor Samsa awoke one morning from uneasy dreams
107− he found himself _transformed_ in his bed into a *monstrous* vermin.
111−By enclosing a block of text in `\`\`\` on their own lines
112−before and after the block, the text will be treated as a code block.
140−A poem is a section of text with meaningful newlines. Normally in UFM,
141−newlines are treated as spaces and do not create a new line of text. If you
142−want to embed text where newlines are retained, then indent the text by
143−question with eight spaces.
147− A shape with lion body and the head of a man,
148− A gaze blank and pitiless as the sun,
149− Is moving its slow thighs, while all about it
150− Reel shadows of the indignant desert birds.
153−> A shape with lion body and the head of a man,
154− A gaze blank and pitiless as the sun,
155− Is moving its slow thighs, while all about it
156− Reel shadows of the indignant desert birds.
160−It's possible to use Urbit-Flavored Markdown as an HTML-templating language akin to
161−PHP, ERB, JSP, or Handlebars templates. This facility derives
162−in part from the support for embedding Hoon code inside the markup.
163−There are two ways to do embed Hoon in UFM: inline expressions and `sail`.
164−[Sail](https://urbit.org/fora/posts/~2017.7.6..21.27.00..bebb~/)
165−is a DSL within Hoon for creating XML nodes, including HTML. It can
166−be used directly within UFM to provide scripting capability and also to
167−provide more fine-grained control over the resulting HTML.
173− ;strong: Don't panic!
175− ;small: [reactive publishing intensifies]
183− ;strong: Don't panic!
185− ;small: [reactive publishing intensifies]
190−[Urbit's web-publishing system](https://urbit.org/docs/arvo/web-apps/)
191−currently does not apply `<style>` elements or element attributes,
192−which are supported in `sail` syntax. Future versions of the publishing
193−system will rectify this._
197−`---` on its own line produces an `<hr>` element, the 'horizontal rule'.
198−This is rendered as a horizontal line the width of its containing paragraph.
213−In addition to the above, UFM includes several options for marking up
218−Enclose some text in asterisks to boldly render it inside a `<b>` element.
222−The first rule of tautology club is
223−*the first rule of tautology club*.
227−> The first rule of tautology club is
228− *the first rule of tautology club*.
232−Surrounding text with `_` on each side will cause it to appear
233−in italics, using an <i> element.
246−Text enclosed in double quotes (`"`) will be rendered with
247−opening and closing quotes.
251−"Yes," he said. "That is the way with him."
255−"Yes," he said. "That is the way with him."
257−##### Backslash escape
259−A backslash directly before a word (with no spaces) will be interpreted
260−as an escape character, causing it to be rendered raw.
264−Here is some *bold* text.
265−Here is some \*not bold\* text.
269−Here is some *bold* text.
270−Here is some \*not bold\* text.
272−##### Trailing backslash
274−A backslash at the end of a line inserts a line break (`<br>`)
275−after that line. This contrasts with the normal UFM behavior of
276−converting newlines to spaces.
280−I wonder how long each line
281−will be if I put backslashes\
282−at the ends of the lines.
286−I wonder how long each line
287−will be if I put backslashes\
288−at the ends of the lines.
290−##### Inline code literal
292−Enclosing some text in ``` characters will cause it to be displayed as code,
293−inside a <code> element with monospace font and a different background color.
297−`*[a 2 b c] -> *[*[a b] *[a c]]` is like lisp's `apply`.
301−`*[a 2 b c] -> *[*[a b] *[a c]]` is like lisp's `apply`.
303−Also, using the `++` prefix before a word will cause the word
304−to be rendered as code, since that's the standard notation
305−for an `arm` in Hoon.
309−The UFM parser is part of ++vast.
313−The UFM parser is part of ++vast.
317−Hoon has several syntactic forms for literals (numbers, strings, dates, etc.)
318−that can be used in UFM as well. They will appear inside a <code> element like
337−To insert a hyperlink, put the text content of the link in `[]` brackets
338−followed by the destination URL in `()` parentheses. Note that the text
339−of the displayed link can contain Markdown styling.
344−A [Hoon `core`](https://urbit.org/docs/hoon/concepts/#-core-object)
345−is similar to an object in a traditional programming language.
349−A [Hoon `core`](https://urbit.org/docs/hoon/concepts/#-core-object)
350−is similar to an object in a traditional programming language.