ATOM markdown で、# , ## , ### による h1 , h2 , h3 に対して章番号を付ける方法、
HTML に変換しても、章番号を付ける。。
ユーザホームディレクトリ、~/.mume ディレクトリ
Windows なら、C:\Users\XXXXXXX\.mume に、
Style.less を書いておくか、任意のフォルダで Style.less を書いて、
@import 句を書いて読み込ませるかの方法になる。
CSSスタイルシートの書き方として、HTML bodyタグで、章番号カウンタをリセットして、
疑似属性 before でカウントUPする
/* Please visit the URL below for more information: */ /* https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */ body { counter-reset: chapter1; } h2 { counter-reset: chapter2; } h3 { counter-reset: chapter3; } h4 { counter-reset: chapter4; } h5 { } .markdown-preview.markdown-preview { // modify your style here // eg: background-color: blue; h2::before { counter-increment: chapter1; content: counter(chapter1) ". "; } h3::before { counter-increment: chapter2; content: counter(chapter1) "." counter(chapter2) ". "; } h4::before { counter-increment: chapter3; content: counter(chapter1) "." counter(chapter2) "." counter(chapter3) ". "; } h5::before { counter-increment: chapter4; content: counter(chapter1) "." counter(chapter2) "." counter(chapter3) "." counter(chapter4) ". "; } }
これを、~/.mume/Style.less として書くか、、
作成する markdown ファイルの中で、、カレントフォルダ に、mume を作り、そこに、Style.less を置くならば、
文書の先頭で、@import 文、(")ダブルクォートで括って指定する
@import "mume/Style.less"