Skip to content

Commit

Permalink
20-06-18
Browse files Browse the repository at this point in the history
update README

clean deploy.yml

finish setting up github action
  • Loading branch information
TonyCrane committed Jun 18, 2020
1 parent d0e803b commit 54f6fbb
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 42 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build up document

on:
push:
branches: [ master ]
branches: [ master, manim ]

jobs:
build_docs_and_deploy:
Expand All @@ -16,11 +16,11 @@ jobs:
- name: Clone pre repositories
run: |
cd ..
git clone https://github.com/manim-kindergarten/manim.git
git clone -b manim https://github.com/manim-kindergarten/manim_document_zh.git manim
cd manim
git clone https://github.com/manim-kindergarten/manim_sandbox.git
- name: install setuptools
- name: Install setuptools
run: |
cd ..
pip3 install --upgrade pip
Expand All @@ -29,11 +29,8 @@ jobs:
cd setuptools-19.6
sudo python3 setup.py build
sudo python3 setup.py install
echo "finish installing setuptools"
pip3 list
export PATH="$PATH:/home/runner/.local/bin"
- name: install sphinx
- name: Install sphinx
run: |
cd ..
git clone https://github.com/sphinx-doc/sphinx
Expand All @@ -42,25 +39,20 @@ jobs:
pip3 install sphinx_rtd_theme
pip3 install jieba
- name: install manim env
- name: Install manim env
run: |
cd ../manim
pip3 install -r requirements.txt
cd ..
- name: build sphinx doc
- name: Build document with Sphinx
run: |
export PATH="$PATH:/home/runner/.local/bin:/home/runner/manim_document_zh/manim"
export PYTHONPATH="$PYTHONPATH:/home/runner/manim_document_zh/manim"
sudo apt install tree -y
cd ../../
tree -L 4
cd manim_document_zh/manim_document_zh
make html
cd build/html
echo "manim.ml" > CNAME
- name: Build up and deploy
- name: Deploy to GitHub pages
uses: JamesIves/github-pages-deploy-action@master
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
Expand Down
66 changes: 39 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
[![manim_document_zh](source/assets/image/DocumentHeader.png)](https://github.com/manim-kindergarten/manim_document_zh)

![Build up document](https://github.com/manim-kindergarten/manim_document_zh/workflows/Build%20up%20document/badge.svg)
[![GPL License](https://img.shields.io/github/license/manim-kindergarten/manim_document_zh)](https://choosealicense.com/licenses/gpl-3.0/)
![QQ](https://img.shields.io/badge/QQ-862671480-red.svg?style=flat)
[![manim_sandbox](https://img.shields.io/badge/mk-manim__sandbox-brightgreen.svg)](https://github.com/manim-kindergarten/manim_sandbox/)
[![manim](https://img.shields.io/badge/manim-ver.MK-orange.svg)](https://github.com/manim-kindergarten/manim)
[![tutorial](https://img.shields.io/badge/tutorial-on_bilibili-ff69b4.svg)](https://space.bilibili.com/171431343/favlist?fid=947158443)

[manim-kindergarten](https://github.com/manim-kindergarten/)成员整理的一份manim中文文档教程,目前还在完善当中。如果关于文档内容有问题,可以在这个repo中提出issue。
如果你想要为这个文档做出贡献,可以提交pr。

[manim-kindergarten](https://github.com/manim-kindergarten/)成员整理的一份manim中文文档教程
[`manim`](https://github.com/manim-kindergarten/manim_document_zh/tree/manim)分支中为带有文档字符串的manim源码,用于文档中自动构建文档字符串。

### 文档地址
## 文档地址
https://manim.ml/

还在完善中,目前完成情况:
Expand All @@ -23,14 +26,43 @@ https://manim.ml/
- [x] camera
- [x] utils

### 关于构建文档
## 关于文档构建
当前这个repo使用了[GitHub Actions](https://github.com/features/actions)自动构建文档。当向`master``manim`分支`push`后,会自动触发。

python安装Sphinx之后`make html`,生成网页。
`make pdf`则是生成pdf,配置文件是conf.py,可以修改主题。
使用`Sphinx`构建文档,并部署在[GitHub Pages](https://manim.ml/)

html文档支持中文搜索,需要安装sphinx插件要安装```pip install jieba```
### 手动构建文档

不习惯reStructuredText语法的可以pandoc把markdown等文件转换rst,或者JupyterNoteBook把py等文件转换rst。
**Step 1.** 安装环境:
- 确保安装了[manim](https://github.com/3b1b/manim/)环境
- `pip install sphinx`安装Sphinx
- `pip install sphinx_rtd_theme`安装rtd样式
- `pip install jieba`使支持中文搜索

**Step 2.** 准备目录结构:
```text
.
├── manim/
│ ├── manimlib/
│ ├── manim_sandbox/
│ ├── ...
│ └── manim.py
└── manim_document_zh/
├── source/
│ ├── ...
│ └── conf.py
├── ...
├── make.bat
└── Makefile
```

**Step 3.** 构建文档:

`manim_document_zh`文件夹中执行`make html`构建文档

**附.** 文件格式转换:

sphinx要求使用rst格式(reStructuredText语法),可以使用pandoc把markdown等文件转换rst,或者JupyterNoteBook把py等文件转换rst。

```bash
pandoc readme.md --from markdown --to rst -s -o readme.rst
Expand All @@ -50,23 +82,3 @@ output = pypandoc.convert_file('somefile.md', 'rst').replace("\r", "")
with open("outputfile.rst", "w", encoding="utf8") as f:
f.write(output)
```

### 关于目录结构

由于很多地方根据[manim](https://github.com/3b1b/manim/)源码和[manim_sandbox](https://github.com/manim-kindergarten/manim_sandbox/)源码自动构建,推荐的目录结构如下:

```text
.
├── manim/
│ ├── manimlib/
│ ├── manim_sandbox/
│ ├── ...
│ └── manim.py
└── manim_document_zh/
├── source/
│ ├── ...
│ └──conf.py
├── ...
├── make.bat
└── Makefile
```

0 comments on commit 54f6fbb

Please sign in to comment.