Skip to content

Commit a4cc540

Browse files
committed
adding support for mkdocs-material hosting/docs generation
1 parent 390f098 commit a4cc540

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
node_modules/
33
.history
44
.DS_Store
5+
site/

CONTRIBUTING.md

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

mkdocs.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
site_name: How To Cook
2+
use_directory_urls: true
3+
docs_dir: .
4+
theme:
5+
name: material
6+
language: zh
7+
features:
8+
- navigation.instant
9+
palette:
10+
- media: "(prefers-color-scheme: light)"
11+
scheme: default
12+
primary: grey
13+
toggle:
14+
icon: material/weather-sunny
15+
name: Switch to dark mode
16+
- media: "(prefers-color-scheme: dark)"
17+
scheme: slate
18+
toggle:
19+
icon: material/weather-night
20+
name: Switch to light mode
21+
22+
plugins:
23+
- same-dir
24+
- search

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mkdocs-material
2+
mkdocs-same-dir

0 commit comments

Comments
 (0)