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

Typora自動編號的具體操作

 更新時間:2021年12月06日 17:09:08   作者:xnightmare  
相比較world這種文檔編輯器而言,Typora更適合寫一些程序相關的博客,因為可以用代碼+快捷鍵的方式,方便的對文章內(nèi)容進行處理,不用在擔心排版和樣式變形的問題了,在編輯的過程中,就能預覽到效果

概述

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

Typora官方提供了自動編號的方法:https://support.typora.io/Auto-Numbering/。本文將對官方提供的方法,以及簡單改進進行介紹。

原理

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

具體操作

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

改進

官方提供的代碼會對一級標題進行編號,但實際寫文章時,一級標題往往是文章標題,無需編號,因此,我對代碼進行了簡單修改。下面是修改后的代碼

文章內(nèi)容自動編號:

/** 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自動編號:

/* 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è)邊欄大綱自動編號:

.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) ". "
}

效果圖

在這里插入圖片描述

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

相關文章

  • 將本地項目添加到git管理

    將本地項目添加到git管理

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

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

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

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

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

    高性能高可用高并發(fā)架構和系統(tǒng)設計思路大綱

    高性能架構和系統(tǒng)設計要求高并發(fā)高性能,高性能更多的是先從編碼角度、架構使用角度去讓我們的單機(單實例)有更好的性能,然后再從整個系統(tǒng)層面來擁有更好的性能;高并發(fā)則直接是全局角度來讓我們的系統(tǒng)在全鏈路下都能夠抗住更多的并發(fā)請求
    2023-08-08
  • idea啟動后CPU飆升的問題解決

    idea啟動后CPU飆升的問題解決

    IDEA運行大型項目,項目啟動卡頓,CPU使用率占用過高,下面這篇文章主要給大家介紹了關于idea啟動后CPU飆升的問題解決,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下
    2023-05-05
  • Hive?判斷某個字段長度的示例代碼

    Hive?判斷某個字段長度的示例代碼

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

    C1任務01之修改游戲存檔的方法

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

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

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

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

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

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

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

最新評論

化州市| 瑞安市| 辰溪县| 淮阳县| 伊通| 阿克苏市| 南丰县| 黄石市| 剑川县| 磴口县| 秦安县| 崇仁县| 河源市| 安吉县| 桐梓县| 芒康县| 仁怀市| 山阴县| 鸡西市| 丰镇市| 山西省| 中西区| 龙里县| 慈溪市| 东乌珠穆沁旗| 通化市| 三穗县| 淅川县| 安达市| 五指山市| 平南县| 江城| 长治县| 萨嘎县| 嘉定区| 砚山县| 平南县| 收藏| 眉山市| 图木舒克市| 合水县|