Markdown 常用语法

引言:Markdown是一种轻量级的标记语言,轻到你甚至可以不叫他语言,因为Markdown很容易上手,就是简单地记住几个常用的标签用法就OK了,Markdown有诸多好处:专注于文字,简单,高效.

以下的符号请全部以英文输入法为准!!!

下面来详细说说那几个标签(真的只有几个):

代码(开发人员专用):

前提是输入法在英文模式下。代码写在 `这里是你要写的代码` 之间,``号(windows下)就是ESC下面的那个按键

如果是代码块,请放在六个这个符号中间,然后按Tab缩进,下面这样:

常用标题

    # 代表h1(一级标题)
    ## 代表h2(二级标题)
    ###代表h3(三级标题)

效果是这样的:

代表h1(一级标题)

代表h2(二级标题)

代表h3(三级标题)

链接(有两种写法)

第一种[text](url)

    [text](url)
    比如说:[laravist](https://laravist.com)

第二种[text][id] [id]:url


    [text][id]
    
    [id]:url

比如说:

    [laravist][1]
    
    [1]: https://laravist.com

text代表你要链接的文字,URL就是连接地址,第二种的id你可以随便定,但建议是用数字就OK,而且在段落中也推荐使用第二种方法并且把
[id]:url放在段落之后;因为链接很多时候都很长,会影响编写文档的美感。而且这样反而会更高效.以上效果是这样的:

laravist

laravist

插入图片![](image-url)

跟链接的第一种方式很像

    ![](image-url)

比如

    ![](https://laravist.com/images/jellybool.png)

效果是这样的:

加粗****

    **这是要加粗的文字**   四个星号中间就是你要加粗的内容

我觉得这一个就够了,效果:

这是要加粗的文字 四个星号中间就是你要加粗的内容

斜体**

    *这是你要斜体的文字*   两个星号中间就是要斜体的文字

也是这个就够了,效果如下:

这是你要斜体的文字 两个星号中间就是要斜体的文字

无序列表:*

    * 无序列表内容1
    * 无序列表内容2
    * 无序列表内容3
    一个星号加一个空格,注意星号与文字之间有一个空格

效果:

  • 无序列表内容1

  • 无序列表内容2

  • 无序列表内容3

有序列表:

    1. 有序列表内容1
    2. 有序列表内容2
    3. 有序列表内容3
    一个数字加一个点,文子与点之间有一个空格

效果是这样的:

  1. 有序列表内容1

  2. 有序列表内容2

  3. 有序列表内容3

引用>

    >这是你要引用的内容

向右的尖括号表示引用

效果:

这是你要引用的内容

水平分割线***

    ***这是一条水平分割线

用连续的三个星号表示

效果:

总结一下:

其实Markdown语法无非就是几个常用的符号: #,*,(),[], >

五个常用的而已,他们的组合也不多,就上面的介绍几个,把他们用熟练,对于个人的写作效率会有很大的提升。

openwrtmail

这个可以有 [赞]

JellyBool

@openwrtmail 哈哈哈,早知道就放出来了撒

JellyBool

@Yawenina 终于认真回复了

lyon

补充一个
#标题
--------
效果如下
#标题

lyon

诶?不会出现标题下面加条线麻?

lyon

那这个呢
Header 1
========
效果
Header 1

lyon

诶?也没有

lyon

再试试这个

    First Header | Second Header | Third Header
    ------------ | ------------- | ------------
    Content Cell | Content Cell  | Content Cell
    Content Cell | Content Cell  | Content Cell

效果

First Header Second Header Third Header
Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell
lyon

好吧,我知道了,支持部分Markdown…

lyon

我不信,在来一个
Strikethrough
效果
Strikethrough

JellyBool

@lyon 知道你会高端用法,这里只有一些基本的支持而已。

juu

@JellyBool 我们公司 随手打的。。。

JellyBool

@juu 好的吧

juu

@JellyBool 说明下:上面的网站不是我做的。唉……实在拿不出手。

JellyBool

@juu 那你为什么链接这个网站,真的是。。。

JellyBool

表格已支持 @lyon 而且新增了答案功能,玩得开心

lyon

答案功能是什么鬼 @JellyBool

lyon

哇擦勒, 哥哥我就这样上头条了?

amengdewo 回复 lyon

11111111111

JellyBool

答案就是:如果你发起一个讨论,然后回复中有解决方法的话,你就可以将这个回复作为答案来采纳 @lyon

lyon

@JellyBool 恩恩,昨天发现了,酷酷酷!

JellyBool

还行吧。。。 @lyon

sunnyn

@JellyBool
laravel.phar rt找了半天也找不到

mac 如何安装 laravel 安装工具呢??

JellyBool

laravel.phar rt这是什么鬼。。。? @sunnyn

good

太棒了

good

#一级标题

JellyBool

你在干嘛 @good

hxl

[test]2console.log("xxx")

alano

##二级标题测试

taruca

试试。

$article=App\Article::create(['title'=>'3','content'=>'2','published_at'=>Carbon\Carbon::now()]);
taruca

再试试
App\Article {#690 published_at: Carbon\Carbon {#689

taruca
App\Article {#690
     published_at: Carbon\Carbon {#689
       +"date": "2015-10-11 14:46:10",
       +"timezone_type": 3,
       +"timezone": "UTC",
     },
     updated_at: "2015-10-11 14:46:10",
     created_at: "2015-10-11 14:46:10",
     id: 1,
   }
yeerba

我来测试粗体效果

xiaoyang322
App\Article {#690
     published_at: Carbon\Carbon {#689
       +"date": "2015-10-11 14:46:10",
       +"timezone_type": 3,
       +"timezone": "UTC",
     },
     updated_at: "2015-10-11 14:46:10",
     created_at: "2015-10-11 14:46:10",
     id: 1,
   }
xiaoyang322
App\Article {#690
     published_at: Carbon\Carbon {#689
       +"date": "2015-10-11 14:46:10",
       +"timezone_type": 3,
       +"timezone": "UTC",
     },
     updated_at: "2015-10-11 14:46:10",
     created_at: "2015-10-11 14:46:10",
     id: 1,
   }
JellyBool

你是想? @xiaoyang322

xuan2429833524
[txt](url)
xuan2429833524

我的网站如何实现对这种语法的支持呢

JellyBool

你要干嘛 @xuan2429833524 真心不要这样。

ingood

这个回复的*markdown解析*是自己编写的吗?还是采用了[开源组件][^what ]?


thanks!

微凉

感觉…如果是可视化的话…会更好吧

yff

我来测试下效果

<?php
phpinfo();
``
yff

如果只用一个 ````的话,好像不能换行

yff

引用,有的markdown编辑器里面,出来的好像是两个双引号

我来看看这个是什么样子的

imaxing 回复 yff

css 自己写样式就可以引号包裹了

Mr_琅_
qwert
123456

花式撸状元

好酷,手痒必须试试。
#Laravist是个好网站,Jelly是个好同志。

encone001

#这是h1吗?

encone001

##这是h2?

encone001

###我靠h3

encone001

#6666666

snail

测试下代码块
······
return this is a code area
ok
······

Penics
return this is a code area
ok
madyayo
phpinfo();
echo '&nbsp;看看行不行';
sophlian

#测试
echo "Hello laravist!~"

xiaohigh

##测试

this is a [test](http://www.baidu.com)
shadow610

test

$article=App\Article::create(['title'=>'3','content'=>'2','published_at'=>Carbon\Carbon::now()]);
shadow610
$article=App\Article::create(['title'=>'3','content'=>'2','published_at'=>Carbon\Carbon::now()]);
kvcr945a

‘’‘
test
’’’

kvcr945a

######试试

hehorange

你们这群人 简直
丧心病狂

liudong0763

here is not my sentence


kimuraCnm

#测试一下一级标题#

kimuraCnm

#再次测试#

happyqian

App\Article {#690 published_at: Carbon\Carbon {#689 +"date": "2015-10-11 14:46:10", +"timezone_type": 3, +"timezone": "UTC", }, updated_at: "2015-10-11 14:46:10", created_at: "2015-10-11 14:46:10", id: 1, }

happyqian

` public function __construct()
{
$this->middleware(‘guest’, [‘except’ => ‘logout’]);
}’

CaiLiguang

{ $this->middleware('guest', ['except' => 'logout']); }'

CaiLiguang
{ $this->middleware('guest', ['except' => 'logout']); }
wangyuchen
<?php
    echo ‘测试代码块’;
wangyuchen
$article=App\Article::create(['title'=>'3','content'=>'2','published_at'=>Carbon\Carbon::now()]);
蓝雨露小镇

···




  • { d.content}


  • ···

    噼里啪啦小蛋哥

    **我就是来测试下MarkDown语法的

    chenyuanqi

    可惜没有预览功能~

    Swww18

    ###test

    Swww18
    <?php ?>
    
    Grapemlin

    手机浏览这个网站,页面宽度有点大,左右可以滑动。

    北漂张小白

    这个太棒了,很实用!

    xiangxihenli

    学习了、。。。。

    iceneet

    学习一下。。。

    高永立

    我就是来学习一下.顺便试试社区的回复功能.

    peterpapawp

    黑的
    斜的

    _Keepers

    ··· echo ‘hello word’;```

    _Keepers

    这里是你要写的代码

    _Keepers
    ffffffffffffffffffffffff
    
    _Keepers
    ffffffffffffffffffffffff
    
    _Keepers
    ffffffffffffffffffffffff
    
    ye0205414225

    123456

    12345

    djanedu

    @djanedu echo "Hello World'

    Frank0Hao
    First Header Second Header Third Header
    Content Cell Content Cell Content Cell
    Content Cell Content Cell Content Cell
    Frank0Hao
    First Header Second Header Third Header
    Content Cell Content Cell Content Cell
    Content Cell Content Cell Content Cell
    Frank0Hao
    First Header Second Header Third Header
    Content Cell Content Cell Content Cell
    Content Cell Content Cell Content Cell
    Frank0Hao

    ##额,不好使啊= = =

    Frank0Hao

    为什么发了三条?我只点了一下啊

    Frank0Hao

    ###再试一次
    First Header | Second Header | Third Header
    ------------ | ------------- | ------------
    Content Cell | Content Cell | Content Cell
    Content Cell | Content Cell | Content Cell

    328333982

    ##有点神奇,哈哈

    328333982
    First Header Second Header Third Header
    Content Cell Content Cell Content Cell
    Content Cell Content Cell Content Cell
    TricSuMer
    <?php
        echo 'Hello World !';
    ?>
    
    MarksGui888

    这个非常好,对写作有非常大的帮助哟!

    djlbool

    哈哈哈哈哈哈哈

    jayin

    我来test

    jayin
    <?php 
    
        namespace App\test;
    
    jayin
    Route::get('/', function () {
        return view('welcome');
    });
    
    Route::auth();
    
    Route::get('/home', 'HomeController@index');
    
    Route::any('upload', 'StudentController@upload');
    Route::get('mail', 'StudentController@mail');
    
    jayin
    Route::get('/', function () {
        return view('welcome');
    });
    
    Route::auth();
    
    Route::get('/home', 'HomeController@index');
    
    Route::any('upload', 'StudentController@upload');
    Route::get('mail', 'StudentController@mail');
    
    jayin

    ·

    jayin

    ·

    jayin

    ·

    jayin
    <?php
    echo '为什么代码没有颜色';
    
    jayin
    <?php
    echo '为什么代码没有颜色';
    
    jayin
    <?php
    echo '为什么代码没有颜色';
    
    jayin
    <?php
    echo '为什么代码没有颜色';
    
    jayin
    App\Article {#690
         published_at: Carbon\Carbon {#689
           +"date": "2015-10-11 14:46:10",
           +"timezone_type": 3,
           +"timezone": "UTC",
         },
         updated_at: "2015-10-11 14:46:10",
         created_at: "2015-10-11 14:46:10",
         id: 1,
       }
    
    jayin
    App\Article {#690
         published_at: Carbon\Carbon {#689
           +"date": "2015-10-11 14:46:10",
           +"timezone_type": 3,
           +"timezone": "UTC",
         },
         updated_at: "2015-10-11 14:46:10",
         created_at: "2015-10-11 14:46:10",
         id: 1,
       }
    
    jayin
    App\Article {#690
         published_at: Carbon\Carbon {#689
           +"date": "2015-10-11 14:46:10",
           +"timezone_type": 3,
           +"timezone": "UTC",
         },
         updated_at: "2015-10-11 14:46:10",
         created_at: "2015-10-11 14:46:10",
         id: 1,
       }
    
    jayin
    App\Article {#690
         published_at: Carbon\Carbon {#689
           +"date": "2015-10-11 14:46:10",
           +"timezone_type": 3,
           +"timezone": "UTC",
         },
         updated_at: "2015-10-11 14:46:10",
         created_at: "2015-10-11 14:46:10",
         id: 1,
       }
    
    jayin
    App\Article {#690
         published_at: Carbon\Carbon {#689
           +"date": "2015-10-11 14:46:10",
           +"timezone_type": 3,
           +"timezone": "UTC",
         },
         updated_at: "2015-10-11 14:46:10",
         created_at: "2015-10-11 14:46:10",
         id: 1,
       }
    
    jayin

    @JellyBool 我的为什么回复代码没颜色

    噼里啪啦小蛋哥
    echo 'laravist';
    
    zhouxiaoshuai3
    <?php
     echo 'laravel5'//测试一下
    ?>
    
    
    GOD_Nt

    请问一下,如何发布自己的图片呢?难道只能通过上传到第三方然后引用图片地址吗?

    噼里啪啦小蛋哥

    这里修改了 如果为空

    punktus0308
      var ihubo = {
        nickName  : "草依山",
        site : "http://jser.me"
      }
    
    leon19910505

    ‘’‘
    var ihbo = {}
    ’’’

    GeekCnh

    var ihubo = {
    nickName : “草依山”,
    site : “http://jser.me
    }

    Nixiaomo

    laravist

    ssong

    #试试看看markdown

    daoyi
    [baidu](https://www.baidu.com/)
    
    daoyi

    test markdown

    daoyi

    test markdown

    daoyi
    
    
    我怎么一发就发这么多条- -
    
    
    
    
    daoyi

    好尴尬- -

    Cyclone
    test
    
    huigezizj

    ···
    test
    ···

    huigezizj

    success

    huigezizj

    success

    huigezizj

    success

    huigezizj
    App\Article {#690
         published_at: Carbon\Carbon {#689
           +"date": "2015-10-11 14:46:10",
           +"timezone_type": 3,
           +"timezone": "UTC",
         },
         updated_at: "2015-10-11 14:46:10",
         created_at: "2015-10-11 14:46:10",
         id: 1,
       }
    
    huigezizj

    App\Article {#690 published_at: Carbon\Carbon {#689 +"date": "2015-10-11 14:46:10", +"timezone_type": 3, +"timezone": "UTC", }, updated_at: "2015-10-11 14:46:10", created_at: "2015-10-11 14:46:10", id: 1, }

    huigezizj

    App\Article {#690 published_at: Carbon\Carbon {#689 +"date": "2015-10-11 14:46:10", +"timezone_type": 3, +"timezone": "UTC", }, updated_at: "2015-10-11 14:46:10", created_at: "2015-10-11 14:46:10", id: 1, }

    huigezizj
     published_at: Carbon\Carbon {#689
       +"date": "2015-10-11 14:46:10",
       +"timezone_type": 3,
       +"timezone": "UTC",
     },
     updated_at: "2015-10-11 14:46:10",
     created_at: "2015-10-11 14:46:10",
     id: 1,
    
    zhouxiaomin
    <?php echo 'hello world';?>
    
    Jackzhou
    这里的背景色是:Aquamarine
    1
    Jackzhou
    <?php echo 'laravist';?>
    
    Jackzhou
    <?php echo '后面才发现可以修改, 前面浪费了两个楼层.略尴尬'?>
    
    huigezizj

    Collection {#572 ▼ #items: array:1 [▼ 0 => Tag {#573 ▼ #guarded: array:1 [▶] #primaryKey: "id" #table: "tags" #connection: "mysql" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: true +wasRecentlyCreated: false #attributes: array:6 [▶] #original: array:8 [▶] #casts: [] #dates: [] #dateFormat: null #appends: [] #events: [] #observables: [] #relations: array:1 [▶] #touches: [] +timestamps: true #hidden: [] #visible: [] #fillable: [] } ] }

    huigezizj
    Collection {#572#items: array:1 [▼
        0 => Tag {#573#guarded: array:1 [▶]
          #primaryKey: "id"
          #table: "tags"
          #connection: "mysql"
          #keyType: "int"
          +incrementing: true
          #with: []
          #withCount: []
          #perPage: 15
          +exists: true
          +wasRecentlyCreated: false
          #attributes: array:6 [▶]
          #original: array:8 [▶]
          #casts: []
          #dates: []
          #dateFormat: null
          #appends: []
          #events: []
          #observables: []
          #relations: array:1 [▶]
          #touches: []
          +timestamps: true
          #hidden: []
          #visible: []
          #fillable: []
        }
      ]
    }
    
    不了了了了了之
    Collection {#572#items: array:1 [▼
        0 => Tag {#573#guarded: array:1 [▶]
          #primaryKey: "id"
          #table: "tags"
          #connection: "mysql"
          #keyType: "int"
          +incrementing: true
          #with: []
          #withCount: []
          #perPage: 15
          +exists: true
          +wasRecentlyCreated: false
          #attributes: array:6 [▶]
          #original: array:8 [▶]
          #casts: []
          #dates: []
          #dateFormat: null
          #appends: []
          #events: []
          #observables: []
          #relations: array:1 [▶]
          #touches: []
          +timestamps: true
          #hidden: []
          #visible: []
          #fillable: []
        }
      ]
    }
    
    不了了了了了之

    ‘’‘
    Collection {#572 ▼ #items: array:1 [▼ 0 => Tag {#573 ▼ #guarded: array:1 [▶] #primaryKey: “id” #table: “tags” #connection: “mysql” #keyType: “int” +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: true +wasRecentlyCreated: false #attributes: array:6 [▶] #original: array:8 [▶] #casts: [] #dates: [] #dateFormat: null #appends: [] #events: [] #observables: [] #relations: array:1 [▶] #touches: [] +timestamps: true #hidden: [] #visible: [] #fillable: [] } ] }
    ’’’

    不了了了了了之
    Collection {#572#items: array:1 [▼ 0 => Tag {#573#guarded: array:1 [▶] #primaryKey: "id" #table: "tags" #connection: "mysql" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: true +wasRecentlyCreated: false #attributes: array:6 [▶] #original: array:8 [▶] #casts: [] #dates: [] #dateFormat: null #appends: [] #events: [] #observables: [] #relations: array:1 [▶] #touches: [] +timestamps: true #hidden: [] #visible: [] #fillable: [] } ] }
    
    不了了了了了之
        public function line($line)
        {
            return $this->with($line);
        }
    
        /**
         * Add a line of text to the notification.
         *
         * @param  \Illuminate\Notifications\Action|string|array  $line
         * @return $this
         */
        public function with($line)
        {
            if ($line instanceof Action) {
                $this->action($line->text, $line->url);
            } elseif (! $this->actionText) {
                $this->introLines[] = $this->formatLine($line);
            } else {
                $this->outroLines[] = $this->formatLine($line);
            }
    
            return $this;
        }
    
    Power
    public function test () {
    
    }
    
    Power

    引用>:试试看

    Power
    • test
    1. test
    Power
    • fdsafas
    Power

    为什么他们的代码有颜色

    EsreVeEel

    ·撒大苏打·
    ···

    {$question->followers_count}

    我就试试
    ···
    EsreVeEel
    <div class="panel-heading">
            {$question->answers_count}个答案
    </div>
    

    ···

    {$question->answers_count}个答案
    ···
    haohexin
        /**
         * ServicePhoneController constructor.
         */
    
    qq79534505
     echo "hello world";
    
    qq79534505
        public function line($line)
        {
            return $this->with($line);
        }
    
        /**
         * Add a line of text to the notification.
         *
         * @param  \Illuminate\Notifications\Action|string|array  $line
         * @return $this
         */
        public function with($line)
        {
            if ($line instanceof Action) {
                $this->action($line->text, $line->url);
            } elseif (! $this->actionText) {
                $this->introLines[] = $this->formatLine($line);
            } else {
                $this->outroLines[] = $this->formatLine($line);
            }
    
            return $this;
        }
    
    soyoung

    感受

    ##一下
    ###下
    imaxing

    为什么没有滚动条?


    测试下

    哈哈哈

    
    new Vue({
      el: '#app'
    })
    
    
    imaxing

    上面评论竟然很多人不知道标题 #后面要加个空格才行

    我笑出了声 '哈'.repeat(100)

    imaxing

    markdown Editor可以升级下, 升级成这种!

    imaxing

    哎呀 写错了

    这种

    foxriver123
    public function getJelly(){echo 'jelly';}
    
    foxriver123

    代表h1(一级标题)

    Flourishing
               <div class="links">
                        <a href="https://laravel.com/docs">Documentation</a>
                        <a href="https://laracasts.com">Laracasts</a>
                        <a href="https://laravel-news.com">News</a>
                        <a href="https://forge.laravel.com">Forge</a>
                        <a href="https://github.com/laravel/laravel">GitHub</a>
                    </div>
    
    Flourishing

    #Flourishing
    ##Flourishing
    ###Flourishing

    Flourishing

    hello codecasts

    Flourishing

    For Laravel Artist

    Flourishing

    namespace App;

    use Illuminate\Notifications\Notifiable;
    use Illuminate\Foundation\Auth\User as Authenticatable;

    class User extends Authenticatable
    {
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];
    
    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
    

    }

    dawei


    test

    dawei
    <?php
     echo 'hello world!';
    
    foxriver123
    public function make($abstract, array $parameters = []){
       	$abstract = $this->getAlias($abstract);  
       	if (isset($this->deferredServices[$abstract]) && ! isset($this->instances[$abstract])) {
            $this->loadDeferredProvider($abstract);
        }
        return parent::make($abstract, $parameters);
    }
    
    foxriver123

    ···
    public function make($abstract, array $parameters = []){
    $abstract = this>getAlias(this->getAlias(abstract);
    if (isset(this>deferredServices[this->deferredServices[abstract]) && ! isset(this>instances[this->instances[abstract])) {
    this>loadDeferredProvider(this->loadDeferredProvider(abstract);
    }
    return parent::make($abstract, $parameters);
    }
    ···

    foxriver123
    public function color(){ dump('why no color');}
    
    foxriver123

    引用哈哈哈哈哈哈

    foxriver123

    引用乐乐乐乐乐乐来

    function test(){}
    

    引用咯咯咯

    kkyao97
    print "hello world";