Sep 15, 2015 - Markdown Syntax

Introduction

What is markdown?

Markdown is a lightweight markup language with plain text formatting syntax designed so that it can be converted to HTML and many other formats using a tool by the same name.Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.

Purpose

"Easy read and write."

可读性,无论如何,都是最重要的。一份使用 Markdown 格式撰写的文件应该可以直接以纯文本发布,并且看起来不会像是由许多标签或是格式指令所构成。Markdown 语法受到一些既有 text-to-HTML 格式的影响,包括 Setext、atx、Textile、reStructuredText、Grutatext 和 EtText,而最大灵感来源其实是纯文本电子邮件的格式。

总之, Markdown 的语法全由一些符号所组成,这些符号经过精挑细选,其作用一目了然。比如:在文字两旁加上星号,看起来就像强调。Markdown 的列表看起来,嗯,就是列表。Markdown 的区块引用看起来就真的像是引用一段文字,就像你曾在电子邮件中见过的那样。

兼容 HTML

Markdown 语法的目标是:成为一种适用于网络的书写语言。

Markdown 不是想要取代 HTML,甚至也没有要和它相近,它的语法种类很少,只对应 HTML 标记的一小部分。Markdown 的构想不是要使得 HTML 文档更容易书写。在我看来, HTML 已经很容易写了。Markdown 的理念是,能让文档更容易读、写和随意改。HTML 是一种发布的格式,Markdown 是一种书写的格式。就这样,Markdown 的格式语法只涵盖纯文本可以涵盖的范围。

不在 Markdown 涵盖范围之内的标签,都可以直接在文档里面用 HTML 撰写。不需要额外标注这是 HTML 或是 Markdown;只要直接加标签就可以了。

要制约的只有一些 HTML 区块元素――比如 <div>、<table>、<pre>、<p> 等标签,必须在前后加上空行与其它内容区隔开,还要求它们的开始标签与结尾标签不能用制表符或空格来缩进。Markdown 的生成器有足够智能,不会在 HTML 区块标签外加上不必要的 <p> 标签。

Getting started

Syntax

Blockquotes

Put ">" before every line.

This is a blockquote

Lists

Markdown supports ordered(numbered) and unordered(bulleted) lists.Like this: For unordered lists, you just start with *, - or + and put a blankspace right behind it. + Red + Green + Blue

For ordered lists, pls start with a number and a dot and a blankspace.

  1. Bird
  2. McHale
  3. Parish

Code Blocks

Markdown requires wrapping a code block in both <pre>and<code>tags.To produce a code in markdown doc, you should simply indent every line of the block at least 4 spaces or 1 tab.Like below:

This is a normal paragraph

This is a code block

Markdown parser will generate HTML code like this: <p>This is a normal paragraph :</p> <pre> <code>This is a code block .</code> </pre>

A code block continues until it reaches a line that is not intended(or the end of the article).

Within a code block(which is intended), all the HTML tags will be converted into HTML entities.However, regular markdown syntax is not processed within code blocks.This means it's easy to use markdown to write about Markdown's own syntax.

However, it's better to surounded by "```[type of lang]".Like this:

    function(){
        do sth...
    }

Horizontal Rules

In MD files, you can produce a horizontal rule tag(<bt />) by placing three or more "*", "-"(recommended) or "_".


Span Elements

Markdown just supports two style of links: inline and reference. The link text is delimited by [square brackets].Use a set of regular parentheses immediately to create an inline link after the link text.And the "title" is optional. eg.

This is an example inline link.

Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link:

This is an example reference - style link.

Then, anywhere in the document, you define your link label like this, on a line by itself:

Emphasis

Markdown treats asterisks(*) and underscores(_) as indicators of emphasis.Text wrapped with one * or _ will be wrapped with HTMl <em> tag; double * or _ will be wrapped with an HTML<Strong>

single asterisks single asterisks

double underscores double underscores

If you want to use charactor "*", suround with spaces would be handle it.Backslash escape it is recommended.

Code

To indicate a span of code, wrap it with backtick quotes(').HTML tags will be treat as character strings. Check below:

Use the printf() function.

Image

baidu logo

Table

Left align Right align Center align
This This This
column column column
will will will
be be be
left right center
aligned aligned aligned

Miscellaneous

Simply surround the URL or email address with angle brackets(<>). Like this:

http://luangng.github.io/

Backslash Escapes

You'd better to backclash escape any charactor you want to use.

Aug 22, 2014 - Jekyll Clean Theme

Welcome to the sample post for the Jekyll Clean theme.

A simple and clean Jekyll theme using bootstrap (not to be confused with jekyll-bootstrap) that's easy to modify and very modular in component and element reuse.

It uses Disqus for comments and includes Google Analytics support. Both of these features are disabled by default and can be enabled via _config.yml. You can also rip this code out of the templates if you like (footer.html and post.html). The beauty of Jekyll - keep things clean... Jekyll Clean!

The theme works well on mobile phones, using a collapsable nav bar and hiding the sidebar. The links pane in the sidebar is available on mobile through the nav menu, and you can do the same thing for any other sections added to the sidebar.

Don't forget to occassionally merge against my upstream repository so you can get the latest changes. Pull requests are encouraged and accepted!

Installation

If you don't have a blog already on github, start by cloning this repository. Best to do that directly on github and then clone that down to your computer.

If you already do have a blog, You can certainly apply this theme to your existing blog in place, but then you won't be able to merge as the theme changes. If you re-apply your blog history on top of this theme's gh-pages branch, it's then easy to update to the latest version of the theme. You also don't want to have to deal with resolving old conflicts from your existing history, so you may wish to to push your existing master off to a new branch so you have the old history and start a new branch with this as the start, merging in your _posts and other assets (after git rm'ing the current _posts.

Not ideal, but you have to make a choice - either apply it manually or base your blog off this theme's branch. Either way it will work, and both have their own pros and cons.

You can setup an upstream tracking repository like so:

$ git remote add upstream git@github.com:scotte/jekyll-clean.git

And now when you wish to merge your own branch onto the latest version of the theme, simply do:

$ git fetch upstream
$ git merge upstream/gh-pages

Of course you will have to resolve conflicts for _config.yml, _includes/links-list.html, and _posts, and so on, but in practice this is pretty simple.

This is how I maintain my own blog which is based on this theme. The old history is sitting in an old-master branch that I can refer to when I need to.

License

The content of this theme is distributed and licensed under a License Badge Creative Commons Attribution 4.0 License

This license lets others distribute, remix, tweak, and build upon your work,
even commercially, as long as they credit you for the original creation. This
is the most accommodating of licenses offered. Recommended for maximum
dissemination and use of licensed materials.

In other words: you can do anything you want with this theme on any site, just please provide a link to the original theme on github so I get credit for the original design. Beyond that, have at it!

This theme includes the following files which are the properties of their respective owners:

Jul 22, 2014 - Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quam metus, commodo sit amet ante a, finibus efficitur lorem. Maecenas egestas purus in tempor volutpat. Sed dapibus tortor nec sem suscipit ullamcorper. Nulla nec lorem lacus. Phasellus condimentum massa quis dolor consequat viverra ut ac magna. Ut a consequat nisi. Vivamus at leo ut turpis convallis lacinia. Curabitur eu placerat quam. Donec ultricies faucibus dui, a tincidunt lorem lobortis condimentum.

Quisque aliquet consectetur justo sit amet convallis. Nunc vel aliquet ipsum, sit amet elementum justo. Vivamus id magna mi. Cras luctus est vel ipsum sagittis pellentesque. Vivamus ante elit, porttitor vitae quam quis, fermentum malesuada risus. Integer nec lectus vel lacus cursus tristique in euismod ipsum. Duis ut varius enim. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Morbi et elit eu tortor lacinia sollicitudin non in lacus.

Integer at viverra turpis. Duis aliquam mattis sapien tempor eleifend. Mauris nec eleifend risus, quis mollis neque. Vivamus non dapibus justo, vel ornare magna. Nunc in nulla venenatis, imperdiet diam in, accumsan massa. Etiam congue augue ipsum, sit amet rutrum nisi blandit quis. Cras in lectus non lorem auctor consequat a vel sem. Aliquam erat volutpat. Fusce lobortis vel orci vitae ullamcorper. Phasellus id eleifend eros. Mauris vulputate, nisi vel auctor auctor, quam enim tincidunt felis, vitae fermentum odio tortor eget est. Integer ornare blandit lectus a accumsan.