Home  >  Article  >  Web Front-end  >  markdown basics

markdown basics

巴扎黑
巴扎黑Original
2017-06-27 09:05:301533browse

Introduction:

Markdown is a markup language that can be written using an ordinary text compiler. Through simple markup syntax, it can make ordinary text have a certain format. To put it simply, markdown is actually a kind of simple text. Different from ordinary text files (txt files), it supports some special symbols, uses special symbols to express different semantics, and gives different styles. The suffix of ordinary text files is .txt, and the suffix of markdown files is .md.

Purpose and features:

The purpose of markdown is: easy to read and write. It is convenient for writing and reading, and some basic styles are implemented through special symbols, and different symbols also represent different semantics. At the same time, markdown files can also be compatible with some html tags, making markdown writing more widely applicable.

In markdown files, some special characters will be converted, so if you want to output some special characters in markdown, you need to use entity characters to output. For example: if you want to output ©, you must use entity characters. ()

Common markdown syntax:

Title: There are six levels of headings in markdown, the first level is a # sign, the second level is ##, and so on.

Block reference: In markdown, if you want to express a block reference, you can use > to express it. Similarly, our quotation can also be multi-line. You can press Enter after the > line, and then continue to write the quotation content. Of course, other markdown syntax can also be used in block references.
List:

1. Ordered list: To implement an ordered list in markdown, you can use numbers and English dots in front of each option.

2. Unordered list: If you want to implement an unordered list in markdown, you can add *, the latter + or - before each option.

Block code:

In markdown, you can use pre and code tags to wrap code blocks so that they can be displayed in the formatted style. Create a code block in markdown: indent four spaces or one tab (press the tab key)

Separating line:

You can use more than three *( in one line Asterisk), - (minus sign), and underscore to create a dividing line. There cannot be other content in the line, but spaces can be inserted in it.

Link:

Firstly, use [] to indicate the name of the link when connecting text, and the URL of the link is expressed in (). [Link name] (Link URL)

Emphasis:

can be represented by an asterisk (*) or underline (—) in markdown. If you use two asterisks or two underlines, the font will be bolder and the emphasis will be higher.

Code:

If you want to represent code within the document content, you can use backticks (``) to wrap the content.

Picture:

Add picture format:! [Alternative text when the image fails to load] (image address "Prompt text of the image")

The role of backslashes:

In markdown, if you want to output some special characters, you can Use \escape.

The above is the detailed content of markdown basics. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn