Chyrp Flavoured Markdown

Chyrp Lite has its own flavour of Markdown, the syntax for writing structured documents in plain text. Chyrp-Flavoured Markdown extends Github-Flavored Markdown with some extra features that make it easier to write blog-style articles.

Syntax

The syntax of Github-Flavored Markdown is described in extensive detail. Below is an overview of that specification and a description of the features added to it by Chyrp-Flavoured Markdown. The formatting applied to a text document by a Markdown parser can be divided into two broad categories, which are described below: "inline" and "block".

Inline formatting

Inline elements do not disrupt the flow of text and can be used in almost any location within a Markdown document. Most inline elements can contain other inline elements.

Strong

Strong text is delimited by the characters ** or __. The opening and closing delimiters must match.

Markdown formatting:

This is **strong text**
This is __strong text__

HTML output:

This is <strong>strong text</strong>
This is <strong>strong text</strong>

Emphasis

Emphasised text is delimited by the character * or _. The opening and closing delimiters must match.

Markdown formatting:

This text has *emphasis*
This text has _emphasis_

HTML output:

This text has <em>emphasis</em>
This text has <em>emphasis</em>

Citations

A citation is delimited by the opening characters *_ and the closing characters _*.

Markdown formatting:

This is a *_citation_*

HTML output:

This is a <cite>citation</cite>

Strikethrough

Struck through text is delimited by the characters ~~.

Markdown formatting:

This text has a ~~strikethrough~~

HTML output:

This text has a <del>strikethrough</del>

Inline Code

Inline code is delimited by one or more ` characters.

Markdown formatting:

This is `inline code` and so is ``this``.

HTML output:

This is <code>inline code</code> and so is <code>this</code>

Highlighting

Highlighted text is delimited by the characters ==.

Markdown formatting:

This text has a ==highlight==

HTML output:

This text has a <mark>highlight</mark>

Superscript and Subscript

Superscript text is delimited by the characters ++. Subscript text is delimited by the characters --.

Markdown formatting:

This text ++superscript++ and this text is --subscript--

HTML output:

This text is <sup>superscript</sup> and this text is <sub>subscript</sub>

Hyperlinks are defined by a title contained within [], followed by a URL contained within ().

Markdown formatting:

This is a hyperlink [title](URL) in the text

HTML output:

This is a hyperlink <a href="URL">title</a> in the text

Images

Images are defined by the ! character, followed by a description contained within [], followed by a URL contained within ().

Markdown formatting:

![description](URL)

HTML output:

<img src="URL" alt="description">

Block formatting

Block elements are the containers for the flow of text in a Markdown document. Only some block elements can contain other block elements, but almost all block elements can contain inline elements.

Paragraphs

A sequence of non-blank lines forms a paragraph. The paragraph element is the default container for the flow of text in a Markdown document.

Markdown formatting:

This is a paragraph.
It continues until a blank line is encountered,

or the parser reaches the end of the document.

HTML output:

<p>This is a paragraph.
It continues until a blank line is encountered,</p>
<p>or the parser reaches the end of the document.</p>

Hard Line Breaks

A line break can be forced by ending a line of text with two or more spaces, or a \.

Markdown formatting:

This is a sentence  
with a line break,\
created in two ways.

HTML output:

<p>This is a sentence<br>
with a line break,<br>
created in two ways.</p>

Headings

A heading is identified by a line of text starting with 1-6 # characters, or a line of text immediately followed by a line of the characters = or -.

Markdown formatting:

# This is a heading
## This is a heading
### This is a heading
#### This is a heading
##### This is a heading
###### This is a heading

This is a heading
=================

This is a heading
-----------------

HTML output:

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
<h5>This is a heading</h5>
<h6>This is a heading</h6>
<h1>This is a heading</h1>
<h2>This is a heading</h2>

Horizontal Rules

A horizontal rule is defined by a line containing 3 or more of the characters *, -, or _.

Markdown formatting:

***
---
___

HTML output:

<hr>
<hr>
<hr>

Pre-formatted Code Blocks

A pre-formatted code block is defined by a series of lines beginning with 4 or more spaces and surrounded by blank lines, or a series of lines delimited by 4 or more ` or ~ characters.

Markdown formatting:


    This is a code block
    Every line must be indented

````
This is a code block
````

~~~~
This is a code block
~~~~

HTML output:

<pre><code>This is a code block
Every line must be indented</code></pre>

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

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

Unordered and Ordered Lists

Unordered lists are defined by a series of lines beginning with the characters -, +, or *, followed by at least one space.

Ordered lists are defined by a series of lines beginning with a number followed by ) or ., followed by at least one space.

Markdown formatting:

- Item
- Item
- Item

1. Item
2. Item
3. Item

HTML output:

<ul>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>

<ol>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ol>`

Blockquotes

Blockquotes are defined by a series of lines beginning with the character >, followed by at least one space.

Markdown formatting:

> This is a blockquote

HTML output:

<blockquote>
<p>This is a blockquote</p>
</blockquote>

Asides

Asides are defined by a series of lines beginning with the character <, followed by at least one space.

Markdown formatting:

< This is an aside, otherwise known as a call-out

HTML output:

<aside>
<p>This is an aside, otherwise known as a call-out</p>
</aside>

Figures and Captions

Figures are defined by a series of lines beginning with the character :, followed by at least one space. Figures can optionally include a caption, which is defined by a series of lines beginning with the characters ::, followed by at least one space. Captions must be defined at the beginning or end of a figure, otherwise they will be ignored.

Markdown formatting:

: This is a figure

: This is a figure
:: This is a caption

:: This is a caption
: This is a figure

: > Therefore, send not to know\
: > For whom the bell tolls,\
: > It tolls for thee.\
:: Figures and captions can contain block and __inline__ formatting

: ![description](URL)
:: This caption is for a figure containing an image

HTML output:

<figure>
<p>This is a figure</p>
</figure>

<figure>
<p>This is a figure</p>
<figcaption>
<p>This is a caption</p>
</figcaption>
</figure>

<figure>
<figcaption>
<p>This is a caption</p>
</figcaption>
<p>This is a figure</p>
</figure>

<figure>
<blockquote>
<p>Therefore, send not to know<br>
For whom the bell tolls,<br>
It tolls for thee.<br>
</p>
</blockquote>
<figcaption>
<p>Figures and captions can contain block and <strong>inline</strong> formatting</p>
</figcaption>
</figure>

<figure>
<img src="URL" alt="description">
<figcaption>
<p>This caption is for a figure containing an image</p>
</figcaption>
</figure>

Footnotes

Footnotes are defined by a line beginning with the characters [^, followed by an author-defined label, followed by the characters ]:, followed by a series of non-blank lines of footnote content.

Footnote references are defined by the characters [^, followed by the footnote label, followed by the character ].

Markdown formatting:

A *simple* footnote[^1] reference, and one with a label.[^label] Labels can be anything.[^✳&|^"]

[^label]: Labelled footnote (number 2)
with multiple lines.
[^1]: The *first* footnote, with [inline](https://example.org/) formatting.
[^✳&|^"]: Any characters are allowed.

Footnotes can be defined out of order (both where they're called and defined).
Block elements such as headers, lists, and quotes can contain footnotes,
and footnotes can contain block elements. One footnote can be referenced multiple times.

HTML output:

<p>
A <em>simple</em> footnote
<sup id="fnref-1" class="footnote-ref"><a href="#fn-1" role="doc-noteref">1</a></sup>
reference, and one with a label.
<sup id="fnref-2" class="footnote-ref"><a href="#fn-2" role="doc-noteref">2</a></sup>
Labels can be anything.
<sup id="fnref-3" class="footnote-ref"><a href="#fn-3" role="doc-noteref">3</a></sup>
</p>
<p>
Footnotes can be defined out of order (both where they're called and defined).
Block elements such as headers, lists, and quotes can contain footnotes,
and footnotes can contain block elements. One footnote can be referenced multiple times.
</p>

<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn-1">
<p>The <em>first</em> footnote, with <a href="https://example.org/">inline</a> formatting.</p>
<p class="footnote-backrefs"><a href="#fnref-1" role="doc-backlink">↩︎</a></p>
</li>
<li id="fn-2">
<p>Labelled footnote (number 2)
with multiple lines.</p>
<p class="footnote-backrefs"><a href="#fnref-2" role="doc-backlink">↩︎</a></p>
</li>
<li id="fn-3">
<p>Any characters are allowed.</p>
<p class="footnote-backrefs"><a href="#fnref-3" role="doc-backlink">↩︎</a></p>
</li>
</ol>
</div>