Skip to content

Commit

Permalink
[Docs] Update indexing of config readme (open-mmlab#772)
Browse files Browse the repository at this point in the history
* modify stat.py merge_docs

* unify merge_docs style

* fix bugs

* fix bugs
  • Loading branch information
congee524 committed Mar 31, 2021
1 parent a6356a0 commit 78eb446
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 63 deletions.
45 changes: 14 additions & 31 deletions docs/merge_docs.sh
Expand Up @@ -2,6 +2,18 @@

sed -i '$a\\n' ../demo/README.md

# gather models
cat ../configs/localization/*/README.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Action Localization Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' > localization_models.md
cat ../configs/recognition/*/README.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Action Recognition Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' > recognition_models.md
cat ../configs/recognition_audio/*/README.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' >> recognition_models.md
cat ../configs/detection/*/README.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# Spatio Temporal Action Detection Models' | sed 's/](\/docs\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' > detection_models.md

# demo
cat ../demo/README.md | sed "s/md###t/html#t/g" | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' > demo.md

# gather datasets
cat ../tools/data/*/README.md | sed 's/# Preparing/# /g' | sed 's/#/#&/' > prepare_data.md

sed -i 's/(\/tools\/data\/activitynet\/README.md/(#activitynet/g' supported_datasets.md
sed -i 's/(\/tools\/data\/kinetics\/README.md/(#kinetics-400-600-700/g' supported_datasets.md
sed -i 's/(\/tools\/data\/mit\/README.md/(#moments-in-time/g' supported_datasets.md
Expand All @@ -18,42 +30,13 @@ sed -i 's/(\/tools\/data\/jester\/README.md/(#jester/g' supported_datasets.md
sed -i 's/(\/tools\/data\/ava\/README.md/(#ava/g' supported_datasets.md
sed -i 's/(\/tools\/data\/gym\/README.md/(#gym/g' supported_datasets.md

cat ../configs/localization/*/*.md > localization_models.md
cat ../configs/recognition/*/*.md > recognition_models.md
cat ../configs/recognition_audio/*/*.md >> recognition_models.md
cat ../configs/detection/*/*.md > detection_models.md
cat ../tools/data/*/README.md > prepare_data.md
cat ../demo/README.md > demo.md

sed -i 's/#/#&/' localization_models.md
sed -i 's/#/#&/' recognition_models.md
sed -i 's/#/#&/' detection_models.md
sed -i 's/md###t/html#t/g' localization_models.md
sed -i 's/md###t/html#t/g' recognition_models.md
sed -i 's/md###t/html#t/g' detection_models.md
sed -i "s/md###t/html#t/g" demo.md

sed -i 's/# Preparing/# /g' prepare_data.md
sed -i 's/#/#&/' prepare_data.md

sed -i '1i\# Action Localization Models' localization_models.md
sed -i '1i\# Action Recognition Models' recognition_models.md
sed -i '1i\# Spatio Temporal Action Detection Models' detection_models.md

cat prepare_data.md >> supported_datasets.md
sed -i 's/](\/docs\//](/g' supported_datasets.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' supported_datasets.md

sed -i 's/](\/docs\//](/g' recognition_models.md # remove /docs/ for link used in doc site
sed -i 's/](\/docs\//](/g' localization_models.md
sed -i 's/](\/docs\//](/g' detection_models.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' recognition_models.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' localization_models.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' detection_models.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' benchmark.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' getting_started.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' install.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' changelog.md
sed -i 's/](\/docs\//](/g' ./tutorials/*.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' ./tutorials/*.md
sed -i 's/](\/docs\//](/g' supported_datasets.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' supported_datasets.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' demo.md
45 changes: 13 additions & 32 deletions docs_zh_CN/merge_docs.sh
@@ -1,4 +1,12 @@
#!/usr/bin/env bash
# gather models
cat ../configs/localization/*/README_zh-CN.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# 时序动作检测模型' | sed 's/](\/docs_zh_CN\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' > localization_models.md
cat ../configs/recognition/*/README_zh-CN.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# 动作识别模型' | sed 's/](\/docs_zh_CN\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' > recognition_models.md
cat ../configs/recognition_audio/*/README_zh-CN.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed 's/](\/docs_zh_CN\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' >> recognition_models.md
cat ../configs/detection/*/README_zh-CN.md | sed "s/md###t/html#t/g" | sed "s/#/#&/" | sed '1i\# 时空动作检测模型' | sed 's/](\/docs_zh_CN\//](/g' | sed 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' > detection_models.md

# gather datasets
cat ../tools/data/*/README_zh-CN.md | sed 's/# 准备/# /g' | sed 's/#/#&/' > prepare_data.md

sed -i 's/(\/tools\/data\/activitynet\/README_zh-CN.md/(#activitynet/g' supported_datasets.md
sed -i 's/(\/tools\/data\/kinetics\/README_zh-CN.md/(#kinetics-400-600-700/g' supported_datasets.md
Expand All @@ -16,41 +24,14 @@ sed -i 's/(\/tools\/data\/jester\/README_zh-CN.md/(#jester/g' supported_datasets
sed -i 's/(\/tools\/data\/ava\/README_zh-CN.md/(#ava/g' supported_datasets.md
sed -i 's/(\/tools\/data\/gym\/README_zh-CN.md/(#gym/g' supported_datasets.md

cat ../configs/localization/*/*.md > localization_models.md
cat ../configs/recognition/*/*.md > recognition_models.md
cat ../configs/recognition_audio/*/*.md >> recognition_models.md
cat ../configs/detection/*/*.md > detection_models.md
cat ../tools/data/*/README_zh-CN.md > prepare_data.md

sed -i 's/#/#&/' localization_models.md
sed -i 's/#/#&/' recognition_models.md
sed -i 's/#/#&/' detection_models.md
sed -i 's/md###t/html#t/g' localization_models.md
sed -i 's/md###t/html#t/g' recognition_models.md
sed -i 's/md###t/html#t/g' detection_models.md
sed -i "s/md###t/html#t/g" demo.md

sed -i 's/# 准备/# /g' prepare_data.md
sed -i 's/#/#&/' prepare_data.md

sed -i '1i\# 时序动作检测模型' localization_models.md
sed -i '1i\# 动作识别模型' recognition_models.md
sed -i '1i\# 时空动作检测模型' detection_models.md

cat prepare_data.md >> supported_datasets.md
sed -i 's/](\/docs_zh_CN\//](/g' supported_datasets.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' supported_datasets.md

sed -i 's/](\/docs\//](/g' recognition_models.md # remove /docs/ for link used in doc site
sed -i 's/](\/docs\//](/g' localization_models.md
sed -i 's/](\/docs\//](/g' detection_models.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' recognition_models.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' localization_models.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' detection_models.md
sed -i "s/md###t/html#t/g" demo.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' demo.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' benchmark.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' getting_started.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' install.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' changelog.md
sed -i 's/](\/docs\//](/g' ./tutorials/*.md
sed -i 's/](\/docs_zh_CN\//](/g' ./tutorials/*.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' ./tutorials/*.md
sed -i 's/](\/docs\//](/g' supported_datasets.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' supported_datasets.md
sed -i 's=](/=](https://github.com/open-mmlab/mmaction2/tree/master/=g' demo.md

0 comments on commit 78eb446

Please sign in to comment.