Documentation writing tool: Markdown

I. Introduction

Whether you are a software developer, writer or the Internet, in order to write their own documents or works better circulation, easy, different environments, different people see different occasions, need to find a common, easy to reverse, retained document format.

Prior to this, now or in the future, you might exist following problems:

  • As a software developer, architect, writing design documents should be in the end what kind of format to save it? It is the word, txt, pdf, html or what? These document formats, in different situations, may all exist. Sometimes in order to facilitate the review, modification, will use the word format; sometimes in order to prevent tampering with the document, will use the pdf format; sometimes in order to facilitate web browsing (such as: GitLib), will use html format. Are you going to do differently to prepare for a different format?
  • As the Internet writers, we are hoping to be able to write articles published on different platforms to share to more people. In different Internet platforms, such as: micro-channel public number, CSND, almost known, the proper way cloud notes, etc., publishing articles will cost you a lot of time, also, there are some differences on different platforms layout, and even make you crazy. Is it different for different platforms to adjust the layout of it?

More solutions than problems! These problems mentioned above, Markdown can be a good solution, then we work together to understand it under the bar.

Second, what is the Markdown

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 is the most popular writing "markup language", its simple syntax instead of typesetting, and unlike most word processing software Word we use a lot of layout, font settings. It allows us to focus more on code words, use the "mark" syntax, instead of common typesetting format .

Currently, support for Markdown syntax editor, platform, there are a lot of tools, such as: CSDN, Jane books, GitLab, and some also support the export and import Markdown, a common format, are very convenient and efficient.

advantage

  • Focus your text instead of typography, ease of writing.
  • Easily export HTML, PDF and .md file itself.
  • Plain text content, compatible with all text editors and word processing software.
  • To modify your article version, do not like the word processing software to generate a number of file versions lead to confusion.
  • Readable, intuitive, low-cost learning.

Misunderstanding

We believe that writing is about content, about what you want to say – not about fancy formatting.

We firmly believe that writing is to write content, are thinking, rather than the pattern format.

Markdown is intended to simple, efficient, and because Markdown legible and easy to write, people to achieve multiple versions of parsers and generators with different programming languages, which led to the current different Markdown tool integrates different functions (base function about the same), such as a flow chart and timing diagram, complex tables and complex formulas presented, although the feature is rich and there is no disadvantage of nature, but after all, some departure from the original intention, not to mention in the preparation of a fee of God, it is better to use a professional tools to write more efficient, so if you need to implement complex functions, professional graphical interface tool will be more convenient. Of course, if you bring the high-end features to toss these different client Markdown customized to feel pleasure, then it is understandable.

Three, Markdown syntax

Here are the most common Markdown syntax, including syntax description, the effect shows. Among them, the same kind of effect may have a variety of writing, first as a standard syntax, different Markdown editor, will support different special syntax, and there are subtle differences in the display of results.

1 title

Use #tag indicates the title, #there must be a space between and title. A title using a #secondary title two ##, and so on, a total of six titles.

The syntax is as follows:

# 标题H1
## 标题H2
### 标题H3
#### 标题H4
##### 标题H5
###### 标题H6

Results are as follows:
Here Insert Picture Description

2, the character effect

  • Strikethrough: use ~~删除线~~or <s>删除线</s>tags
  • Italics: Use *斜体字*or _斜体字_label
  • In bold: use **粗体字**or __粗体字__tags
  • Superscript: Use X<sub>2</sub>labels
  • Subscript: use O<sup>2</sup>labels
  • Abbreviations: Use abbr tag in HTML, such as: HTML

The syntax is as follows:

~~删除线1~~ <s>删除线2</s>  
*斜体字1* _斜体字2_  
**粗体字1** __粗体字2__  
X<sub>2</sub>  
O<sup>2</sup>  
The <abbr title="Hyper Text Markup Language">HTML</abbr> specification is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.

Results are as follows:
Here Insert Picture Description

3, reference

Use >tag represents a reference, >>the tag which then represents a reference layer of a reference set, and so on.

The syntax is as follows:

>这是一级引用文本内容  
>>这是二级引用文本内容  
>>>这是三级引用文本内容

Results are as follows:
Here Insert Picture Description

4, code highlighting

Block:

Using three consecutive `tag surrounded.

The syntax is as follows:
Here Insert Picture Description
the effect is as follows:
Here Insert Picture Description

Line of code inside:

Tag indicates the use of `` inline code.

The syntax is as follows:

执行命令:`npm install marked`

Results are as follows:
Here Insert Picture Description

5. Links

Use [](link)the label indicates a link. Among them, []the content within the text that you want to add a link, linkfor the link address.

The syntax is as follows:

[普通链接](https://blog.csdn.net/xcbeyond)  
[普通链接带标题](https://blog.csdn.net/xcbeyond "普通链接带标题")  
直接链接:<https://blog.csdn.net/xcbeyond>

Results are as follows:
Here Insert Picture Description

6 pictures

Use ![Alt text](/path/to/img.jpg)the tab to import pictures. Among them, Alt textit is the text that is displayed if the images do not show /path/to/img.jpga picture where the path.

The syntax is as follows:

![](https://www.mdeditor.com/images/logos/markdown.png)

Results are as follows:
Here Insert Picture Description

7. List

List is divided into an ordered list, unordered list, as follows:

  • Ordered list: the use of 1. 2. 3.labels, where .followed by a space.
  • Unordered list: Use *or -or +label representation.

Ordered list:

The syntax is as follows:

1. 第一行
2. 第二行
3. 第三行

Results are as follows:
Here Insert Picture Description
unordered list:

The syntax is as follows:

+ 列表一
+ 列表二
    + 列表二-1
    + 列表二-2
    + 列表二-3
* 列表三
    * 列表三-1
    * 列表三-2
    * 列表三-3

Results are as follows:
Here Insert Picture Description

8, the dividing line

使用---***或者* * *标签表示水平分割线,其中大于三个。

语法如下:

---
***
* * *

效果如下:
Here Insert Picture Description

9、表格

语法如下:

| Heading | Heading | Heading |
| ------- | ------- | ------- |
|   Cell  |   Cell  |   Cell  |
|   Cell  |   Cell  |   Cell  |

| Heading | Heading | Heading |
| :----- | :----: | ------: |
| 左对齐 | 居中 | 右对齐 |
| 左对齐 | 居中 | 右对齐 |

效果如下:
Here Insert Picture Description

10、流程图

流程图常用的有一般流程图、序列图,不同Markdown编辑器,语法也是不同的。如下分别说明了其中一种写法,其他写法可自行具体查阅相关资料。

(注:个别编辑器可能无法正常显示效果。)

流程图:

语法如下:
Here Insert Picture Description

效果如下:
Here Insert Picture Description

序列图:
语法如下:
Here Insert Picture Description
效果如下:
Here Insert Picture Description

四、Markdown常用编辑器及工具

如何更好的使用Markdown,工具必不可少,在此介绍我用过的几款工具,分享给大家,以满足不同使用场景。

1、MarkdownPad2

MarkdownPad2是一个windows上的Markdown编辑器,需下载安装,便于离线使用,如下图所示。

官方地址:http://markdownpad.com/
Here Insert Picture Description

2、Mou

Mou是Mac上的Markdown编辑器,两栏界面,直观清爽,功能简洁到位,而且免费,如小图所示。

不仅如此,Mou还有一些有趣的偏好设置(Preference),例如主题(Themes)与样式(CSS),它们可以配置出定制化的文本编辑效果与导出效果,如果你对自带的主题与样式不满意还可以到 GitHub上搜索其它爱好者为Mou编写的更多主题样式,导入的方式可以在偏好设置的Themes或CSS选项中选择reload。

官方地址:http://25.io/mou/
Here Insert Picture Description

3、MdEditor

mdeditor是一个在线编辑markdown的工具,无需本地安装,在线随时编辑、直接预览、随时导出,还提供对应标签的图标快捷操作,如下图所示。

在线编辑完后,可导出保存到本地.md文件即可。

官方地址:https://www.mdeditor.com/
Here Insert Picture Description

4、coolaf md

I tentatively called it coolaf md, it is an online Markdown editor, a tool to export a variety of formats, support export documents Word, HTML, PDF format, very easy to use, it is strongly recommended, as shown below.

Official Address: http://coolaf.com/tool/md
Here Insert Picture Description

5, Md2All

Md2All is an online Markdown editor, copy and paste convenient, one-button layout, custom CSS, 80 Duozhong code highlighting all styles perfectly rendered, including picture and word program is also supported. Without any adjustments can copy a key to the public micro-channel number, blog Park, Denver, almost known, csdn, 51cto other platforms, as shown below.

Official Address: http://md.aclickall.com/
Here Insert Picture Description


Reference article:

  1. https://zhuanlan.zhihu.com/p/92312642
  2. https://www.jianshu.com/p/1e402922ee32
  3. http://markdownpad.com/
  4. http://25.io/mou/
Published 137 original articles · won praise 446 · views 520 000 +

Guess you like

Origin blog.csdn.net/xcbeyond/article/details/104303577