Skip to content

Commit

Permalink
feat(readthedocs) add support for deployment to readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
suqi committed Mar 29, 2016
1 parent 4e988f2 commit 878fa8c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
node_modules

# Book build output
_book
# gitbook
_book
# readthedocs
_build

# eBook build output
*.epub
*.mobi
*.pdf
*.pdf

27 changes: 27 additions & 0 deletions conf.py
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'
1 change: 1 addition & 0 deletions docs
5 changes: 5 additions & 0 deletions mkdocs.yml
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

0 comments on commit 878fa8c

Please sign in to comment.