[Turn] README.md syntax summary

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https: //blog.csdn.net/guodongxiaren/article/details/23690801
reproduced Please keep the original author guodongxiaren the original address:

http://blog.csdn.net/guodongxiaren/article/details/23690801

This article demonstrates the address on GitHub:

https://github.com/guodongxiaren/README

--------------------------------------------------------------------

Since the beginning of play GitHub, feel it more and more love. Recently its README.md file is quite interested. I wrote this post, will not help more students to write README file.

README file suffix md. md is the abbreviation of markdown, markdown is an editing blog language. We are used to visualize the blog editor (such as CSDN blog, embarrassing), this programmatic blog editing program really brighten. But GitHub supports syntax on top of the standard markdown syntax has been modified, called Github Flavored Markdown, referred GFM. GFW is not it.

————————————————————————————

I am for this article built a warehouse on GitHub "README", for everyone to look at the code that is specific effects: README

This warehouse README file continuously updated, new knowledge may not update to the blog post. First is strongly recommended that one, do not use 360 ​​or GitHub Sogou browser to access the site, you will find a lot of buttons on the website are not available at this time. . We recommend using Firefox or Google browser to access GitHub

————————————————————————————

Start editing README
open one of your GitHub project, we can directly edit your online README file, if you already have this file, click on it directly in the file directory, if you do not have this file then right click the project name a button to add a new file:

 

Then you open the edit page, top left corner of the editing area is an area to fill in the file name, the suffix attention .md

 

If you do have this file to re-edit it, then click on the file in the file directory, there is a toolbar at the top, select Edit

 

Then scroll to the next, if there is a new file Commit new file button, if no content is not clicked. If the old file is rebuilt to edit, then this button displays the Commit changes

 

// If this is the way Tucao a 360 or Sogou browser, then this button is not always clicked, embarrassing. .

First just write something to submit this new file, and then click Edit to reopen it. You will find the top left corner has changed the editing area.

 

Selected by default Code, which we edit mode. If you click Preview (Preview) can be displayed in real time the effect of the current display.

Well, here we started to edit this file

 

About the title
at the beginning of norms README files are written on a title, which is called the headlines.

Headline
====
In the text below plus equal sign =, the text above it becomes a headline. Unlimited number equal to the number, but must be greater than 0, oh. .
Lower level than the headline is the title, which is displayed than the headline dots.

Titled
-------
In the following text underlined -, then the top of the text becomes the title, the same number underlined unlimited.

In addition, you will find large, there is a horizontal line below the title, yes this is the = and - shows the result.

If you enter only the equal sign =, but no text above it, then it will only show a straight line. If you have text above, but you only want to display a horizontal line, rather than trying to escape into large title text at the top, then you will be in equal numbers and text = directly fill a blank line.

Fill empty line: It is very common usage, up and down when you do not want two different layouts staggered together when necessary between the two layouts fill a blank line.

If you enter only the dash (minus) -, no text above it, then you want to display a straight line, a minus sign must write three more. However, with the equal number of different display, which is displayed when the broken line instead of a solid line. The same role with the minus sign and there is an asterisk * underscore _ the same symbol both of which have to write three or more to display a virtual horizontal line.

In addition, the level of representation on the title as well, is divided into six levels, reduce the size of the text displayed in the order. It is the number # (pound) to identify the different levels. A title has a #, # subheadings have two, and so on.

A title #
## subheadings
### title three
#### title four
##### title five
###### six title
Note # (pound) title and name to a line side by side writing , as shown in display:


Indeed, previously described title and a title, respectively, and the corresponding headings and subheadings. I.e., title and a size the same title, the same title and subheadings size.

Display text


Normal text
text direct input is normal text. Note that when not want to change the line directly to the transport line feed, use <br> (or a). That is, inside the html tag. In fact, markdown support some html tags, you can try. Of course, if you use html to completely write the words, the meaning is lost, after all markdown is not designed to do the front, but generally only achieve the effect, then it would be too simple to write a lot more friends than html.

This is a plain text
directly enter not wrap, <br>
to use \ <br>
<br> attention to the third line preceded by a backslash \. Like other languages, as the purpose is to achieve escape, that is, <escape.
The effect is as:

 

In addition, to display a hyperlink, then directly enter the URL of the link just fine. It displayed automatically becomes a link of the form.

Show spaces of small Tip
The default text of the line spaces are ignored, but if you want a space to row about the version, then how to do it, there is little skill, that is to your input method by the half-width into full-on OK La.
Single line of text
using the two-line text Tab operator implementation.

Hello, Hello, everyone, I am a fruit Dong Xiaren.
Note that there are two front Tab. GitHub single line of text on the display as shown:


Multi-line text
multi-line text and single-line text similar to, as long as the start of each line plus two Tab

Welcome to visit
Glad to meet you
I wish you, good morning, good afternoon, good afternoon, good night

 

Part highlighted text
if you want to make part of the text highlighting a passage in the display to highlight the role played, you can enclose it with ``. Note that this is not a single quote, but Tab above, the left button number 1 (note English input method).

Thank `You` . Please `Call` Me `Coder`

 

Text hyperlink
to a text hyperlinks format is [Text to display] this (link address). such as:

[My blog] (http://blog.csdn.net/guodongxiaren)
display:

You can also give him a plus hover text display.

[My blog] (http://blog.csdn.net/guodongxiaren "hover display")
that is enclosed in double quotes in a string after the URL. Also note here is the double quotation marks.


Caret
dot character
that is a dot character
It is also a symbol dot
dot above paragraph is a bulleted list CSDN blog editor inside. Often used when writing articles listed entries. Also supports the use of the dot operator syntax in markdown GitHub's. Used when editing an asterisk *

* Nickname: fruit Dong Xiaren
* Alias: next door Pharaoh
* English name: Jelly
should be noted that an asterisk * have a space behind. Otherwise, it appears as a normal asterisk. Display as shown above:


There are also two dots and three dots. Is one more Tab.

* Programming languages
* scripting language
* Python
second row a Tab, the third line two Tab. This is even more clear hierarchy used to represent it, to see the effect:


If you feel that the structure of three is not enough to express clearly, we can try to change a form, please see the characters surrounded

 

Indent
indent meaning is easy to understand. .

> Data Structure
>> tree
>>> binary
>>>> balanced binary tree
>>>>> full binary
display:

Of course, a more general usage than this is the case. The effect can often see in books which, like others quoted in the article. Direct to see results.

 

 

This particular "indent" usage. They all explore it.

Insert Picture


Pictures from the network


There are many online tutorials README insert a picture, and test it by myself many times, you can find the easiest to use, most basic syntax is:

! [] (http://www.baidu.com/img/bdlogo.gif)
that is an exclamation point! + square brackets [] + brackets () which is the exclamation point in the image URL.

If you do not add an exclamation point!, It will become a plain text baidu.

In square brackets can add some of the identification information, such as

! [baidu] (http://www.baidu.com/img/bdlogo.gif)
The square brackets baidu will not cause any changes to the image display, if you want to reach hover display a message, you can modeled on the method described earlier in the text, it is this:

! [baidu] (http://www.baidu.com/img/bdlogo.gif "Baidu logo")
behind the URL, plus a character string enclosed by double quotation marks, as shown in display:

 


GitHub warehouse pictures
Sometimes we want to display a GitHub repository (or project) in the picture rather than a picture network other sources, other sources because the URL is likely to fail. So how to display a GitHub project in the pictures?

In fact, consistent with the above format, the difference is in parentheses URL how to write.

    https://github.com/ your username / name of your project / raw / branch name / picture storage folder / folder under the picture

So clear it. such as:

! [] (https://github.com/guodongxiaren/ImageCache/raw/master/Logo/foryou.gif)
my username guodongxiaren on the GitHub; there is a project ImageCache; raw data represents the original meaning of it, do not bother it; the main branch master; there is a project folder Logo; there is a picture foryou.gif folder under Logo


Plus a hyperlink to the picture
if you want to make pictures with hyperlinks function, that is to click on a picture to a specified web page. You can write:

[! [baidu]] (http://baidu.com)
[baidu]: HTTP: //www.baidu.com/img/bdlogo.gif "Baidu Logo"
These two previous wording quite different, but also easy to imitate write, it does not introduce too much. Just pay attention to the context of baidu is the name that identifies your own plays, are free, but must ensure that the identification up and down two rows of the same.
Click on the picture so that we can achieve the functionality of the site.


Inserting code fragments
we need numeral `in line and the next line of code. `Single quotes than three, but the number 1 on the left, Tab key top key. To achieve syntax highlighting as long as you can add your programming language after `` `(ignore case). c ++ language can also be written in c ++ cpp. Look at the code:

 

The actual display

 

[Digression] on GitHub Gist diary with it
read so many markdown syntax, you must be satisfied with merely writing a README file, and want to try to start the actual use markdown syntax to write articles or blog it. Indeed, the Internet is also relying on support markdown syntax or blog. But then, it is more convenient, you can make use of a feature of --Gist GitHub itself.

Gist is a file as a unit, not to the project as a unit. And unlike the ordinary GitHub to build warehouses, Gist is a private, oh. Common projects are public by default, to also pay seemingly inflicted private way. Since it is private so used to write diary, it is excellent.

GitHub top of the page are:

 

Point into:

 

That's what you can edit the private document, which not only supports Text text, but also supports a variety of programming languages ​​too! Of course, including markdown. Enter the file name:

 

Last saved, select Create Secret Gist is private myself.


----------------
Disclaimer: This article is CSDN blogger "Dong Xiaren fruit" in the original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source and this link statement.
Original link: https: //blog.csdn.net/guodongxiaren/article/details/23690801

Guess you like

Origin www.cnblogs.com/Sherlock09/p/11910222.html