[Docs] Add version selection in the banner. (#1217)

* [Docs] Add version selection in the banner.

* Small fix.
pull/1232/head
Ma Zerun 2022-11-23 13:38:23 +08:00 committed by GitHub
parent 75e502ed75
commit f9be21ab74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 58 additions and 73 deletions

View File

@ -46,3 +46,6 @@ load_from = None
# whether to resume training from the loaded checkpoint
resume = False
# Defaults to use random seed and disable `deterministic`
randomness = dict(seed=None, deterministic=False)

View File

@ -31,3 +31,7 @@ img.align-center {
margin-left: auto;
margin-right: auto;
}
article.pytorch-article p.rubric {
font-weight: bold;
}

View File

@ -29,6 +29,7 @@ Multi Label Metric
.. autosummary::
:toctree: generated
:nosignatures:
:template: classtemplate.rst
AveragePrecision
MultiLabelMetric

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,7 +87,7 @@ 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 = {
'menu': [
{
@ -94,35 +95,32 @@ html_theme_options = {
'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 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 shell commands',
'url': 'https://colab.research.google.com/github/mzr1996/mmclassification-tutorial/blob/master/1.x/MMClassification_tools.ipynb'},
{'name': 'Train and inference with Python APIs',
'url': 'https://colab.research.google.com/github/mzr1996/mmclassification-tutorial/blob/master/1.x/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',
# Disable the default edit on GitHub
'default_edit_on_github':
False,
'default_edit_on_github': False,
}
# 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,
@ -156,23 +154,6 @@ latex_elements = {
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
'preamble':
r'''
\hypersetup{unicode=true}
\usepackage{CJKutf8}
\DeclareUnicodeCharacter{00A0}{\nobreakspace}
\DeclareUnicodeCharacter{2203}{\ensuremath{\exists}}
\DeclareUnicodeCharacter{2200}{\ensuremath{\forall}}
\DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}}
\DeclareUnicodeCharacter{2713}{x}
\DeclareUnicodeCharacter{27FA}{\ensuremath{\Longleftrightarrow}}
\DeclareUnicodeCharacter{221A}{\ensuremath{\sqrt{}}}
\DeclareUnicodeCharacter{221B}{\ensuremath{\sqrt[3]{}}}
\DeclareUnicodeCharacter{2295}{\ensuremath{\oplus}}
\DeclareUnicodeCharacter{2297}{\ensuremath{\otimes}}
\begin{CJK}{UTF8}{gbsn}
\AtEndDocument{\end{CJK}}
''',
}
# Grouping the document tree into LaTeX files. List of tuples
@ -258,7 +239,8 @@ notfound_template = '404.html'
def builder_inited_handler(app):
subprocess.run(['./stat.py'])
if subprocess.run(['./stat.py']).returncode != 0:
raise RuntimeError('Failed to run the script `stat.py`.')
def setup(app):

View File

@ -1,10 +1,6 @@
Welcome to MMClassification's documentation!
============================================
You can switch between Chinese and English documentation in the lower-left corner of the layout.
您可以在页面左下角切换中英文文档。
.. toctree::
:maxdepth: 1
:caption: Get Started

View File

@ -31,3 +31,7 @@ img.align-center {
margin-left: auto;
margin-right: auto;
}
article.pytorch-article p.rubric {
font-weight: bold;
}

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,7 +87,7 @@ 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 = {
'menu': [
{
@ -94,35 +95,32 @@ html_theme_options = {
'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':
'用 Python API 训练和推理',
'url':
'https://colab.research.google.com/github/'
'open-mmlab/mmclassification/blob/master/docs/zh_CN/'
'tutorials/MMClassification_python_cn.ipynb',
},
{'name': '用命令行工具训练和推理',
'url': 'https://colab.research.google.com/github/mzr1996/mmclassification-tutorial/blob/master/1.x/MMClassification_tools.ipynb'},
{'name': '用 Python API 训练和推理',
'url': 'https://colab.research.google.com/github/mzr1996/mmclassification-tutorial/blob/master/1.x/MMClassification_python.ipynb'},
]
},
{
'name': 'Version',
'children': [
{'name': 'MMClassification 0.x',
'url': 'https://mmclassification.readthedocs.io/zh_CN/latest/',
'description': 'master branch'},
{'name': 'MMClassification 1.x',
'url': 'https://mmclassification.readthedocs.io/zh_CN/dev-1.x/',
'description': '1.x branch'},
],
}
],
# Specify the language of shared menu
'menu_lang':
'cn',
'menu_lang': 'cn',
# Disable the default edit on GitHub
'default_edit_on_github':
False,
'default_edit_on_github': False,
}
# 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,
@ -245,7 +243,8 @@ notfound_template = '404.html'
def builder_inited_handler(app):
subprocess.run(['./stat.py'])
if subprocess.run(['./stat.py']).returncode != 0:
raise RuntimeError('Failed to run the script `stat.py`.')
def setup(app):

View File

@ -1,10 +1,6 @@
欢迎来到 MMClassification 中文教程!
==========================================
You can switch between Chinese and English documentation in the lower-left corner of the layout.
您可以在页面左下角切换中英文文档。
.. toctree::
:maxdepth: 1
:caption: 开始你的第一步