Markdown

From Bauman National Library
This page was last modified on 8 June 2016, at 20:05.
Markdown
File:Markdown-mark.svg
First appeared March 19, 2004; 18 years ago (2004-03-19)[1][2]
Stable release 1.0.1 / December 17, 2004; 17 years ago (2004-12-17)
Website {{#property:P856}}

Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).[3] The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

History

Markdown was developed in 2004 by John Gruber, who wrote the first markdown-to-html converter in Perl, and it soon became widely used in websites. [3] By 2014 there were dozens of implementations in many languages. Some of them extended basic Markdown syntax with conventions for footnotes, definition lists, tables, and other constructs, and some allowed output not just in HTML but in LaTeX and many other formats.

Standartization

John Gruber’s canonical description of Markdown’s syntax does not specify the syntax unambiguously. In the absence of a spec, early implementers consulted the original Markdown.pl code to resolve these ambiguities. But Markdown.pl was quite buggy, and gave manifestly bad results in many cases, so it was not a satisfactory replacement for a spec. Markdown.pl was last updated December 17th, 2004. [3] Because there is no unambiguous spec, implementations have diverged considerably over the last years. As a result, users are often surprised to find that a document that renders one way on one system (for example GitHub wiki) renders differently on another (say, converting to docbook using Pandoc). To make matters worse, because nothing in Markdown counts as a “syntax error,” the divergence often isn’t discovered right away. In September 2014, was published the first revision of spec called CommonMark aimed at solving these problems.[4]

Syntax

Block elements

Headers

Markdown HTML produced by a Markdown processor
This is an H1
=============

This is an H2
-------------

# This is another H1

## This is another H2

###### This is an H6
<h1>This is an H1</h1>

<h2>This is an H2</h2>

<h1>This is anonther H1</h1>

<h2>This is another H2</h2>

<h6>This is an H6</h6>

Blockquote

Markdown HTML produced by a Markdown processor
> This is a blockquote with two paragraphs.
> And it's first pargraph.
> 
> > This is nested blockquote. 
>
> This is second paragraph.
<blockquote>
<p>This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
And it's first pargraph.</p>

<blockquote>
  <p>This is nested blockquote.</p>
</blockquote>

<p>This is second paragraph.</p>
</blockquote>

Ordered list

Markdown HTML produced by a Markdown processor
Hint 1. Be lazy, just type one, don't use counting.

1. Red
1. Green
1. Blue

Hint 2. Every item wraped with `<p>` tag.

1. Red

1. Green

1. Blue

Hint 3. Some people for readability prefer add two 
extra space after number.

1.  Lorem Ipsum is simply dummy text of the printing and
    typesetting industry. Lorem Ipsum has been the 
    industry's standard dummy text ever since the 1500s,
    when an unknown printer took a galley of type and
    scrambled it to make a type specimen book.
1.  Another item.
<p>Hint 1. Be lazy, just type one, don't use counting.</p>

<ol>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ol>

<p>Hint 2. Every item wraped with <code>&amp;lt;p&amp;gt;</code> tag.</p>

<ol>
<li><p>Red</p></li>
<li><p>Green</p></li>
<li><p>Blue</p></li>
</ol>

<p>Hint 3. Some people for readability prefer add two
extra space after number.</p>

<ol>
<li>Lorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the 
industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and
scrambled it to make a type specimen book.</li>
<li>Another item.</li>
</ol>

Unordered list

Same as ordered list, but marker is *, - or +.

Markdown HTML produced by a Markdown processor
Like ordered list, for readability
you can add extra spaces.*   First point.

*   Second point.

*   Lorem Ipsum is simply dummy text of the printing and
    typesetting industry. Lorem Ipsum has been the 
    industry's standard dummy text ever since the 1500s,
    when an unknown printer took a galley of type and
    scrambled it to make a type specimen book

*   Code at item. Just add empty line and eight spaces or two tabs.
        
        for i := 1; i < 2; i++ {
            fmt.Println(i)
        }

*   Another point
<p>Like ordered list, for readability
you can add extra spaces.</p>

<ul>
<li><p>First point.</p></li>
<li><p>Second point.</p></li>
<li><p>Lorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the 
industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and
scrambled it to make a type specimen book</p></li>
<li><p>Code at item. Just add empty line and eight spaces or two tabs.</p>

<pre><code>for i := 1; i &amp;lt; 2; i++ {
    fmt.Println(i)
}
</code></pre></li>
<li><p>Another point</p></li>
</ul>

Code block

To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab.

Markdown HTML produced by a Markdown processor
Here is an example of AppleScript:

    tell application "Foo"
        beep
    end tell
<p>Here is an example of AppleScript:</p>

<pre><code>tell application "Foo"
    beep
end tell
</code></pre>

Horizontal rules

You can produce a horizontal rule tag by placing three or more hyphens, asterisks, or underscores on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks.

* * *

***

*****

- - -

---------------------------------------

Span elements

Links

Markdown HTML produced by a Markdown processor
<p><a href="http://en.bmstu.wiki/">BMSTU Wiki</a></p>

Emphasis

Markdown HTML produced by a Markdown processor
*single asterisks*

_single underscores_

**double asterisks**

__double underscores__
<p><em>single asterisks</em></p>

<p><em>single underscores</em></p>

<p><strong>double asterisks</strong></p>

<p><strong>double underscores</strong></p>

Code

Markdown HTML produced by a Markdown processor
Use the `printf()` function.
<p>Use the <code>printf()</code> function.</p>

References

Cite error: Invalid <references> tag; parameter "group" is allowed only.

Use <references />, or <references group="..." />

External links

  • "Markdown". Aaron Swartz: The Weblog. 2004-03-19. 
  • "Daring Fireball: Markdown". Archived from the original on 2004-04-02. Retrieved 2014-04-25. 
  • 3.0 3.1 3.2 Official Markdown project page
  • CommonMark Spec