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
- 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
--------------------------------
# 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
+```
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
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
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)