Skip to content

Commit

Permalink
[DOCS] Cleanup docs build instructions. (apache#6094)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen authored and Trevor Morris committed Aug 26, 2020
1 parent 0ddf1d6 commit 454cca1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 0 additions & 4 deletions docker/Dockerfile.ci_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ RUN bash /install/ubuntu_install_python_package.sh
COPY install/ubuntu_install_sphinx.sh /install/ubuntu_install_sphinx.sh
RUN bash /install/ubuntu_install_sphinx.sh

# Fix recommonmark to latest version
RUN git clone --depth=1 https://github.com/rtfd/recommonmark
RUN cd recommonmark; python3 setup.py install

# Enable doxygen for c++ doc build
RUN apt-get update && apt-get install -y doxygen graphviz libprotobuf-dev protobuf-compiler

Expand Down
19 changes: 18 additions & 1 deletion docs/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This folder contains the source of TVM documents
- A hosted version of doc is at https://tvm.apache.org/docs
- pip install sphinx>=1.5.5 sphinx-gallery sphinx_rtd_theme matplotlib Image recommonmark "Pillow<7"
- Build tvm first in the root folder.
- To build locally, you need to enable USE_CUDA, USE_OPENCL, LLVM_CONFIG in config.mk and then type "make html" in this folder.
- To build locally, you need to enable USE_CUDA, USE_OPENCL, LLVM_CONFIG in config.cmake and then type "make html" in this folder.

Only Execute Specified Tutorials
--------------------------------
Expand All @@ -26,3 +26,20 @@ To only build one specific file, do
# The slash \ is used to get . in regular expression
TVM_TUTORIAL_EXEC_PATTERN=file_name\.py make html
```

Helper Scripts
--------------

You can run the following script to reproduce the CI sphinx pre-check stage.
This script skips the tutorial executions and is useful for quickly check the content.

```bash
./tests/scrpts/task_sphinx_precheck.sh
```

The following script runs the full build which includes tutorial executions.
You will need a gpu CI environment.

```bash
./tests/scrpts/task_python_docs.sh
```
13 changes: 0 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
import inspect
import os, subprocess
import shlex
import recommonmark
import sphinx_gallery
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -54,11 +51,6 @@
copyright = u'2020, %s' % author
github_doc_root = 'https://github.com/apache/incubator-tvm/tree/master/docs/'

# add markdown parser
CommonMarkParser.github_doc_root = github_doc_root
source_parsers = {
'.md': CommonMarkParser
}
os.environ['TVM_BUILD_DOC'] = '1'
# Version information.
import tvm
Expand Down Expand Up @@ -285,8 +277,3 @@ def process_docstring(app, what, name, obj, options, lines):
def setup(app):
app.connect('autodoc-process-docstring', process_docstring)
app.add_css_file('css/tvm_theme.css')
app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
'auto_doc_ref': True
}, True)
app.add_transform(AutoStructify)

0 comments on commit 454cca1

Please sign in to comment.