Markdown basic grammar, one is enough

Foreword

This time around, the project needs to write interface documentation, blog often use markdown syntax, this time using markdown to write interface documentation, to use the experience to do some summary. People do not be too lazy, sometimes always attracted me, I feel he is very familiar with them is not necessarily real handy. Still much to learn, and more sum up, in order to enrich themselves.

markdown file basic grammar

1.markdown Introduction

  • You can use Markdown is a plain text editor written in a markup language, a simple markup syntax, it can make the plain text content has a certain format.
  • Markdown has a series of derived version, Markdown for extended functions (such as tables, footnotes, embedded HTML, etc.), these features of the original Markdown does not have, they allow more Markdown converted into the format, for example LaTeX, Docbook . Markdown enhanced version of the more famous Markdown Extra, MultiMarkdown, Maruku and so on. These derivative versions based on either tool, such as Pandoc; or on sites such as GitHub and Wikipedia, on the basic syntax compatible, but there are some changes in grammar and rendering.
  • Markdown syntax is concise, easy to learn, and more powerful than pure text, so there are a lot of people use it to write a blog. The world's most popular blog platforms such as WordPress and large CMS Joomla, Drupal can be a good support for Markdown. Completely Markdown editor of the blog platform Ghost and Typecho.
    For writing documentation, and to "README.md" file name stored in the following directory software. Excerpt - Baidu Encyclopedia

2. Function shortcut keys

Undo: Ctrl/Command+ Z
Redo: Ctrl/Command+ Y
Bold: Ctrl/Command+ B
italics: Ctrl/Command+ I
title: Ctrl/Command+ Shift+ H
unordered list: Ctrl/Command+ Shift+ U
ordered list: Ctrl/Command+ Shift+ O
Checklist: Ctrl/Command+ Shift+ C
insert the code: Ctrl/Command+ Shift+ K
Insert link: Ctrl/Command+ Shift+ L
Insert Picture: Ctrl/Command+ Shift+ G
Find: Ctrl/Command+ F
replace: Ctrl/Command+G

Shortcuts Quick Facts

Features hot key
Undo Ctrl + Z
Redo Ctrl + Y
Bold Ctrl + B
Italic Ctrl + I
title Ctrl + H
Unordered list Ctrl + U
Ordered list Ctrl + O
Checklist Ctrl + C
Insert code Ctrl + G
Insert link Ctrl + L
Insert Picture Ctrl + G
Seek Ctrl + F
replace Ctrl + G
Quote Ctrl + Q
Lift title Ctrl + H
Horizontal line Ctrl + R

3.markdown basic grammar

3.1 Classification title

Rational create a title to help build directory. 1 is directly input #, and pressing space, the title level 1 will be generated.
Input 2 #, and press spaceafter the generation stage 2 of the title. And so on, markdown currently supports six titles.

Effect substantially as follows:
Here Insert Picture Description
parsing the html follows:
Here Insert Picture Description
front # sign, with text back, respectively, h1-h6, the figure can be seen that only the attention to h6, a space behind the #

Recommended addresses two markdown online editing, can be used to view real-time effects:
https://www.zybuluo.com/mdeditor
https://tool.oschina.net/markdown/

3.2 change the text style

Normal text

Stressed (tilt) text
stressed (tilt) text

Bold text
in bold text

Bold text tilt
tilted bold text

Tagged Text

Delete Text

Quoted text

The following two written, you can resolve in a friendly csdn compiler:

Here Insert Picture Description
H 2 O IS liquid
2 10 operation results in 1024

3.3 gorgeous dividing line

When writing the document, the dividing line is essential. * Dividing line can be made - these three symbols, each symbol indicates the type of at least three _ (asterisk, minus, bottom).
注意:Each symbol has at least three or more (including 3), and need not be continuous, there may be a space, but the row may not have other content or dividing line is invalid.
Here Insert Picture Description







3.4 Insert link

Supports two kinds of links: internal line and parameter type, no matter what kind, the link text is marked with [square brackets].

  • In-the-line link
    links
    Here Insert Picture Description
    markdown which can be mixed with some, such as: link list
  • Parametric link
    [param]: http://www.baidu.com
    which is a parameter of formula [param] link, rewriting method is not used, the main use of the above embodiment that
    Here Insert Picture Description
  • Lazy man's link
    Markdown support with a relatively short URLs automatically linked form processing and e-mail, as long as the use <> wrap, Markdown will automatically turn it into a link. Of course, you can also write directly, but also can be automatically displayed as links form.
    Such as: www.baidu.com or <www.baidu.com>, such an approach does not take effect on csdn.
    Here Insert Picture Description

3.5 Insert Picture

  • Insert picture internet

Grammar rules: ![图片描述信息](图片网络存储路径)
Note: this image description can not write.

Normal size image
Here Insert Picture DescriptionPicture 1

Pictures with dimensions: Here Insert Picture DescriptionAlt

Centered picture:
Here Insert Picture DescriptionAlt

Centered and pictures with size: 主要pic_center和后边设置尺寸的“=”之间有空格
Here Insert Picture DescriptionAlt

  • Into the local image link
    Here Insert Picture Description

3.6 references

Before the quoted text plus >sign, and a space can be, if only to enter a >symbol will have a blank reference, there can be multiple.

注意: That is right angle bracket in English, note the space

  • The basic use of
    use as shown below:
    Here Insert Picture Description

  • Nest cited
    references because it is a block, in theory, should be what can be put, for example: headings, lists, references, etc., as illustrated below:
    Here Insert Picture Description
    The above code a little change it, all together a reference label, it becomes a great reference, there are also references cited there, in that nested references cited no other writing it?
    Here Insert Picture Description
    The figure can be seen, you want a quote on a layer of nested references, just one more> theoretically unlimited nesting, I do not so much a whole, attention: multiple levels of nested> is not required continuous together in a row as long as you can, and allow the middle of a space, but in order to look good, or to do a good job publishing it.

3.7 List

  • Unordered list
    using *, +, -unordered list.
    Note: there must be a space behind the sign, play a role indent.
    Here Insert Picture Description
    Here Insert Picture Description
    一个tab键,会有不同效果
  • Item 3
    • Item 3
      • Item 3
    • Item 3
      • Item 3
        • Item 3
          • Item 3
      • Item 3
        Here Insert Picture Description
  • An ordered list of
    numbers and only one period represents an ordered list.
    Note: behind the English period must have a space, indentation play the role.
    Here Insert Picture Description
  • Lists and other elements mixed
    lists not only can be used alone or with other Markdown syntax for mixed use, such as: Title, reference, code, tile, etc., interested can try yourself.
    Here Insert Picture Description

3.8 Escape

Js escaping with basically the same syntax
Here Insert Picture Description

Code block 3.9

This is more important, write interface documentation, there must be some code request parameters, and return parameters, this time need to demonstrate.
With three English formula backquote ( `), if the write comments, quotes may be written after the anti
shown below:
Here Insert Picture Description

  • Block which contains html code
    in which the code block, &, <and> are automatically converted to HTML entities, in such a way so that you easily inserted into the HTML source code with the use of examples of the Markdown, just copy and paste, the remaining Markdown will help you deal with.
    注意: Jane in the book block does not support html.

Examples are as follows:
Here Insert Picture Description

3.10 Creating a table

  • A simple table is so created:
    Here Insert Picture Description
project Value
computer $1600
Cellular phone $12
catheter $1
  • Setting content center, the left and right of abode
    to use :---------:the center
    to use :----------left home
    use ----------:right of abode

Here Insert Picture Description

first row The second column The third column
The first column of text centered The second column of text goes on the right The third column of text Left

Common basic grammar, basically that's all, mastered the above said, markdown almost enough.

This article reference links:

  1. CSDN official help documentation
  2. https://www.cnblogs.com/liugang-vip/p/6337580.html
  3. https://blog.csdn.net/u014061630/article/details/81359144

Write your own blog is easy to forget in order to remember things, and the other is the summary of their work, hoping to make their own efforts to do better, we work together to progress!
If you have any questions, please discuss with everyone, the code any questions, welcome to correct me great God!


Add to your dream pair of wings, they can fly freely in the sky!

Released two original articles · won praise 0 · Views 32

Guess you like

Origin blog.csdn.net/smilehappiness/article/details/105067651