Skip to content

Commit

Permalink
Update Chinese docs (#416)
Browse files Browse the repository at this point in the history
* Add Chinese docs

* update

* update

* update

* update

* Add Chinese docs for auto-generated documentation

* update
  • Loading branch information
ckkelvinchan authored Jul 7, 2021
1 parent 0091b7d commit 78ede6e
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 24 deletions.
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []

language = 'en'

# The master toctree document.
master_doc = 'index'

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Welcome to MMEditing's documentation!
=====================================

You can switch between Chinese and English documents in the bottom-left corner of the layout.
.. toctree::
:maxdepth: 2
:caption: Get Started
Expand Down
32 changes: 16 additions & 16 deletions docs/merge_docs.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/usr/bin/env bash

sed -i '$a\\n<br/><hr/>\n' ../configs/inpainting/*/*.md
sed -i '$a\\n<br/><hr/>\n' ../configs/mattors/*/*.md
sed -i '$a\\n<br/><hr/>\n' ../configs/restorers/*/*.md
sed -i '$a\\n<br/><hr/>\n' ../configs/synthesizers/*/*.md
sed -i '$a\\n<br/><hr/>\n' ../configs/inpainting/*/README.md
sed -i '$a\\n<br/><hr/>\n' ../configs/mattors/*/README.md
sed -i '$a\\n<br/><hr/>\n' ../configs/restorers/*/README.md
sed -i '$a\\n<br/><hr/>\n' ../configs/synthesizers/*/README.md

# gather models
cat ../configs/inpainting/*/*.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Inpainting Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >inpainting_models.md
cat ../configs/mattors/*/*.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Matting Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >mattors_models.md
cat ../configs/restorers/*/*.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Super-Resolution Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >restorers_models.md
cat ../configs/synthesizers/*/*.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Generation Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >synthesizers_models.md
cat ../configs/inpainting/*/README.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Inpainting Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >inpainting_models.md
cat ../configs/mattors/*/README.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Matting Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >mattors_models.md
cat ../configs/restorers/*/README.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Super-Resolution Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >restorers_models.md
cat ../configs/synthesizers/*/README.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Generation Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >synthesizers_models.md

# gather datasets
cat ../tools/data/generation/*.md > generation_datasets.md
cat ../tools/data/inpainting/*.md > inpainting_datasets.md
cat ../tools/data/matting/*.md > matting_datasets.md
cat ../tools/data/super-resolution/*.md > sr_datasets.md
cat ../tools/data/generation/README.md > generation_datasets.md
cat ../tools/data/inpainting/README.md > inpainting_datasets.md
cat ../tools/data/matting/README.md > matting_datasets.md
cat ../tools/data/super-resolution/README.md > sr_datasets.md

sed -i 's=(paired-pix2pix/README.md)=(#paired-dataset-for-pix2pix)=g' generation_datasets.md
sed -i 's=(unpaired-cyclegan/README.md)=(#unpaired-dataset-for-cyclegan)=g' generation_datasets.md
Expand All @@ -27,10 +27,10 @@ sed -i 's=(div2k/README.md)=(#div2k-dataset)=g' sr_datasets.md
sed -i 's=(reds/README.md)=(#reds-dataset)=g' sr_datasets.md
sed -i 's=(vimeo90k/README.md)=(#vimeo90k-dataset)=g' sr_datasets.md

cat ../tools/data/generation/*/*.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> generation_datasets.md
cat ../tools/data/inpainting/*/*.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> inpainting_datasets.md
cat ../tools/data/matting/*/*.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> matting_datasets.md
cat ../tools/data/super-resolution/*/*.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> sr_datasets.md
cat ../tools/data/generation/*/README.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> generation_datasets.md
cat ../tools/data/inpainting/*/README.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> inpainting_datasets.md
cat ../tools/data/matting/*/README.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> matting_datasets.md
cat ../tools/data/super-resolution/*/README.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> sr_datasets.md

# merge configs
cat config_*.md | sed "s/#/#&/" >> config.md
4 changes: 2 additions & 2 deletions docs/switch_language.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## English
## <a href='https://mmediting.readthedocs.io/en/latest/'>English</a>

## 简体中文
## <a href='https://mmediting.readthedocs.io/zh_CN/latest/'>简体中文</a>
2 changes: 2 additions & 0 deletions docs_zh-CN/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []

language = 'zh_CN'

# The master toctree document.
master_doc = 'index'

Expand Down
2 changes: 2 additions & 0 deletions docs_zh-CN/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Welcome to MMEditing's documentation!
=====================================

您可以在页面左下角切换中英文文档。

.. toctree::
:maxdepth: 2
:caption: 开始你的第一步
Expand Down
8 changes: 4 additions & 4 deletions docs_zh-CN/merge_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ sed -i 's=(div2k/README_zh-CN.md)=(#div2k-dataset)=g' sr_datasets.md
sed -i 's=(reds/README_zh-CN.md)=(#reds-dataset)=g' sr_datasets.md
sed -i 's=(vimeo90k/README_zh-CN.md)=(#vimeo90k-dataset)=g' sr_datasets.md

cat ../tools/data/generation/*/*_zh-CN.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> generation_datasets.md
cat ../tools/data/inpainting/*/*_zh-CN.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> inpainting_datasets.md
cat ../tools/data/matting/*/*_zh-CN.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> matting_datasets.md
cat ../tools/data/super-resolution/*/*_zh-CN.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> sr_datasets.md
cat ../tools/data/generation/*/*_zh-CN.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs_zh_CN\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> generation_datasets.md
cat ../tools/data/inpainting/*/*_zh-CN.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs_zh_CN\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> inpainting_datasets.md
cat ../tools/data/matting/*/*_zh-CN.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs_zh_CN\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> matting_datasets.md
cat ../tools/data/super-resolution/*/*_zh-CN.md | sed 's/# Preparing/# /g' | sed "s/#/#&/" | sed 's/](\/docs_zh_CN\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmediting/tree/master/=g' >> sr_datasets.md

# merge configs
cat config_*.md | sed "s/#/#&/" >> config.md
4 changes: 2 additions & 2 deletions docs_zh-CN/switch_language.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## English
## <a href='https://mmediting.readthedocs.io/en/latest/'>English</a>

## 简体中文
## <a href='https://mmediting.readthedocs.io/zh_CN/latest/'>简体中文</a>

0 comments on commit 78ede6e

Please sign in to comment.