MkDocs
官方文档step by step init既可
注意一些没有被
mkdocs.yml索引的文件也会一起打包出去,比如secret可以被访问(exclude_docs, draft_docs, not_in_nav都没啥用)
基本配置¶
- site_name
- nav
- theme
- favicon
- 默认配置 https://github.com/mkdocs/mkdocs/blob/master/mkdocs/themes/readthedocs/mkdocs_theme.yml
- 详细配置 https://www.mkdocs.org/user-guide/configuration/
主题¶
- mkdocs 默认主题
- readthedocs Read the Docs 的子集
- Material for MkDocs
基本差不多,暂时选readthedocs(https://github.com/Brilliant/notes/releases/tag/readthedocs)看起来在文档上更专业一点 缺点有点朴素,最基本的屏幕适配都没有,因此尝试mkdocs-material
自定义主题(Using the theme custom_dir)¶
- https://www.mkdocs.org/user-guide/customizing-your-theme/
把自定义的东西都放到这里,docs里面只有md文件,比较清晰
copyright¶
阅读 https://github.com/mkdocs/mkdocs/blob/master/mkdocs/themes/readthedocs/footer.html发现有两种方法
- yml配置里直接写html
- 直接自定义 footer.html
扩展插件¶
可能用得上的插件
官方插件¶
第三方插件¶
Python-Markdown wiki¶
MkDocs project catalog¶
- Material for MkDocs,一个比较火的还在维护的主题
- rss,目测Cloudflare的Git集成只拉取了最新的commit,导致大多数文章的git history为空,所以需要通过Github Actions来部署
- mermaid2
- mkdocs-jupyter
- git-revision-date-localized,自动根据git文件的历史设置create/update时间,不会读Front Matter适配
- Math extension
超链接¶
wiki风格都超链接更加方便一点,但是git等网站接受度不高(不能自动调整),暂时还是选用传统风格的超链接
- WikiLink风格的超链接支持 https://github.com/orbikm/mkdocs-ezlinks-plugin
- 或者使用
pre-commit hook做样式检查