diff --git a/docker/Dockerfile.ci_gpu b/docker/Dockerfile.ci_gpu index 6a1023a321fff..6233cc53211f7 100644 --- a/docker/Dockerfile.ci_gpu +++ b/docker/Dockerfile.ci_gpu @@ -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 diff --git a/docs/README.txt b/docs/README.txt index fb384dbcea756..03802fda0c460 100644 --- a/docs/README.txt +++ b/docs/README.txt @@ -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 -------------------------------- @@ -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 +``` diff --git a/docs/conf.py b/docs/conf.py index 3cc8d0a04499e..f25c07d78d904 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 @@ -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 @@ -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)