Unverified Commit 50b5adaa by Tianqi Chen Committed by GitHub

[DOCS] Cleanup docs before rebuild (#5127)

* [DOCS] Cleanup docs before rebuild

* Ask doxygen to generate svg to minimize the file size
parent 328dc73a
...@@ -2261,7 +2261,7 @@ DIRECTORY_GRAPH = YES ...@@ -2261,7 +2261,7 @@ DIRECTORY_GRAPH = YES
# The default value is: png. # The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES. # This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = svg
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning. # enable generation of interactive SVG images that allow zooming and panning.
......
...@@ -78,9 +78,6 @@ extensions = [ ...@@ -78,9 +78,6 @@ extensions = [
'autodocsumm' 'autodocsumm'
] ]
breathe_projects = {'tvm' : 'doxygen/xml/'}
breathe_default_project = 'tvm'
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
...@@ -208,10 +205,6 @@ subsection_order = ExplicitOrder( ...@@ -208,10 +205,6 @@ subsection_order = ExplicitOrder(
'../vta/tutorials/optimize', '../vta/tutorials/optimize',
'../vta/tutorials/autotvm']) '../vta/tutorials/autotvm'])
def generate_doxygen_xml(app):
"""Run the doxygen make commands if we're on the ReadTheDocs server"""
run_doxygen('..')
sphinx_gallery_conf = { sphinx_gallery_conf = {
'backreferences_dir': 'gen_modules/backreferences', 'backreferences_dir': 'gen_modules/backreferences',
'doc_module': ('tvm', 'numpy'), 'doc_module': ('tvm', 'numpy'),
...@@ -232,19 +225,6 @@ autodoc_default_options = { ...@@ -232,19 +225,6 @@ autodoc_default_options = {
'member-order': 'bysource', 'member-order': 'bysource',
} }
# hook for doxygen
def run_doxygen(folder):
"""Run the doxygen make command in the designated folder."""
try:
#retcode = subprocess.call("cd %s; make doc" % folder, shell=True)
retcode = subprocess.call("rm -rf _build/html/doxygen", shell=True)
retcode = subprocess.call("mkdir -p _build/html", shell=True)
retcode = subprocess.call("cp -rf doxygen/html _build/html/doxygen", shell=True)
if retcode < 0:
sys.stderr.write("doxygen terminated by signal %s" % (-retcode))
except OSError as e:
sys.stderr.write("doxygen execution failed: %s" % e)
# Maps the original namespace to list of potential modules # Maps the original namespace to list of potential modules
# that we can import alias from. # that we can import alias from.
tvm_alias_check_map = { tvm_alias_check_map = {
...@@ -300,9 +280,6 @@ def process_docstring(app, what, name, obj, options, lines): ...@@ -300,9 +280,6 @@ def process_docstring(app, what, name, obj, options, lines):
def setup(app): def setup(app):
# Add hook for building doxygen xml when needed
# no c++ API for now
app.connect("builder-inited", generate_doxygen_xml)
app.connect('autodoc-process-docstring', process_docstring) app.connect('autodoc-process-docstring', process_docstring)
app.add_stylesheet('css/tvm_theme.css') app.add_stylesheet('css/tvm_theme.css')
app.add_config_value('recommonmark_config', { app.add_config_value('recommonmark_config', {
......
...@@ -19,9 +19,11 @@ ...@@ -19,9 +19,11 @@
set -e set -e
set -u set -u
# cleanup old states
mkdir -p docs/_build/html mkdir -p docs/_build/html
rm -rf docs/_build/html/jsdoc rm -rf docs/_build/html/*
rm -rf docs/_build/html/javadoc rm -rf docs/gen_modules
rm -rf docs/doxygen
# remove stale tutorials and always build from scratch. # remove stale tutorials and always build from scratch.
rm -rf docs/tutorials rm -rf docs/tutorials
...@@ -32,6 +34,7 @@ find . -type f -path "*.log" | xargs rm -f ...@@ -32,6 +34,7 @@ find . -type f -path "*.log" | xargs rm -f
# C++ doc # C++ doc
make doc make doc
mv docs/doxygen docs/_build/html/doxygen
# JS doc # JS doc
jsdoc web/tvm_runtime.js web/README.md jsdoc web/tvm_runtime.js web/README.md
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment