Skip to content

Commit

Permalink
[Docs] Fix API reference & version, support exporting pdf & epub (#406)
Browse files Browse the repository at this point in the history
* add mmdet

* remove uncessary autodoc mock import

* update docs version

* bind docs version to version.py

* support pdf and epub

* fix readthedocs
  • Loading branch information
gaotongxiao authored Aug 4, 2021
1 parent b812b7a commit 7b16754
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 48 deletions.
2 changes: 2 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: 2

formats: all

python:
version: 3.7
install:
Expand Down
30 changes: 6 additions & 24 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
author = 'OpenMMLab'

# The full version, including alpha/beta/rc tags
release = '0.1.0'
version_file = '../mmocr/version.py'
with open(version_file, 'r') as f:
exec(compile(f.read(), version_file, 'exec'))
__version__ = locals()['__version__']
release = __version__

# -- General configuration ---------------------------------------------------

Expand All @@ -38,29 +42,7 @@
'sphinx_markdown_tables',
]

autodoc_mock_imports = [
'torch',
'torchvision',
'mmcv',
'mmocr.version',
'mmdet',
'imgaug',
'kwarray',
'lmdb',
'matplotlib',
'Polygon',
'cv2',
'numpy',
'pyclipper',
'pycocotools',
'pytest',
'rapidfuzz',
'scipy',
'shapely',
'skimage',
'titlecase',
'PIL',
]
autodoc_mock_imports = ['mmcv._ext']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
30 changes: 6 additions & 24 deletions docs_zh_CN/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
author = 'OpenMMLab'

# The full version, including alpha/beta/rc tags
release = '0.1.0'
version_file = '../mmocr/version.py'
with open(version_file, 'r') as f:
exec(compile(f.read(), version_file, 'exec'))
__version__ = locals()['__version__']
release = __version__

# -- General configuration ---------------------------------------------------

Expand All @@ -38,29 +42,7 @@
'sphinx_markdown_tables',
]

autodoc_mock_imports = [
'torch',
'torchvision',
'mmcv',
'mmocr.version',
'mmdet',
'imgaug',
'kwarray',
'lmdb',
'matplotlib',
'Polygon',
'cv2',
'numpy',
'pyclipper',
'pycocotools',
'pytest',
'rapidfuzz',
'scipy',
'shapely',
'skimage',
'titlecase',
'PIL',
]
autodoc_mock_imports = ['mmcv._ext']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
1 change: 1 addition & 0 deletions requirements/readthedocs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ lanms-proper
lmdb
matplotlib
mmcv
mmdet
Polygon3
pyclipper
rapidfuzz
Expand Down

0 comments on commit 7b16754

Please sign in to comment.