teedoc theme plugin
teedoc-plugin-theme-default: default theme plugin
Plugin configuration
Configure the plugin in site_config.json
"plugins": {
"teedoc-plugin-theme-default":{
"from": "pypi",
"config": {
"dark": true,
"default_dark": false,
"mobile_navbar_collapsed": true,
"toc_depth": 4,
"env":{
"main_color": "#4caf7d",
"sidebar_width": "300px"
},
"css": "/static/css/custom.css",
"js": "/static/js/custom.js",
"code_highlight_css": "/static/css/prism.css",
"code_highlight_js": "/static/js/prism.js"
}
}
}
dark: support dark mode switchdefault_dark: default use dark modemobile_navbar_collapsed: collapse navbar by default on mobile phonetoc_depth: table of article conent's depth, default to4, that is showH1~H4headersshow_print_page: show print page button, visitor click or pushCtrl+Pto printmain_color: theme main colorsidebar_width: sidebar default width, format can be like"300px",300,"30%"css:cssfileURL, which can override the default style and will be inserted into theheadtag of the pagejs:jsfileURL, can writejsprogram, it will be loaded at the end of the page
The default code highlighting uses prismjs, and the support of some common languages is checked by default. js file + css file totals about 100KiB, if you need the code If you can’t highlight, or want to save traffic or reduce loading time, you can go to here Check the default check and check the language and Function, finally get a css file and a js file in the static/js directory, and then set the URL in site_config.json:
"route": {
"assets": {
"/static/": "static"
}
}
this config will due to files in
staticdir will be copied tostaticdir of out dir.
code_highlight_css:codehighlightingcssfileURL, will replace the default highlightingcssfile, and will be inserted into theheadtag of the pagecode_highlight_js:codehighlightingjsfileURL, will replace the default highlightingjsfile, and will be loaded at the end of the page
Supports day and night modes. The night mode will add a dark class to the body. If you want the css style of the night mode, you can modify it based on this class name
class support
The theme supports several commonly used class and id, which can be set in config.json(/config.yaml) or the class and id keywords in the .md file. You can use this style directly
For example, set in config.json
{
"class": "md_page",
"navbar": {
...
}
}
Or add in the header of the md file
---
title: title
class: heading_no_counter
---
Then the html tags of all generated pages under this document will contain this class. For example, md_page will make the content displayed in the center instead of left-aligned
class has:
md_page: Ordinary markdown files are rendered into html pages, you can add this class, it will be displayed in the center instead of left-alignedheading_no_counter: Cancel automatic heading numbering