Giter Club home page Giter Club logo

github-flavored-markdown's Introduction

GitHub上项目README.md文件编写常用语法介绍

README使用的是GitHub Flavored Markdown,是markdowm语法的扩展。简称GFM。

GitHub Guides

Markdown中文文档

Markdown英文文档

Mac端 Markdown 编辑器

以下介绍了GFM常用语法写法以及效果展示。

目录

横线

横线 写法
1 ***
2 ---
3 ___

效果依次为(没多大区别)




标题

标题 写法
一级标题 # XXX
二级标题 ## XXX
三级标题 ### XXX
四级标题 #### XXX
五级标题 ##### XXX
六级标题 ###### XXX

效果如下

XXX

XXX

XXX

XXX

XXX
XXX

文本

文本 写法 效果
普通文本 文本 hello world
单行文本 (tab或4空格)+文本 见下面效果
文本块1 每行(tab或4空格)+文本 见下面效果
文本块2 用 ``` 把文本包起来 见下面效果
文字高亮 用`把文字包起来 见下面效果
换行 文本间加两个空格或者空行 见下面效果
斜体1 *hello* hello
斜体2 _hello_ hello
粗体1 **hello** hello
粗体2 __hello__ hello
删除线 ~~hello~~ hello
斜粗体1 ***hello*** hello
斜粗体2 ___hello___ hello
斜粗体删除线1 ***~~hello~~*** hello
斜粗体删除线2 ~~***hello***~~ hello

效果如下

  • 普通文本

hello world

  • 单行文本

    hello world

  • 文本块1

    hello ! welcome to beijing.

  • 文本块2

hello !
welcome to beijing.

  • 文字高亮

3333 hello 你好

  • 换行

hello
world

图片

图片 写法
1 ![image](URL title)

效果

image

链接

链接 写法 效果 备注
外部链接 [百度一下](https://www.baidu.com/) 百度一下 --
项目内文件链接 [README](./README.md) README --
文件内锚点链接(中文) [返回顶部](#目录) 返回顶部 --
文件内锚点链接(英文) [返回底部](#bottom-out) 返回底部 标题大写用小写代替,空格用-代替

列表

无序列表
写法
- 小明
- 小红
- 小刚
效果
  • 小明
  • 小红
  • 小刚
多行无序列表
写法
- 第一章
  - 第一节
    - 第一小节
  - 第二节
- 第二章
效果
  • 第一章
    • 第一节
      • 第一小节
    • 第二节
  • 第二章
有序列表
写法
1. 第一步
1. 第二步
1. 第三步

1. 第一步
2. 第二步
2. 第三步
效果
  1. 第一步
  2. 第二步
  3. 第三步
多级有序列表
写法
1. 第一步
   1. 第一小步
        1. 第一小小步
        2. 第二小小步
   2. 第二小步
1. 第二步
效果(二级罗马数字,三级英文字母)
  1. 第一步
    1. 第一小步
      1. 第一小小步
      2. 第二小小步
    2. 第二小步
  2. 第二步
复选框
写法
- [x] 任务一
- [x] 任务二
- [x] 任务三
- [ ] 任务四
- [ ] 任务五
- [ ] 任务六
效果
  • 任务一
  • 任务二
  • 任务三
  • 任务四
  • 任务五
  • 任务六

表格

写法
| 标题一  | 标题2 | 标题三 |  
| :--- | :---: | ---: |
| 左对齐  | 居中  | 右对齐 |

效果
标题1 标题2 标题三
左对齐 居中 右对齐
1324235463545675685 452334657465767856787879 dfsdfgdfhfgh

块引用

写法
> 文本
效果

I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by the content of their character.
I have a dream today!
--马丁·路德·金

代码高亮

写法

json

```json
{
"_id":"1",
"name":"小明"
}
```  

swift

```Swift
var name:String = "小明"
```
效果
    {
    "_id":"1",
    "name":"小明"
}
    var name:String = "小明"

Bottom Out

github-flavored-markdown's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.