Skip to content

Commit

Permalink
Ask doxygen to generate svg to minimize the file size
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Mar 22, 2020
1 parent 3e9cffc commit c25213a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 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
8 changes: 5 additions & 3 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 All @@ -44,7 +47,6 @@ mv jvm/core/target/site/apidocs docs/_build/html/javadoc
find . -type f -path "*.pyc" | xargs rm -f

cd docs
make clean
PYTHONPATH=`pwd`/../python make html
cd _build/html
tar czf docs.tgz *
Expand Down

0 comments on commit c25213a

Please sign in to comment.