This document contains examples of all GitHub Flavored Markdown (GFM), both code snippets and as rendered, and additional data structures (code blocks) rendered in various ways.
It serves both as a test on what is supported in the various places, and as a reference for how to write GFM.
This is how it renders by GitHub's own processor. There are differences compared to GitHub pages.
Start line with 1-6 #
characters, then a space, then the header text:
## foo 1
### foo 2
#### foo 3
##### foo 4
###### foo 5
####### foo 6
The above will be rendered as:
####### foo 6
It is also ok with #
symbols after the header text, like this:
## foo 1a
### foo 2a
#### foo 3a
##### foo 4a
###### foo 5a
####### foo 6a
These will look like the following:
####### foo 6a
One can also specify the two first header levels using underlines.
## Header text
will show up as:
and:
### Another header text
comes out as:
In these cases the header text can span multiple lines, as in:
Header with a
lot of text
=============
One can use one of *
, -
or _
. It must be at least three of them, and there
can be spaces between. There can be nothing else that whitespace and one of the
mentioned characters.
---
renders like:
and:
---
also renders like:
and even (at most three initial spaces)
---
renders like:
Enough with horisontal lines.
GFM emoji rendering has been enabled! 👍
Most elements are passed through and will render as such. The following HTML elements will be encoded using <, and thus be inactivated in the final html code:
<title>
<textarea>
<style>
<xmp>
<iframe>
<noembed>
<noframes>
<script>
<plaintext>
All other html and xml tag lookalikes will be passed through, and either rendered as usual, or be available for targeted CSS styling.
<ruby>tekst<rt>ja</rt></ruby>
will render as:
tekst
This can be used to show pronunciation:
<ruby><strong>cromulent</strong> <rp>(</rp><rt>crôm-yü-lənt</rt><rp>)</rp></ruby>
cromulent
Traditional use is for east asian scripts:
한자
Ruby elements can even be nested:
世上無難事只怕有心人
In our context it can be used for simple glossing/text annotation:
1800-lågon hieredimbargon
<kbd>ᛌᛁᚢᚱ</kbd>
ᛌᛁᚢᚱ
ᛌᛁᚢᚱ
pie showData
title Formal languages used in GiellaLT
"LexC" : 3129
"Xfst regex" : 2374
"Xfst script" : 856
"TwolC" : 125
"YAML" : 4451
Based on counts of all files of the various types in all repositories in the GiellaLT infra.
Another Mermaid test, this one includes configuration data:
%%{init: {"pie": {"textPosition": 0.5}, 'theme':'forest', "themeVariables": {"pieOuterStrokeWidth": "5px"}} }%%
pie showData
title Key elements in Product X
"Calcium" : 42.96
"Potassium" : 50.05
"Magnesium" : 10.01
"Iron" : 5