IOSL/formats/rune.md

2.1 KiB

IOSL.Rune

IOSL.Rune is a document formatting format using runes, characters that are normally put at the start of a line that indicate the formatting applied to it; although they also may be used inline via inline rune syntax

Example

% Comment
* Header
& Paragraph, _[italics] and *[bold]

Specification

It's recommended that the parser provides an easy way of adding external attributes (if HTML is the target language).

Full runes

Full runes are the runes that are put at the start of a line, and format it entirely.

% <rune> <text>
& This is a full rune

Inline runes

Inline runes are used to format excerpts of a line, and allow for a more fine-grained formatting.

% <rune>[<text>]
& This is a full rune with an _[inline rune]

Rune specification

Although an IOSL.Rune implementation might add special runes, the following list is the required runes to be a compatible implementation

Full runes

Explicit line breaks may be specified using the plus character, for outputting the plus character escape it like \+

Paragraph

& Paragraph

might compile to HTML as

<p>Paragraph</p>

Header

The parser must provide a way to change the header level.

* Header

might compile to HTML as

<h2>Header</h2>

Code

#{
	This is my
	+
	code block.
}

might compile to HTML as

<pre>This is my
code block</pre>

Table

° data A | data B
| item 1 | item 2

might compile to HTML as

<table>
  <tr>
    <th>data A</th>
    <th>data B</th>
  </tr>
  <tr>
    <td>item A</td>
    <td>item B</td>
  </tr>
</table>

An alternative rune syntax is presented below

<rune>{
	<text>
}

Inline runes

Code

#[monospaced text]

might compile to HTML as

<code>italic text</code>

Italic

_[italic text]

might compile to HTML as

<em>italic text</em>

Bold

*[bold text]

might compile to HTML as

<strong>bold text</strong>

Highlight

~[highlighted text]

might compile to HTML as

<mark>italic text</mark>