forked from eastlakeside/interpy-zh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(readthedocs) add support for deployment to readthedocs
- Loading branch information
Showing
4 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
这个文件是用于构建readthedocs的配置文件, | ||
ReadTheDocs的规范: | ||
1. 从docs目录读取所有文档 | ||
2. 使用根目录下的mkdocs.yml作为目录 | ||
ReadTheDocs本地构建Gitbook的md文件: | ||
>>> pip install mkdocs | ||
>>> mkdocs build --clean --site-dir _build/html | ||
>>> mkdocs serve | ||
福利: mkdocs构建好以后,可以直接publish到github pages | ||
(目前github pages的自动生成只能使用单页md, 而Jekell构建又引入新的节点,不方便) | ||
""" | ||
|
||
|
||
# 从本地读取到Summary.md, 然后转译成mkdocs.yml | ||
import os | ||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True' | ||
if on_rtd: | ||
html_theme = 'default' | ||
else: | ||
html_theme = 'nature' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
site_name: Python进阶 | ||
pages: | ||
- Home: readme.md | ||
- Summary: summary.md | ||
theme: readthedocs |