From 4e6f2ebced83353c296410833c9f42f5b0d5f3f7 Mon Sep 17 00:00:00 2001 From: Junjun2016 Date: Sat, 18 Sep 2021 18:36:43 +0800 Subject: [PATCH] [Docs] Use Chinese menu (#880) * Use Chinese menu * replace \ with / --- docs/conf.py | 15 ++++++++++++++- docs_zh-CN/conf.py | 25 +++++++++++++++++++------ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4353266ce6..50c425fdf7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,6 +50,10 @@ def get_version(): 'matplotlib', 'pycocotools', 'mmseg.version', 'mmcv.ops' ] +# Ignore >>> when copying code +copybutton_prompt_text = r'>>> |\.\.\. ' +copybutton_prompt_is_regexp = True + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -78,7 +82,8 @@ def get_version(): html_theme = 'pytorch_sphinx_theme' html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()] html_theme_options = { - # 'logo_url': 'https://mmsegmentation.readthedocs.io/en/latest/', + 'logo_url': + 'https://mmsegmentation.readthedocs.io/en/latest/', 'menu': [ { 'name': @@ -156,6 +161,14 @@ def get_version(): 'name': 'GitHub', 'url': 'https://github.com/open-mmlab/' }, + { + 'name': 'Twitter', + 'url': 'https://twitter.com/OpenMMLab' + }, + { + 'name': 'Zhihu', + 'url': 'https://zhihu.com/people/openmmlab' + }, ] }, ] diff --git a/docs_zh-CN/conf.py b/docs_zh-CN/conf.py index f7f47bf8a9..4cb2bfb899 100644 --- a/docs_zh-CN/conf.py +++ b/docs_zh-CN/conf.py @@ -50,6 +50,10 @@ def get_version(): 'matplotlib', 'pycocotools', 'mmseg.version', 'mmcv.ops' ] +# Ignore >>> when copying code +copybutton_prompt_text = r'>>> |\.\.\. ' +copybutton_prompt_is_regexp = True + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -78,11 +82,12 @@ def get_version(): html_theme = 'pytorch_sphinx_theme' html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()] html_theme_options = { - # 'logo_url': 'https://mmsegmentation.readthedocs.io/en/latest/', + 'logo_url': + 'https://mmsegmentation.readthedocs.io/zh-CN/latest/', 'menu': [ { 'name': - 'Tutorial', + '教程', 'url': 'https://github.com/open-mmlab/mmsegmentation/blob/master/' 'demo/MMSegmentation_Tutorial.ipynb' @@ -93,18 +98,18 @@ def get_version(): }, { 'name': - 'Upstream', + '上游库', 'children': [ { 'name': 'MMCV', 'url': 'https://github.com/open-mmlab/mmcv', - 'description': 'Foundational library for computer vision' + 'description': '基础视觉库' }, ] }, { 'name': - 'Projects', + '算法库', 'children': [ { 'name': 'MMAction2', @@ -149,13 +154,21 @@ def get_version(): 'OpenMMLab', 'children': [ { - 'name': 'Homepage', + 'name': '官网', 'url': 'https://openmmlab.com/' }, { 'name': 'GitHub', 'url': 'https://github.com/open-mmlab/' }, + { + 'name': '推特', + 'url': 'https://twitter.com/OpenMMLab' + }, + { + 'name': '知乎', + 'url': 'https://zhihu.com/people/openmmlab' + }, ] }, ]