Skip to content

Commit

Permalink
[DOCS] Cleanup docs before rebuild (apache#5127)
Browse files Browse the repository at this point in the history
* [DOCS] Cleanup docs before rebuild

* Ask doxygen to generate svg to minimize the file size
  • Loading branch information
tqchen authored and Trevor Morris committed Apr 16, 2020
1 parent 8967c2e commit d312268
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,7 @@ DIRECTORY_GRAPH = YES
# The default value is: png.
# 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
# enable generation of interactive SVG images that allow zooming and panning.
Expand Down
23 changes: 0 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@
'autodocsumm'
]

breathe_projects = {'tvm' : 'doxygen/xml/'}
breathe_default_project = 'tvm'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -208,10 +205,6 @@
'../vta/tutorials/optimize',
'../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 = {
'backreferences_dir': 'gen_modules/backreferences',
'doc_module': ('tvm', 'numpy'),
Expand All @@ -232,19 +225,6 @@ def generate_doxygen_xml(app):
'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
# that we can import alias from.
tvm_alias_check_map = {
Expand Down Expand Up @@ -300,9 +280,6 @@ def process_docstring(app, what, name, obj, options, lines):


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.add_stylesheet('css/tvm_theme.css')
app.add_config_value('recommonmark_config', {
Expand Down
7 changes: 5 additions & 2 deletions tests/scripts/task_python_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
set -e
set -u

# cleanup old states
mkdir -p docs/_build/html
rm -rf docs/_build/html/jsdoc
rm -rf docs/_build/html/javadoc
rm -rf docs/_build/html/*
rm -rf docs/gen_modules
rm -rf docs/doxygen

# remove stale tutorials and always build from scratch.
rm -rf docs/tutorials
Expand All @@ -32,6 +34,7 @@ find . -type f -path "*.log" | xargs rm -f

# C++ doc
make doc
mv docs/doxygen docs/_build/html/doxygen

# JS doc
jsdoc web/tvm_runtime.js web/README.md
Expand Down

0 comments on commit d312268

Please sign in to comment.