feat(toc): support fontawesome and ruby in TOC
This commit is contained in:
9
layouts/partials/function/checkbox.html
Normal file
9
layouts/partials/function/checkbox.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- /* Checkbox unchecked */ -}}
|
||||
{{- $REin := `<input disabled="" type="checkbox">` -}}
|
||||
{{- $REout := `<i class="far fa-check-square fa-fw"></i>` -}}
|
||||
{{- $content := replaceRE $REin $REout . -}}
|
||||
|
||||
{{- /* Checkbox checked */ -}}
|
||||
{{- $REin = `<input checked="" disabled="" type="checkbox">` -}}
|
||||
{{- $REout = `<i class="far fa-square fa-fw"></i>` -}}
|
||||
{{- return replaceRE $REin $REout $content -}}
|
||||
5
layouts/partials/function/fontawesome.html
Normal file
5
layouts/partials/function/fontawesome.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- /* Font Awesome */ -}}
|
||||
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw"></i> */ -}}
|
||||
{{- $REin := `:\(([\w- ]+?)\):` -}}
|
||||
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
|
||||
{{- return replaceRE $REin $REout . -}}
|
||||
5
layouts/partials/function/ruby.html
Normal file
5
layouts/partials/function/ruby.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- /* Ruby */ -}}
|
||||
{{- /* [EN]^(English) -> <strong><ruby>EN<rt>English</rt></ruby></strong> */ -}}
|
||||
{{- $REin := `\[(.+?)\]\^\((.+?)\)` -}}
|
||||
{{- $REout := `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
|
||||
{{- return replaceRE $REin $REout . -}}
|
||||
Reference in New Issue
Block a user