by Thomas Leitner
a.k.a. gettalong
Markdown is a lightweight markup language
originally designed for conversion to HTML.
## Header like this This is *emphasized* and this **strong**! And [this is an inline link](http://kramdown.gettalong.org). This whole thing is a paragraph. > Blockquotes are nice. And can be lazy. Code blocks are just indented chunks of text. * Unordered list + Can use different markers - Like we do here 1. Looks like an 2. ordered list, 3. at least to me!
<h2>Header like this</h2>
<p>This is <em>emphasized</em> and this <strong>strong</strong>! And
<a href="http://kramdown.gettalong.org">this is an inline link</a>. This whole
thing is a paragraph.</p>
<blockquote>
<p>Blockquotes are nice.
And can be lazy.</p>
</blockquote>
<pre><code>Code blocks are just indented chunks of text.
</code></pre>
<ul>
<li>Unordered list</li>
<li>Can use different markers</li>
<li>Like we do here</li>
</ul>
<ol>
<li>Looks like an</li>
<li>ordered list</li>
<li>at least to me!</li>
</ol>
Source: xkcd 927
For example:
kramdown is a pure-Ruby Markdown implementation
Header IDs
# Some long header {#shortid}
Fenced codeblocks
~~~ codeblock is here ~~~
Definition lists
term 1 term 2 : definition, all block level elements allowed term 3 : another definition
Simple tables
|-----------------------------------| | header | cells are | in first row | | :--- | :---: | -------: | | left | center | right | | other | data | *inline* | |-----------------------------------|
Footnotes
There is a footnote marker[^note] here. [^note]: Here can be any blocklevel content.
EOB (end of block) marker
* a list
^
* another list
Inline attribute lists
A [link](some_place.html){:.classX} with class! {: #paraid style="text-align: center"} {:ref} Assign IDs, classes or any key-value pair to any span or block level element. {:ref: .multiple.classes.allowed}
And some more… see the syntax guide!
shell> cat file
# Test
A paragraph
shell> kramdown file
<h1 id="test">Test</h1>
<p>A paragraph</p>
shell> kramdown --no-auto-ids file | kramdown -i html -o kramdown
# Test
A paragraph
require 'kramdown/document'
puts Kramdown::Document.new(ARGF.read, auto_ids: false).to_html
The go-to ressource when one is unsure about the correct syntax.
Allows comparing various Markdown implementations
Questions?
/