最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Typora自動(dòng)編號(hào)的具體操作

 更新時(shí)間:2021年12月06日 17:09:08   作者:xnightmare  
相比較world這種文檔編輯器而言,Typora更適合寫一些程序相關(guān)的博客,因?yàn)榭梢杂么a+快捷鍵的方式,方便的對(duì)文章內(nèi)容進(jìn)行處理,不用在擔(dān)心排版和樣式變形的問(wèn)題了,在編輯的過(guò)程中,就能預(yù)覽到效果

概述

在使用Typora寫比較長(zhǎng)的文章時(shí),需要給章節(jié)編號(hào),方便區(qū)分層次。如果手動(dòng)編號(hào),一旦章節(jié)順序改變,很多章節(jié)的編號(hào)都需要一一手動(dòng)修改,極其麻煩。

Typora官方提供了自動(dòng)編號(hào)的方法:https://support.typora.io/Auto-Numbering/。本文將對(duì)官方提供的方法,以及簡(jiǎn)單改進(jìn)進(jìn)行介紹。

原理

這個(gè)方法的原理是,Typora基于瀏覽器開發(fā)(使用快捷鍵Shift+F12可以打開開發(fā)者工具)。因此,可以利用CSS實(shí)現(xiàn)自動(dòng)編號(hào)。

具體操作

  • 打開Typora -> 文件 -> 偏好設(shè)置 -> 外觀 -> 打開主題文件夾。
  • 在主題文件夾下新建文件base.user.css。
  • 將https://support.typora.io/Auto-Numbering/中提供的三份代碼(分別實(shí)現(xiàn)文章內(nèi)容自動(dòng)編號(hào)、TOC自動(dòng)編號(hào)、側(cè)邊欄大綱自動(dòng)編號(hào))復(fù)制到base.user.css中。
  • 重啟Typora。

改進(jìn)

官方提供的代碼會(huì)對(duì)一級(jí)標(biāo)題進(jìn)行編號(hào),但實(shí)際寫文章時(shí),一級(jí)標(biāo)題往往是文章標(biāo)題,無(wú)需編號(hào),因此,我對(duì)代碼進(jìn)行了簡(jiǎn)單修改。下面是修改后的代碼

文章內(nèi)容自動(dòng)編號(hào):

/** initialize css counter */
h1 {
    counter-reset: h2
}

h2 {
    counter-reset: h3
}

h3 {
    counter-reset: h4
}

h4 {
    counter-reset: h5
}

h5 {
    counter-reset: h6
}

/** put counter result into headings */
#write h2:before {
    counter-increment: h2;
    content: counter(h2) ". "
}

#write h3:before,
h3.md-focus.md-heading:before /** override the default style for focused headings */ {
    counter-increment: h3;
    content: counter(h2) "." counter(h3) ". "
}

#write h4:before,
h4.md-focus.md-heading:before {
    counter-increment: h4;
    content: counter(h2) "." counter(h3) "." counter(h4) ". "
}

#write h5:before,
h5.md-focus.md-heading:before {
    counter-increment: h5;
    content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "
}

#write h6:before,
h6.md-focus.md-heading:before {
    counter-increment: h6;
    content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "
}

/** override the default style for focused headings */
#write>h3.md-focus:before,
#write>h4.md-focus:before,
#write>h5.md-focus:before,
#write>h6.md-focus:before,
h3.md-focus:before,
h4.md-focus:before,
h5.md-focus:before,
h6.md-focus:before {
    color: inherit;
    border: inherit;
    border-radius: inherit;
    position: inherit;
    left:initial;
    float: none;
    top:initial;
    font-size: inherit;
    padding-left: inherit;
    padding-right: inherit;
    vertical-align: inherit;
    font-weight: inherit;
    line-height: inherit;
}

TOC自動(dòng)編號(hào):

/* No link underlines in TOC */
.md-toc-inner {
    text-decoration: none;
}
 
.md-toc-h1 {
    margin-left: 0;
    font-size: 1.5rem;
    counter-reset: h2toc
}
 
.md-toc-h2 {
    font-size: 1.1rem;
    margin-left: 2rem;
    counter-reset: h3toc
}
 
.md-toc-h3 {
    margin-left: 3rem;
    font-size: .9rem;
    counter-reset: h4toc
}
 
.md-toc-h4 {
    margin-left: 4rem;
    font-size: .85rem;
    counter-reset: h5toc
}
 
.md-toc-h5 {
    margin-left: 5rem;
    font-size: .8rem;
    counter-reset: h6toc
}
 
.md-toc-h6 {
    margin-left: 6rem;
    font-size: .75rem;
}
 
.md-toc-h2:before {
    color: black;
    counter-increment: h2toc;
    content: counter(h2toc) ". "
}
 
.md-toc-h2 .md-toc-inner {
    margin-left: 0;
}
 
.md-toc-h3:before {
    color: black;
    counter-increment: h3toc;
    content: counter(h2toc) ". " counter(h3toc) ". "
}
 
.md-toc-h3 .md-toc-inner {
    margin-left: 0;
}
 
.md-toc-h4:before {
    color: black;
    counter-increment: h4toc;
    content: counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". "
}
 
.md-toc-h4 .md-toc-inner {
    margin-left: 0;
}
 
.md-toc-h5:before {
    color: black;
    counter-increment: h5toc;
    content: counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". " counter(h5toc) ". "
}
 
.md-toc-h5 .md-toc-inner {
    margin-left: 0;
}
 
.md-toc-h6:before {
    color: black;
    counter-increment: h6toc;
    content: counter(h2toc) ". " counter(h3toc) ". " counter(h4toc) ". " counter(h5toc) ". " counter(h6toc) ". "
}
 
.md-toc-h6 .md-toc-inner {
    margin-left: 0;
} 

側(cè)邊欄大綱自動(dòng)編號(hào):

.outline-h1 {
    counter-reset: h2
}
 
.outline-h2 {
    counter-reset: h3
}
 
.outline-h3 {
    counter-reset: h4
}
 
.outline-h4 {
    counter-reset: h5
}
 
.outline-h5 {
    counter-reset: h6
}
 
.outline-h2>.outline-item>.outline-label:before {
    counter-increment: h2;
    content: counter(h2) ". "
}
 
.outline-h3>.outline-item>.outline-label:before {
    counter-increment: h3;
    content: counter(h2) "." counter(h3) ". "
}
 
.outline-h4>.outline-item>.outline-label:before {
    counter-increment: h4;
    content: counter(h2) "." counter(h3) "." counter(h4) ". "
}
 
.outline-h5>.outline-item>.outline-label:before {
    counter-increment: h5;
    content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "
}
 
.outline-h6>.outline-item>.outline-label:before {
    counter-increment: h6;
    content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "
}

效果圖

在這里插入圖片描述

到此這篇關(guān)于Typora自動(dòng)編號(hào)的文章就介紹到這了,更多相關(guān)Typora自動(dòng)編號(hào)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 將本地項(xiàng)目添加到git管理

    將本地項(xiàng)目添加到git管理

    這篇文章介紹了將本地項(xiàng)目添加到git管理的方法,對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2022-06-06
  • 最新IntelliJ IDEA 2020.2永久激活碼(親測(cè)有效)

    最新IntelliJ IDEA 2020.2永久激活碼(親測(cè)有效)

    今天一大波朋友反饋idea2020激活碼失效的問(wèn)題,小編快馬加鞭給大家找到解決方案,本文以IDEA 2020.2.4激活碼破解教程為例給大家詳細(xì)介紹,需要idea2020激活碼的朋友快來(lái)參考下本文吧
    2020-11-11
  • 程序員鼓勵(lì)師插件Rainbow Fart(彩虹屁)

    程序員鼓勵(lì)師插件Rainbow Fart(彩虹屁)

    這篇文章主要介紹了程序員鼓勵(lì)師插件Rainbow Fart(彩虹屁)的相關(guān)知識(shí),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-06-06
  • 高性能高可用高并發(fā)架構(gòu)和系統(tǒng)設(shè)計(jì)思路大綱

    高性能高可用高并發(fā)架構(gòu)和系統(tǒng)設(shè)計(jì)思路大綱

    高性能架構(gòu)和系統(tǒng)設(shè)計(jì)要求高并發(fā)高性能,高性能更多的是先從編碼角度、架構(gòu)使用角度去讓我們的單機(jī)(單實(shí)例)有更好的性能,然后再?gòu)恼麄€(gè)系統(tǒng)層面來(lái)?yè)碛懈玫男阅?;高并發(fā)則直接是全局角度來(lái)讓我們的系統(tǒng)在全鏈路下都能夠抗住更多的并發(fā)請(qǐng)求
    2023-08-08
  • idea啟動(dòng)后CPU飆升的問(wèn)題解決

    idea啟動(dòng)后CPU飆升的問(wèn)題解決

    IDEA運(yùn)行大型項(xiàng)目,項(xiàng)目啟動(dòng)卡頓,CPU使用率占用過(guò)高,下面這篇文章主要給大家介紹了關(guān)于idea啟動(dòng)后CPU飆升的問(wèn)題解決,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-05-05
  • Hive?判斷某個(gè)字段長(zhǎng)度的示例代碼

    Hive?判斷某個(gè)字段長(zhǎng)度的示例代碼

    hive是基于Hadoop的一個(gè)數(shù)據(jù)倉(cāng)庫(kù)工具,用來(lái)進(jìn)行數(shù)據(jù)提取、轉(zhuǎn)化、加載,這是一種可以存儲(chǔ)、查詢和分析存儲(chǔ)在Hadoop中的大規(guī)模數(shù)據(jù)的機(jī)制,這篇文章主要介紹了Hive?判斷某個(gè)字段長(zhǎng)度,需要的朋友可以參考下
    2024-08-08
  • C1任務(wù)01之修改游戲存檔的方法

    C1任務(wù)01之修改游戲存檔的方法

    這篇文章主要介紹了C1任務(wù)01之修改游戲存檔的相關(guān)知識(shí),前三個(gè)任務(wù)會(huì)用到十六進(jìn)制編輯器來(lái)實(shí)現(xiàn),在修改的的過(guò)程中涉及到的知識(shí)點(diǎn)為十進(jìn)制數(shù)據(jù)與十六進(jìn)制之間數(shù)據(jù)的相互轉(zhuǎn)換,需要的朋友可以參考下
    2021-10-10
  • 一文詳解?OpenGL?ES?紋理顏色混合的方法

    一文詳解?OpenGL?ES?紋理顏色混合的方法

    在OpenGL中繪制的時(shí)候,有時(shí)候想使新畫的顏色和已經(jīng)有的顏色按照一定的方式進(jìn)行混合。怎么實(shí)現(xiàn)這個(gè)效果呢,下面小編給大家?guī)?lái)了OpenGL?ES?紋理顏色混合的實(shí)現(xiàn)方法,感興趣的朋友跟隨小編一起看看吧
    2021-12-12
  • VSCode各語(yǔ)言運(yùn)行環(huán)境配置方法示例詳解

    VSCode各語(yǔ)言運(yùn)行環(huán)境配置方法示例詳解

    這篇文章主要介紹了VSCode各語(yǔ)言運(yùn)行環(huán)境配置方法,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家介紹的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-05-05
  • resty更新header控制api版本數(shù)據(jù)源讀寫分離

    resty更新header控制api版本數(shù)據(jù)源讀寫分離

    這篇文章主要介紹了resty的1.2.0-SNAPSHOT版本更新,可以通過(guò)header控制api的版本實(shí)現(xiàn)數(shù)據(jù)源讀寫分離,有需要的朋友可以借鑒參考下,希望能夠有所幫助<BR>,
    2022-03-03

最新評(píng)論

呼伦贝尔市| 石泉县| 七台河市| 民乐县| 霍山县| 永安市| 光泽县| 射阳县| 永和县| 扶风县| 屏东县| 新疆| 固阳县| 铁岭县| 黑山县| 东城区| 黄大仙区| 司法| 平陆县| 元阳县| 德格县| 岳西县| 三江| 宝坻区| 方城县| 武穴市| 泰和县| 皋兰县| 什邡市| 红桥区| 南丰县| 崇州市| 克什克腾旗| 祁连县| 梧州市| 温州市| 潜江市| 集贤县| 类乌齐县| 北碚区| 班戈县|