diff --git a/docs/en/conf.py b/docs/en/conf.py index 301696b38f6..aa1d9f4728f 100644 --- a/docs/en/conf.py +++ b/docs/en/conf.py @@ -1,3 +1,4 @@ +# flake8: noqa # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full @@ -87,41 +88,58 @@ def get_version(): # further. For a list of options available for each theme, see the # documentation. # +# yapf: disable html_theme_options = { - 'logo_url': - 'https://mmclassification.readthedocs.io/en/latest/', + 'logo_url': 'https://mmclassification.readthedocs.io/en/latest/', 'menu': [ { 'name': 'GitHub', 'url': 'https://github.com/open-mmlab/mmclassification' }, { - 'name': - 'Colab Tutorials', + 'name': 'Colab Tutorials', 'children': [ { - 'name': - 'Train and inference with shell commands', - 'url': - 'https://colab.research.google.com/github/' - 'open-mmlab/mmclassification/blob/master/docs/en/' - 'tutorials/MMClassification_tools.ipynb', + 'name': 'Train and inference with shell commands', + 'url': 'https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb', }, { - 'name': - 'Train and inference with Python APIs', - 'url': - 'https://colab.research.google.com/github/' - 'open-mmlab/mmclassification/blob/master/docs/en/' - 'tutorials/MMClassification_python.ipynb', + 'name': 'Train and inference with Python APIs', + 'url': 'https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb', }, ] }, + { + 'name': 'Version', + 'children': [ + { + 'name': 'MMClassification 0.x', + 'url': 'https://mmclassification.readthedocs.io/en/latest/', + 'description': 'master branch' + }, + { + 'name': 'MMClassification 1.x', + 'url': 'https://mmclassification.readthedocs.io/en/dev-1.x/', + 'description': '1.x branch' + }, + ], + } ], # Specify the language of shared menu - 'menu_lang': - 'en' + 'menu_lang': 'en', + 'header_note': { + 'content': + 'You are reading the documentation for MMClassification 0.x, which ' + 'will soon be deprecated at the end of 2022. We recommend you upgrade ' + 'to MMClassification 1.0 to enjoy fruitful new features and better ' + 'performance brought by OpenMMLab 2.0. Check the ' + 'installation tutorial, ' + 'migration tutorial ' + 'and changelog ' + 'for more details.', + } } +# yapf: enable # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/docs/zh_CN/conf.py b/docs/zh_CN/conf.py index 71daf28b028..31d94e55411 100644 --- a/docs/zh_CN/conf.py +++ b/docs/zh_CN/conf.py @@ -1,3 +1,4 @@ +# flake8: noqa # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full @@ -86,42 +87,56 @@ def get_version(): # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -# +# yapf: disable html_theme_options = { - 'logo_url': - 'https://mmclassification.readthedocs.io/zh_CN/latest/', + 'logo_url': 'https://mmclassification.readthedocs.io/zh_CN/latest/', 'menu': [ { 'name': 'GitHub', 'url': 'https://github.com/open-mmlab/mmclassification' }, { - 'name': - 'Colab 教程', + 'name': 'Colab 教程', 'children': [ { - 'name': - '用命令行工具训练和推理', - 'url': - 'https://colab.research.google.com/github/' - 'open-mmlab/mmclassification/blob/master/docs/zh_CN/' - 'tutorials/MMClassification_tools_cn.ipynb', + 'name': '用命令行工具训练和推理', + 'url': 'https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb', }, { - 'name': - '用 Python API 训练和推理', - 'url': - 'https://colab.research.google.com/github/' - 'open-mmlab/mmclassification/blob/master/docs/zh_CN/' - 'tutorials/MMClassification_python_cn.ipynb', + 'name': '用 Python API 训练和推理', + 'url': 'https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb', }, ] }, + { + 'name': '版本', + 'children': [ + { + 'name': 'MMClassification 0.x', + 'url': 'https://mmclassification.readthedocs.io/zh_CN/latest/', + 'description': 'master 分支' + }, + { + 'name': 'MMClassification 1.x', + 'url': 'https://mmclassification.readthedocs.io/zh_CN/dev-1.x/', + 'description': '1.x 分支' + }, + ], + } ], # Specify the language of shared menu - 'menu_lang': - 'cn', + 'menu_lang': 'cn', + 'header_note': { + 'content': + '您正在阅读 MMClassification 0.x 版本的文档。MMClassification 0.x 会在 2022 年末' + '被切换为次要分支。建议您升级到 MMClassification 1.0 版本,体验更多新特性和新功能。' + '请查阅 MMClassification 1.0 的' + '安装教程、' + '迁移教程' + '以及更新日志。', + } } +# yapf: enable # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/requirements/docs.txt b/requirements/docs.txt index 41b221f05cb..a2d2c5317b4 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,6 +1,6 @@ docutils==0.17.1 myst-parser --e git+https://github.com/open-mmlab/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme +git+https://github.com/open-mmlab/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme sphinx==4.5.0 sphinx-copybutton sphinx_markdown_tables