From b9e02ab92f667e100c842682f057dc9ea965ccc9 Mon Sep 17 00:00:00 2001 From: Aaron Markham Date: Tue, 29 Jan 2019 06:45:18 -0800 Subject: [PATCH] remove debug; add support for v1.4.x docs; fix publish bug (#14015) --- docs/mxdoc.py | 17 ++++++++++------- docs/settings.ini | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/docs/mxdoc.py b/docs/mxdoc.py index fe3781ffe9cb..156d1e821eda 100644 --- a/docs/mxdoc.py +++ b/docs/mxdoc.py @@ -50,6 +50,7 @@ _CLOJURE_DOCS = parser.getboolean(_DOC_SET, 'clojure_docs') _DOXYGEN_DOCS = parser.getboolean(_DOC_SET, 'doxygen_docs') _R_DOCS = parser.getboolean(_DOC_SET, 'r_docs') +_ARTIFACTS = parser.getboolean(_DOC_SET, 'artifacts') # white list to evaluate the code block output, such as ['tutorials/gluon'] _EVAL_WHILTELIST = [] @@ -88,10 +89,10 @@ def generate_doxygen(app): def build_mxnet(app): """Build mxnet .so lib""" if not os.path.exists(os.path.join(app.builder.srcdir, '..', 'config.mk')): - _run_cmd("cd %s/.. && cp make/config.mk config.mk && make -j$(nproc) DEBUG=1 USE_MKLDNN=0 USE_CPP_PACKAGE=1" % + _run_cmd("cd %s/.. && cp make/config.mk config.mk && make -j$(nproc) USE_MKLDNN=0 USE_CPP_PACKAGE=1 " % app.builder.srcdir) else: - _run_cmd("cd %s/.. && make -j$(nproc) DEBUG=1 USE_MKLDNN=0 USE_CPP_PACKAGE=1" % + _run_cmd("cd %s/.. && make -j$(nproc) USE_MKLDNN=0 USE_CPP_PACKAGE=1 " % app.builder.srcdir) def build_r_docs(app): @@ -438,17 +439,17 @@ def add_buttons(app, docname, source): def copy_artifacts(app): """Copies artifacts needed for website presentation""" - print("Copying artifacts...") dest_path = app.builder.outdir + '/error' + source_path = app.builder.srcdir + '/build_version_doc/artifacts' _run_cmd('cd ' + app.builder.srcdir) _run_cmd('rm -rf ' + dest_path) _run_cmd('mkdir -p ' + dest_path) - _run_cmd('cp build_version_doc/artifacts/404.html ' + dest_path) - _run_cmd('cp build_version_doc/artifacts/api.html ' + dest_path) + _run_cmd('cp ' + source_path + '/404.html ' + dest_path) + _run_cmd('cp ' + source_path + '/api.html ' + dest_path) dest_path = app.builder.outdir + '/_static' _run_cmd('rm -rf ' + dest_path) _run_cmd('mkdir -p ' + dest_path) - _run_cmd('cp _static/mxnet.css ' + dest_path) + _run_cmd('cp ' + app.builder.srcdir + '/_static/mxnet.css ' + dest_path) def setup(app): @@ -475,7 +476,9 @@ def setup(app): if _R_DOCS: print("Building R Docs!") app.connect("builder-inited", build_r_docs) - app.connect("builder-inited", copy_artifacts) + if _ARTIFACTS: + print("Copying Artifacts!") + app.connect("builder-inited", copy_artifacts) app.connect('source-read', convert_table) app.connect('source-read', add_buttons) app.add_config_value('recommonmark_config', { diff --git a/docs/settings.ini b/docs/settings.ini index 7de3268ab145..e16177604e8d 100644 --- a/docs/settings.ini +++ b/docs/settings.ini @@ -2,6 +2,7 @@ build_mxnet = 0 [document_sets_tutorial] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -9,6 +10,23 @@ r_docs = 0 scala_docs = 0 [document_sets_default] +artifacts = 1 +clojure_docs = 1 +doxygen_docs = 1 +java_docs = 1 +r_docs = 0 +scala_docs = 1 + +[document_sets_1.4.0] +artifacts = 0 +clojure_docs = 1 +doxygen_docs = 1 +java_docs = 1 +r_docs = 0 +scala_docs = 1 + +[document_sets_v1.4.x] +artifacts = 0 clojure_docs = 1 doxygen_docs = 1 java_docs = 1 @@ -16,6 +34,7 @@ r_docs = 0 scala_docs = 1 [document_sets_1.3.1] +artifacts = 0 clojure_docs = 1 doxygen_docs = 1 java_docs = 0 @@ -23,6 +42,7 @@ r_docs = 0 scala_docs = 1 [document_sets_1.3.0] +artifacts = 0 clojure_docs = 1 doxygen_docs = 1 java_docs = 0 @@ -30,13 +50,15 @@ r_docs = 0 scala_docs = 1 [document_sets_v1.3.x] -clojure_docs = 1 +artifacts = 0 +clojure_docs = 0 doxygen_docs = 1 java_docs = 0 r_docs = 0 -scala_docs = 1 +scala_docs = 0 [document_sets_1.2.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -44,6 +66,7 @@ r_docs = 0 scala_docs = 1 [document_sets_v1.2.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -51,6 +74,7 @@ r_docs = 0 scala_docs = 1 [document_sets_1.1.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -58,6 +82,7 @@ r_docs = 0 scala_docs = 0 [document_sets_v1.1.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -65,6 +90,7 @@ r_docs = 0 scala_docs = 0 [document_sets_1.0.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -72,6 +98,7 @@ r_docs = 0 scala_docs = 0 [document_sets_v1.0.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -79,6 +106,7 @@ r_docs = 0 scala_docs = 0 [document_sets_0.12.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -86,6 +114,7 @@ r_docs = 0 scala_docs = 0 [document_sets_v0.12.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -93,6 +122,7 @@ r_docs = 0 scala_docs = 0 [document_sets_0.11.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0 @@ -100,6 +130,7 @@ r_docs = 0 scala_docs = 0 [document_sets_v0.11.0] +artifacts = 0 clojure_docs = 0 doxygen_docs = 1 java_docs = 0