[Docs] Use myst parser ()

* add myst-parser extension for sphinx

* make note style more beautiful
pull/1183/merge
Zaida Zhou 2021-08-22 09:44:51 +08:00 committed by GitHub
parent 259ea5f63f
commit aa64ee6a7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 29 additions and 14 deletions
docs_zh_CN
requirements

View File

@ -12,8 +12,9 @@ All kinds of contributions are welcome, including but not limited to the followi
3. commit your changes
4. create a PR
Note: If you plan to add some new features that involve large changes, it is encouraged to open an issue for discussion first.
```{note}
If you plan to add some new features that involve large changes, it is encouraged to open an issue for discussion first.
```
### Code style
#### Python

View File

@ -44,7 +44,9 @@
git checkout -b branchname
```
NOTE: To make commit history clear, we strongly recommend you checkout the master branch before create a new branch.
```{tip}
To make commit history clear, we strongly recommend you checkout the master branch before create a new branch.
```
3. Commit your changes
```bash

View File

@ -49,9 +49,9 @@ extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'recommonmark',
'sphinx.ext.autosectionlabel',
'sphinx_markdown_tables'
'sphinx_markdown_tables',
'myst_parser',
] # yapf: disable
autodoc_mock_imports = ['mmcv._ext', 'mmcv.utils.ext_loader', 'torchvision']

View File

@ -35,10 +35,11 @@ e.g.,
CC=clang CXX=clang++ CFLAGS='-stdlib=libc++' MMCV_WITH_OPS=1 pip install -e .
```
Note: If you would like to use `opencv-python-headless` instead of `opencv-python`,
```{note}
If you would like to use `opencv-python-headless` instead of `opencv-python`,
e.g., in a minimum container environment or servers without GUI,
you can first install it before installing MMCV to skip the installation of `opencv-python`.
```
### Build on Windows
Building MMCV on Windows is a bit more complicated than that on Linux.
@ -203,7 +204,9 @@ pip list
$env:TORCH_CUDA_ARCH_LIST="3.5 3.7 5.0 5.2 6.0 6.1 7.0 7.5"
```
Note: Check your the compute capability of your GPU from [here](https://developer.nvidia.com/cuda-gpus).
```{note}
Check your the compute capability of your GPU from [here](https://developer.nvidia.com/cuda-gpus).
```
1. Launch compiling the same way as CPU

View File

@ -5,7 +5,9 @@ There are two versions of MMCV:
- **mmcv-full**: comprehensive, with full features and various CUDA ops out of box. It takes longer time to build.
- **mmcv**: lite, without CUDA ops but all other features, similar to mmcv<1.0.0. It is useful when you do not need those CUDA ops.
**Note**: Do not install both versions in the same environment, otherwise you may encounter errors like `ModuleNotFound`. You need to uninstall one before installing the other. `Installing the full verion is highly recommended if CUDA is avaliable`.
```{warning}
Do not install both versions in the same environment, otherwise you may encounter errors like `ModuleNotFound`. You need to uninstall one before installing the other. `Installing the full verion is highly recommended if CUDA is avaliable`.
```
a. Install the full version.

View File

@ -28,4 +28,6 @@ It provides the following functionalities.
- Various CNN architectures
- High-quality implementation of common CUDA ops
Note: MMCV requires Python 3.6+.
```{note}
MMCV requires Python 3.6+.
```

View File

@ -85,9 +85,11 @@ def build_converter(cfg, registry, *args, **kwargs):
CONVERTERS = Registry('converter', build_func=build_converter)
```
Note: in this example, we demonstrate how to use the `build_func` argument to customize the way to build a class instance.
```{note}
In this example, we demonstrate how to use the `build_func` argument to customize the way to build a class instance.
The functionality is similar to the default `build_from_cfg`. In most cases, default one would be sufficient.
`build_model_from_cfg` is also implemented to build PyTorch module in `nn.Sequentail`, you may directly use them instead of implementing by yourself.
```
### Hierarchy Registry

View File

@ -49,9 +49,9 @@ extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'recommonmark',
'sphinx.ext.autosectionlabel',
'sphinx_markdown_tables'
'sphinx_markdown_tables',
'myst_parser',
] # yapf: disable
autodoc_mock_imports = ['mmcv._ext', 'mmcv.utils.ext_loader', 'torchvision']

View File

@ -31,4 +31,6 @@ MMCV 提供了如下众多功能:
如想了解更多特性和使用,请参考[文档](https://mmcv.readthedocs.io/zh_CN/latest)。
提示: MMCV 需要 Python 3.6 以上版本。
```{note}
MMCV 需要 Python 3.6 以上版本。
```

View File

@ -1,4 +1,5 @@
m2r
myst-parser
opencv-python
sphinx
sphinx_markdown_tables