MarkDown基础知识

来源:互联网 发布:下载mp4连续剧软件 编辑:程序博客网 时间:2024/06/16 09:51

 

1.    设置斜体Tomake a phrase italic in Markdown, you can surround wordswith an underscore (_ ). Forexample, _this_ word wouldbecome italic.

2.    设置粗体tomake phrases bold in Markdown, you can surround wordswith two asterisks ( ** ). This will **really** get yourpoint across.

 

3.     make some words bold and italic.

In general, it doesn't matter which order you place theasterisks or underscores. In the box below, make the words "This isunbelievable" both bold and italic. Place the asterisks **_on the outside_**

4.    设置标题Tomake headers in Markdown, you preface the phrase with a hash mark (#). You place the same number of hash marks as thesize of the header you want. For example, for a header one, you'd use one hashmark (# Header One), while for a header three, you'd use three (### Header Three).

5.    设置文字链接Thefirst link style is called an inline link. To create an inline link, you wrap the link text inbrackets ( [ ] ), and thenyou wrap the link in parenthesis ( ( ) ). Forexample, to create a hyperlink to www.github.com, with a link text that says,Visit GitHub!, you'd write this in Markdown: [Visit GitHub!](www.github.com).

6.设置文字链接The other link type is calleda reference link. As the name implies, the link is actually areference to another place in the document. Here's an example of what we mean:

    Here's [a link to something else][another place].

    Here's [yet another link][another-link].

    And now back to [the first link][another place].

 

    [another place]: www.github.com

    [another-link]: www.google.com

 

The"references" above are the second set of brackets: [another place] and [another-link]. At the bottomof a Markdown document, these brackets are defined as proper links to outsidewebsites. An advantage of the reference link style is that multiple links tothe same place only need to be updated once. For example, if we decide to makeall of the [another place] links go somewhere else, we only haveto change the single reference link.

Reference linksdon't appear in the rendered Markdown. You define them by providing the sametag name wrapped in brackets, followed by a colon, followed by the link.

7.插入图片If you know how to create links inMarkdown, you can create images, too. The syntax is nearly the same.

The difference is that an image is prefaced with an exclamationpoint ( ! ), followed by the same two brackets, and a pair of parenthesescontaining the image URL. Within the image brackets, you can place some"alt text," which is a phrase or sentence that describes the imagefor the visually impaired.

![descriptionwords](images link)

Example:

![Imagetext](https://github.com/kiritozzl/ChineseSimpleDictionary/blob/master/imag/device-2016-10-11-191537.png)

 

8.设置引用To create a block quote, all you have todo is preface a line with the "greater than" caret (>). For example:

> "In a few moments he was barefoot, his stockings folded in his pockets and his
  canvas shoes dangling by their knotted laces over his shoulders and, picking a
  pointed salt-eaten stick out of the jetsam among the rocks, he clambered down
  the slope of the breakwater."

 

9.在段与段之间的空格行插入>,确保引用连续

You can also place a caretcharacter on each line of the quote. This is particularly useful if your quotespans multiple paragraphs. For example:

> His words seemed to have struck some deep chord in his own nature. Had he spoken
of himself, of himself as he was or wished to be? Stephen watched his face for some
moments in silence. A cold sadness was there. He had spoken of himself, of his own
loneliness which he feared.
> —Of whom are you speaking? Stephen asked at length.
> Cranly did not answer.

Notice that even blank lines must contain the caret character.This ensures that the entire blockquote is grouped together.

 

10.创建无序的目录(* 后面要隔一个空格)

To create anunordered list, you'll want to preface each item in the list with an asterisk ( * ). Eachlist item also gets its own line. For example, a grocery list in Markdown mightlook like this:

* Milk

* Eggs

* Salmon

* Butter

This Markdownlist would render into the following bullet points:

  • Milk
  • Eggs
  • Salmon
  • Butter

 

11.创建有序的目录(1. 后面要隔空格)

An ordered listis prefaced with numbers, instead of asterisks. Take a look at this recipe:

1.   Crack three eggsover a bowl

2.   Pour a gallon ofmilk into the bowl

3.   Rub the salmonvigorously with butter

4.   Drop the salmoninto the egg-milk bowl

To write that inMarkdown, you'd do this:

1. Crack three eggs over a bowl

2. Pour a gallon of milk into the bowl

3. Rub the salmon vigorously with butter

4. Drop the salmon into the egg-milk bowl

 

12.缩进创建子无序目录

Occasionally,you might find the need to make a list with more depth, or, to nest onelist within another. Have no fear, because the Markdown syntax is exactly thesame. All you have to do is to remember to indent each asterisk onespace more than the preceding item.

For example, inthe following list, we're going to add some sub-lists to each "main"list item, describing the people in detail:

* Tintin

 * Areporter

 *Has poofy orange hair

 *Friends with the world's most awesome dog

* Haddock

 * Asea captain

 *Has a fantastic beard

 *Loves whiskey

   *Possibly also scotch?

When rendered,this list turns into the following grouping:

  • Tintin
    • A reporter
    • Has poofy orange hair
    • Friends with the world's most awesome dog
  • Haddock
    • A sea captain
    • Has a fantastic beard
    • Loves whiskey
      • Possibly also scotch?

 

13.在每一行最后插入两个空格,缩减行与行之间的空格(效果变化如下)

If you forcefully insert anew line, you end up breaking the togetherness:

Do I contradict myself?
 
Very well then I contradict myself,
 
(I am large, I contain multitudes.)

This is what's known as a hardbreak; what our poetry asks for is a soft break. You canaccomplish this by inserting two spaces after each new line. This is not possible tosee, since spaces are invisible, but it'd look something like this:

Do I contradict myself?··
Very well then I contradict myself,··
(I am large, I contain multitudes.)

Each dot ( · ) represents a space on the keyboard.

 

原文

扩展链接:Markdown基础知识

0 0
原创粉丝点击