[Docs] Add version banner and version warning in master docs. (#1216)

pull/1249/head
Ma Zerun 2022-12-05 14:13:25 +08:00 committed by GitHub
parent 578c035d5c
commit 838735820c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 38 deletions

View File

@ -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 @@ html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
# 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 '
'<a href="https://mmclassification.readthedocs.io/en/dev-1.x/get_started.html#installation">installation tutorial</a>, '
'<a href="https://mmclassification.readthedocs.io/en/dev-1.x/migration.html">migration tutorial</a> '
'and <a href="https://mmclassification.readthedocs.io/en/dev-1.x/notes/changelog.html">changelog</a> '
'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,

View File

@ -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 @@ html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
# 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 的'
'<a href="https://mmclassification.readthedocs.io/zh_CN/dev-1.x/get_started.html#installation">安装教程</a>、'
'<a href="https://mmclassification.readthedocs.io/zh_CN/dev-1.x/migration.html">迁移教程</a>'
'以及<a href="https://mmclassification.readthedocs.io/en/dev-1.x/notes/changelog.html">更新日志</a>。',
}
}
# 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,

View File

@ -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