Author: JackTian wechat official account: jack’s IT journey (ID: Jake_Internet)

Why study Markdown? What’s the point?

What is Markdown?

Markdown is a lightweight markup language founded by John Gruber. It allows people to write documents in plain text format that is easy to read and write. It can export documents in various formats such as HTML, Word, images, PDF, Epub, etc. Document suffixes are.md,.markdown.

Markdown is the most popular writing language on the Internet. It uses the simple symbol # * / > [] ()\ to mark up text. The syntax is very simple. In addition, there are many beautiful formats to choose from.

2. Why study Markdown?

Since the operation of the public number, at the beginning of that, I are through the public number background editor of the article. There must be a lot of readers here, do not know the public account background is how to edit the article, for you to see, see the following figure.

Public background editing articles, not only the output at the same time, also want to adjust the font size, bold, alignment, indentation and so on a series of operations, has just started to push out the articles, typesetting overall feel is not very beautiful, then slowly contact with the leaders of the industry learned their experience, improve slowly, gradually turned to the markdown editor, The typesetting format has also been recognized by readers.

After a period of research, Markdown editor can not only help the public account layout, but also for other documents, make their articles more structured, the overall layout is better. I believe that Markdown is a great skill to learn and master as long as you enjoy recording and output, good platform extensibility, and focus on the writing itself rather than the format.

The Markdown editor tool

  • Platform article editor: Brief book, CSDN, etc.
  • Notable local apps: MarkText, Typora, Notable, vnote, etc.
  • Web APP: MD2All, Mdeditor, etc.

4. What are the characteristics of Markdown?

  • A key to create
  • Support mainstream syntax
  • Support for inserting pictures
  • Supports multiple modes switching
  • Cross-platform synchronization
  • Demo mode

The basic syntax of Markdown

Markdown title

Use the # sign to represent level 1-6 headings, with one # sign for level 1 headings, two # signs for level 2 headings, and so on.

# 1 title # # 2 headlines # # # # # # # 3 4 headlines # # # # # # # 5 # # # # six levels of headingsCopy the code

The font

Italic text: You can enter an asterisk * or an underscore _ before and at the end of italic text that you want to annotate

Bold text: You can enter two asterisks (**) or two underscores (__) before and at the end of bold text that you want to annotate

Bold and italic text: You can enter three asterisks *** or three underscores ___ before and at the end of the bold and italic text that you want to annotate

* * _ _ * * italic text italic text bold text bold text (* * * * * * * * bold italic text ___ ___ bold italic textCopy the code

Dividing line

Create a delimiter on a line with three (or more) asterisks, minus signs, and bottom lines. No other text can be printed on the delimiter line. You can also insert Spaces between the asterisks or minus signs.

***** * ***** --Copy the code

Delete the line

If a paragraph requires a deletion line, add two wavy lines at the beginning and end of the text

~~ This line has been deleted ~~Copy the code

This line of text has been deleted

The underline

If the text in a paragraph needs to be underlined, add text at the beginning and end of the text to be underlined

<u> This line of text has been underlined </u>Copy the code

This line of text has been underlined

footnotes

A footnote is a note to a text.

print ^Hello World

[^Hello World]

The list of

Markdown supports both ordered and unordered lists.

An unordered list is marked with an asterisk (*), plus (+), or minus (-).

Ordered lists use numbers and are marked with.signs;

* First + Second - Third 1. Fourth 2. Fifth 3Copy the code

Nested list

List nesting requires adding four Spaces to the options in the sublist

1. First - first list nesting 2. Second - second list nestingCopy the code
  1. The first
  • The first list is nested
  1. The second
  • The second list is nested

reference

A Markdown reference begins the paragraph with a >, followed by a space, or no space.

< span style = "box-width: border-box; color: RGB (74, 74, 74); font-size: 14px! Important; white-space: normal;"Copy the code

This is a quote from the author: JackTian wechat public account: jack’s IT journey (ID: Jake_Internet)

In addition to the above references, you can also nest, with one > symbol at the first level, two > symbols at the first level, and so on.

> > This is a quote > > author: JackTian > > > wechat public account: Jack's IT Journey (ID: Jake_Internet)Copy the code

This is a quote

Author: JackTian

Wechat Official Account: Jack’s IT Journey (ID: Jake_Internet)

Use lists in references

> List of references > * This is a reference > - author: JackTian > 1. Wechat Official Account: Jack's IT Journey (ID: Jake_Internet)Copy the code

A list of references

  • This is a quote

  • Author: JackTian

  1. Wechat Official Account: Jack’s IT Journey (ID: Jake_Internet)

Use references in lists

To use a reference in a list, indent the > by four Spaces.

1 > This is a reference > author: JackTian > wechat official account: Jack's IT Journey (ID: Jake_Internet) - list using reference 2Copy the code
  • Use reference 1 in the list

    This is a quote from the author: JackTian wechat public account: jack’s IT journey (ID: Jake_Internet)

  • Use reference 2 in the list

code

Markdown’s syntax for code blocks is to add both the beginning and end lines: ‘ ‘, where ‘is in the upper left corner of the Windows keyboard, specifying precisely the language (e.g. Java, CPP, CSS, XML, javascript, Python, PHP, go, kotlin, Lua, objectivec, and so on)

#! /bin/bash . /etc/init.d/functions for var in {11.. 59}; Do IP =172.16.1.$var ping -c2 $IP >/dev/null 2>&1 if [$? = 0]; then action "$ip" /bin/true else action "$ip" /bin/false fi donCopy the code

link

Link syntax format:

[link name](link address) or < link address >Copy the code
[Linux environment of actual combat Rsync backup tool and configuration Rsync + way real-time synchronization] (https://mp.weixin.qq.com/s/P8XDrr7ROIXBYOZnLy45zA), or <https://mp.weixin.qq.com/s/P8XDrr7ROIXBYOZnLy45zA>Copy the code

In addition, links can be replaced by variables.

This link uses the Rsync backup tool as a url variable and configures Rsync +inotify real-time synchronization in a Linux environment

In RHEL 6, DHCP+TFTP+FTP+PXE+Kickstart implements unattended installation

The end variable address is as follows:

Rsync +inotify real-time synchronization: DHCP under https://mp.weixin.qq.com/s/P8XDrr7ROIXBYOZnLy45zA [RHEL 6 + TFTP + FTP + PXE + Kickstart realizing unattended installation] : https://mp.weixin.qq.com/s/YcPnTT74HfturmINeDvCeACopy the code

The picture

Image syntax format:

! [Image description](image address)! [Image description](Image address "Optional Title ")Copy the code

In addition, image urls use variables

This link uses WeChat as the url variable WeChat.

Variable assignment:

[WeChat]:https://mmbiz.qpic.cn/mmbiz_png/nDMNE6lrvW5vhBgOCoUxyvxibYqeibicjWyFzjVIY8fEWVslGUcwPxicOggBCt0Os7ib7KYzqwNLS3s IAmGMxQRlibjg/0?wx_fmt=pngCopy the code

It is not possible to adjust the height and width of an image in the Markdown editor; use the normal tag if necessary.

<img src="https://mmbiz.qpic.cn/mmbiz_png/nDMNE6lrvW5vhBgOCoUxyvxibYqeibicjWyFzjVIY8fEWVslGUcwPxicOggBCt0Os7ib7KYzqwNLS3sIAmG MxQRlibjg/0?wx_fmt=png" width="50%">Copy the code

form

Make table use | to separate different cell, use – to separate header and other lines.

Table syntax format:

| | | header header header | | -- - | -- - | -- - | | | | | cell cell cell | | | | cell cell cellCopy the code

Note: When the table is previewed on the official account, it may not be displayed in the correct full screen on the PC, but it will normally be displayed in full screen when it is previewed on the mobile phone.

If you want to adjust the left, right or center alignment of the table, you can do so as follows;

:- : Aligns table headers and cell contents to the left; -: : Aligns table headers and cell contents to the left; :-: : Centers the header and cell contents;

| 1 | 2 | 3 | meter meter header header 4 | | : - | : - : | : -- -- -- -- -- : : | -- - | | | cell 1 cell 4 | 2 | 3 | cell cell 1 | | cell cell 4 | 2 | 3 | cell cellCopy the code

Support for HTML elements

< KBD > < I >

< KBD >Ctrl
+< KBD >C
copy text HTML elements. You can do this in combination with the Mdeditor editor platform.

Copy the text using < KBD >Ctrl</ KBD >+< KBD >C</ KBD >Copy the code

escape

There are many special symbols used in the Markdown editor to indicate certain meanings, and these special symbols are no longer displayed. If you want these special characters to appear, you need to escape them. The Markdown editor can escape them by using a backslash.

Escape special character format:

The \*\* escape special symbol shows \*\* normallyCopy the code

Scientific formula

When you need to insert a mathematical formula into the Markdown editor, you can do so by wrapping a mathematical formula in TeX or LaTeX format with two dollar signs, $$.

$$E=mc^2$$
$$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$
Copy the code

Multi-line formula

Horizontal flow chart

It is impossible to make flow charts in THE MD2ALL editor. You can create a MD file on the YOUdao Cloud Notebook PC and open the source code mode for editing and viewing the effect.

Graph LR (general manager) -- - > B (technology) - > B C {development/test/ops} C - > | development | D [1] developers C - > | E | testing department testing [1] C - > | operations department | F [ops person 1] G/transverse flow chartCopy the code

Vertical flow chart

Graph of TD (general manager) -- - > B (technology) - > B C {development/test/ops} C - > D [1] developers C - > E testing [1] -- > C F [ops person 1] G/vertical flow chartCopy the code

Standard flow chart

St =>start: user login op=>operation: login operation cond=>condition: login succeeded Yes or No? St ->op->cond cond(yes)->e cond(no)->opCopy the code

Standard Flow chart (horizontal)

St =>start: user login op=>operation: login operation cond=>condition: login succeeded (Yes or No?) Sub1 =>subroutine: Log in to IO again => InputOutput: start operation background e=>end: St (right)-> OP (right)->cond cond(yes)-> IO (bottom)->e cond(no)-> Sub1 (right)->opCopy the code

UML sequence diagrams

A-> C: Hello, C! Note left of friend A: A funny conversation friend C- > friend A: Hi, friend A! Friend A-> Friend B: Good night! Friend B--> Friend A: Good night! C-> friend B: How are you? B--> C: Fine, thank you!Copy the code

UML complex sequence diagrams

This is A complex UML sequence diagram friend A-> Friend C: Hello, friend C! Note right of friend C: Friend C description Note left of friend A: Friend A description (prompt) Friend C- > friend A: Hi, friend A! (Response) Friend B-> Mistress: Mistress, are you ok? Mistress -->> Friend A: Friend B, called me today and asked me how I was? Friend A-> Friend B: So what did you say to the mistress? B: Long time no see. We are still good friends. D: See you? D: See you?Copy the code

In addition to the horizontal flow chart, vertical flow chart, standard flow chart, standard flow chart (horizontal), UML timing diagram, UML complex timing diagram, there are ALSO UML standard timing diagram, Gantt diagram, and so on.

6. Which platforms can Markdown write articles on?

In the third title above a brief introduction of several platform article editor, local APP, Web APP, combined with my own situation, is now using the MD2ALL editor to write articles, just a few simple special characters to complete, will not make the overall article flashy.

You can also choose what suits you according to your own needs. You are also welcome to comment on what Markdown editor tool you use to write your articles.

Vii. How to combine the articles written by Markdown with the public account platform?

The official account editor is a rich text editor with basic styles and does not support editing text directly with Markdown syntax.

My personal is written through the MD2ALL editor, and then copy and paste into the public account, all the style rendering is very perfect, including the image loading and so on, and the format will not change very messy.

Renderings before copying:

Copy to the public editor after the effect:


It is not easy to be original, if you feel this article is a little useful to you, click a like, leave a message, forward support, thank you!

Finally, welcome to follow my wechat public account: Jack’s IT Journey