adding support for mkdocs-material hosting/docs generation

This commit is contained in:
Siming Yuan 2022-02-28 11:45:05 -05:00 committed by Siming Yuan
parent 390f098321
commit a4cc5409a6
4 changed files with 49 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
node_modules/
.history
.DS_Store
site/

View File

@ -95,3 +95,25 @@
- 确保分类正确,不和已有的菜名重复
- 确保签入的内容都符合 CC0 协议。尤其注意图片是否有水印!
- 确保他没有签入任何个人身份信息、EUII、Email 地址、GitHub 用户名
## Documentation Hosting
利用`mkdocs-material`来render markdown文件。
`./docs` 文件夹的存在是workaround mkdocs要求`.md`文件不能存在于根目录中。里面全部是relative symlink到
实际的文件/文件夹
需求: Python > 3.6
如何使用:
```
pip install -r requirements.txt
mkdocs serve
```
Documentation可以在本地 http://localhost:8000/ 打开。
管理员:
用`mkdocs build` 生成静态HTML网页, 存在于在`site/`文件夹下。Hosting的时候指向到`site/index.html`即可。

24
mkdocs.yml Normal file
View File

@ -0,0 +1,24 @@
site_name: How To Cook
use_directory_urls: true
docs_dir: .
theme:
name: material
language: zh
features:
- navigation.instant
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: grey
toggle:
icon: material/weather-sunny
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-night
name: Switch to light mode
plugins:
- same-dir
- search

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
mkdocs-material
mkdocs-same-dir