[Docs] Use pytorch sphinx theme (#89)

* use pytorch sphinx theme

* update readme

* fix yaml format

* change the log
pull/92/head
Zaida Zhou 2021-12-07 14:15:19 +08:00 committed by GitHub
parent 622cc8a7b1
commit de026a72ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 153 additions and 16 deletions

2
.gitignore vendored
View File

@ -142,3 +142,5 @@ cython_debug/
data/
*ipynb
src/

View File

@ -424,3 +424,21 @@ We appreciate all contributions to improve mim. Please refer to [CONTRIBUTING.md
## License
This project is released under the [Apache 2.0 license](LICENSE).
## Projects in OpenMMLab
- [MMCV](https://github.com/open-mmlab/mmcv): OpenMMLab foundational library for computer vision.
- [MIM](https://github.com/open-mmlab/mim): MIM Installs OpenMMLab Packages.
- [MMClassification](https://github.com/open-mmlab/mmclassification): OpenMMLab image classification toolbox and benchmark.
- [MMDetection](https://github.com/open-mmlab/mmdetection): OpenMMLab detection toolbox and benchmark.
- [MMDetection3D](https://github.com/open-mmlab/mmdetection3d): OpenMMLab's next-generation platform for general 3D object detection.
- [MMSegmentation](https://github.com/open-mmlab/mmsegmentation): OpenMMLab semantic segmentation toolbox and benchmark.
- [MMAction2](https://github.com/open-mmlab/mmaction2): OpenMMLab's next-generation action understanding toolbox and benchmark.
- [MMTracking](https://github.com/open-mmlab/mmtracking): OpenMMLab video perception toolbox and benchmark.
- [MMPose](https://github.com/open-mmlab/mmpose): OpenMMLab pose estimation toolbox and benchmark.
- [MMEditing](https://github.com/open-mmlab/mmediting): OpenMMLab image and video editing toolbox.
- [MMOCR](https://github.com/open-mmlab/mmocr): A comprehensive toolbox for text detection, recognition and understanding.
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab image and video generative models toolbox.
- [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab optical flow toolbox and benchmark.
- [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab fewshot learning toolbox and benchmark.
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 3D human parametric model toolbox and benchmark.

View File

@ -0,0 +1,6 @@
.header-logo {
background-image: url("../image/mim-logo.png");
background-size: 85px 40px;
height: 40px;
width: 85px;
}

BIN
docs/_static/image/mim-logo.png vendored 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -1,4 +1,4 @@
API Documentation
API Reference
=================
install

View File

@ -16,7 +16,7 @@ import sys
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
import sphinx_rtd_theme
import pytorch_sphinx_theme
sys.path.insert(0, os.path.abspath('..'))
@ -35,6 +35,7 @@ def get_version():
# The full version, including alpha/beta/rc tags
version = get_version()
release = get_version()
# -- General configuration ---------------------------------------------------
@ -44,9 +45,12 @@ release = get_version()
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinxcontrib.napoleon',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
]
'sphinx_markdown_tables',
'myst_parser',
'sphinx_copybutton',
] # yapf: disable
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@ -61,9 +65,114 @@ pygments_style = 'sphinx'
# -- Options for HTML output -------------------------------------------------
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = 'pytorch_sphinx_theme'
html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
html_theme_options = {
'menu': [
{
'name': 'GitHub',
'url': 'https://github.com/open-mmlab/mmcv'
},
{
'name':
'Docs',
'children': [
{
'name': 'MMCV',
'url': 'https://mmcv.readthedocs.io/en/latest/',
},
{
'name': 'MIM',
'url': 'https://openmim.readthedocs.io/en/latest/'
},
{
'name': 'MMAction2',
'url': 'https://mmaction2.readthedocs.io/en/latest/',
},
{
'name': 'MMClassification',
'url':
'https://mmclassification.readthedocs.io/en/latest/',
},
{
'name': 'MMDetection',
'url': 'https://mmdetection.readthedocs.io/en/latest/',
},
{
'name': 'MMDetection3D',
'url': 'https://mmdetection3d.readthedocs.io/en/latest/',
},
{
'name': 'MMEditing',
'url': 'https://mmediting.readthedocs.io/en/latest/',
},
{
'name': 'MMGeneration',
'url': 'https://mmgeneration.readthedocs.io/en/latest/',
},
{
'name': 'MMOCR',
'url': 'https://mmocr.readthedocs.io/en/latest/',
},
{
'name': 'MMPose',
'url': 'https://mmpose.readthedocs.io/en/latest/',
},
{
'name': 'MMSegmentation',
'url': 'https://mmsegmentation.readthedocs.io/en/latest/',
},
{
'name': 'MMTracking',
'url': 'https://mmtracking.readthedocs.io/en/latest/',
},
{
'name': 'MMFlow',
'url': 'https://mmflow.readthedocs.io/en/latest/',
},
{
'name': 'MMFewShot',
'url': 'https://mmfewshot.readthedocs.io/en/latest/',
},
{
'name': 'MMHuman3D',
'url': 'https://mmhuman3d.readthedocs.io/en/latest/',
},
]
},
{
'name':
'OpenMMLab',
'children': [
{
'name': 'Homepage',
'url': 'https://openmmlab.com/'
},
{
'name': 'GitHub',
'url': 'https://github.com/open-mmlab/'
},
{
'name': 'Twitter',
'url': 'https://twitter.com/OpenMMLab'
},
{
'name': 'Zhihu',
'url': 'https://zhihu.com/people/openmmlab'
},
]
},
]
}
# 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,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = ['css/readthedocs.css']
# -- Extension configuration -------------------------------------------------
# Ignore >>> when copying code
copybutton_prompt_text = r'>>> |\.\.\. '
copybutton_prompt_is_regexp = True

View File

@ -1,8 +1,8 @@
# Customization
## Customization
You can customize MIM using the `~/.mimrc` file, which should be placed in your home directory.
## Customize Default Values of MIM commands
### Customize Default Values of MIM commands
You can customize the default values of MIM commands with `~/.mimrc`:

View File

@ -1,8 +1,3 @@
.. mim documentation master file, created by
sphinx-quickstart on Mon May 17 21:16:26 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to mim's documentation!
=================================
@ -10,6 +5,9 @@ Welcome to mim's documentation!
:maxdepth: 2
:caption: Contents
installation.md
customization.md
abbreviation.md
api.rst
Indices and tables

View File

@ -1,2 +1,6 @@
sphinx_rtd_theme
sphinxcontrib-napoleon
docutils==0.16.0
myst-parser
-e git+https://github.com/open-mmlab/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
sphinx==4.0.2
sphinx-copybutton
sphinx_markdown_tables

View File

@ -14,7 +14,7 @@ line_length = 79
multi_line_output = 3
known_first_party = mim
known_standard_library = pkg_resources,setuptools,logging,os,warnings,abc
known_third_party = click,modelindex,pandas,pip,pytest,requests,sphinx_rtd_theme,tabulate
known_third_party = click,modelindex,pandas,pip,pytest,pytorch_sphinx_theme,requests,tabulate
no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
include_trailing_comma = true