Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make simple Analysis of Markdown

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you how to carry out Markdown simple analysis, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Markdown is a markup language that can be written using a plain text editor. Through a markup syntax similar to HTML, it can make plain text content have a certain format.

Markdown's grammar is concise, easy to learn, and more powerful than plain text, so many people use it to write blogs. WordPress, the most popular blog platform in the world, and large CMS such as Joomla and Drupal can support Markdown very well. Blogging platforms that fully adopt Markdown editors are Ghost and Typecho.

Posted a paragraph of Baidu know about the introduction of Markdown. These two days just contact with Markdown, found that to write a blog to save a lot of typesetting time, the learning curve is not steep, it is easy to start, and some websites such as CSDN and brochures also support the direct use of Markdown in web (unfortunately, 51cto has not yet supported). Here is a look at the basic usage of Markdown, and you will find that you can master the technique of "typesetting as soon as you finish" in minutes.

1. Markdown editor

There are many kinds of editors for Markdown. For a more comprehensive list of editors, please refer to here. Readers can choose the one they think is more convenient, and the advantage of using the editor is that they can view the corresponding format while writing. Markdown Pad is recommended on Windows systems. The so-called "write while checking the corresponding format" is shown in figure-1:

Figure-1 Markdown Pad

two。 Grammar

With the editor, learn some simple syntax of Markdown, writing + typesetting, so easy~ lists some very commonly used Markdown syntax:

2.1 title

There are six levels of headings in Markdown, corresponding to the ~ in HTML:

# level 1 title # # level 2 title # level 3 title # level 4 title # level 5 title # level 6 title 2.2 link

Declare a link as follows:

[link text description] (link URL "Link TITLE")

Where Link TITLE is optional and is used to display prompt text when the mouse hovers over the connection. After generation, the corresponding HTML code is:

Link text description 2.3 Picture

Declare a picture as follows:

! [description of failed loading of picture] (picture URL)

It is not difficult to see that the difference between a picture and a link lies in whether it is in front of []. After generation, the corresponding HTML code is:

图片加载失败时的描述信息

The URL of the image here cannot use the local path. You need the URL on the Internet. You may need to use some graphics bed tools to upload the local image and get the URL of the picture.

2.4 split Lin

Three * can draw a gorgeous dividing line, of course * do not follow other content, just change the line:

I am the content above the dividing line * what do you see? I bold 2.5 and italic 2.5.1 below.

Text surrounded by * * will be shown in bold:

* * who can be thicker than me * *

Equivalent to

Who can be thicker than me by 2.5.2 italics

Text surrounded by * will be shown in italics:

* who can be more inclined than me *

Equivalent to

Who can tilt 2.6 list 2.6.1 ordered list than me?

Add half a corner to Arabic numerals. You can create an ordered list. There should be a space between the text and the text:

1. First of all, my God. Secondly, crying and messing with 3. Once again, cute 4. Finally, have sex.

One thing to note here is that no matter which Arabic numeral begins, the ordered list will eventually be displayed from 1. 5%. In the beginning, no matter what number is sorted afterwards, the presentation will be in the following order: 1.-- > 2.-- > 3. Murray-- >..., because its corresponding HTML code is

That is:

3. First of all, I want to start with 3. Secondly, I don't want to number 9 in order. Finally, you can make up as much as you want # and finally show it: 1. First of all, I want to start with 3. Secondly, I don't want to number 3 in order. Finally, you can make it up as you want.

Of course, this is only for understanding, we just have to put it down in order.

2.6.2 unordered list

Start with an underscore-and enter the text after the space to build an unordered list:

-it is difficult to bid farewell to the Qiu River.-the voices of apes on both sides of the strait are still ringing in my ears.-Ercao's body and name are gone.-the city is full of gold armor 2.7 code.

Programmers / engineers / shit will inevitably introduce a piece of code or two to install it when they write something. Take a look at how this B installs:

2.7.1 single line of code

The part wrapped with ``(the symbol is in the same key position as the wavy line) will be displayed in a single line of code:

`print "Hello, World" `2.7.2 code block

You can use three consecutive ~ package codes:

~ ~

Haven't you seen the Chinese code? Make you grow into a long posture

~ ~

Alternatively, you can create code blocks directly using the TAB key, which readers can try out for themselves.

2.8 referenc

At the top, the content borrowed from Baidu is a citation. It is very easy to use the citation. You only need to use >:

Here is plagiarism. Sorry, I drank too much. This is obviously the original 2.9 form.

You can use tables in Markdown, but the tables are not supported by Markdown standard syntax. You need to open additional interpretation modes in the editor to recognize them. Create a table with four rows and three columns:

| | name | gender | occupation | |:-- |: |-- | Zhang San | male | ape man | | Lisi | female | Yuanren | | Wang Wu | unknown | CEO |

Among them, the first row specifies the header, and the content of the header will be bold; the second row specifies how to align each column:-align to the left,:--: align to the center, -: align to the right, and the number of-- does not affect the output. Readers can try it for themselves. The rest of the ordinary data rows are separated by columns, and the final display effect is as follows:

There are basically so many formats commonly used in Markdown. I believe readers can easily master it after reading this article and adding their own practice. Markdown supports directly using HTML and CSS to adjust font size, color and other attributes when editing. Readers can try what style the following text will be interpreted as:

# add

Of course, for non-professionals, the default style of Markdown is basically sufficient, and too much nesting of your own style is easy to reduce readability. In addition, many styles of Markdown can be written in more than one way. For example, the code blocks mentioned in 2.2.7 can be written in two ways. For example, unordered lists can not only use -, but also use * or +. For example, links can be divided into inline form and reference form.

On how to carry out simple Markdown analysis to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report