diff --git a/doc/README b/doc/README index 5b0d02c1f..fa7cf8a5c 100644 --- a/doc/README +++ b/doc/README @@ -1,7 +1,5 @@ The documentation of xgboost is generated with recommonmark and sphinx. You can build it locally by typing "make html" in this folder. -- clone https://github.com/tqchen/recommonmark to root -- type make html Checkout https://recommonmark.readthedocs.org for guide on how to write markdown with extensions used in this doc, such as math formulas and table of content. diff --git a/doc/_static/xgboost-theme/static/searchtools.js b/doc/_static/searchtools-new.js similarity index 100% rename from doc/_static/xgboost-theme/static/searchtools.js rename to doc/_static/searchtools-new.js diff --git a/doc/_static/xgboost-theme/layout.html b/doc/_static/xgboost-theme/layout.html index 2931fe594..453e957db 100644 --- a/doc/_static/xgboost-theme/layout.html +++ b/doc/_static/xgboost-theme/layout.html @@ -56,7 +56,7 @@ }; - {% for name in ['jquery.js', 'underscore.js', 'doctools.js', 'searchtools.js'] %} + {% for name in ['jquery.js', 'underscore.js', 'doctools.js', 'searchtools-new.js'] %} {% endfor %} diff --git a/doc/conf.py b/doc/conf.py index 1b00c843d..4a54ababb 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,7 +14,6 @@ import sys import os, subprocess import shlex -import urllib # 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 # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -164,8 +163,14 @@ def setup(app): # Add hook for building doxygen xml when needed # no c++ API for now # app.connect("builder-inited", generate_doxygen_xml) - urllib.urlretrieve('https://code.jquery.com/jquery-2.2.4.min.js', - '_static/jquery.js') + + # urlretrieve got moved in Python 3.x + try: + from urllib import urlretrieve + except ImportError: + from urllib.request import urlretrieve + urlretrieve('https://code.jquery.com/jquery-2.2.4.min.js', + '_static/jquery.js') app.add_config_value('recommonmark_config', { 'url_resolver': lambda url: github_doc_root + url, 'enable_eval_rst': True, diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 000000000..dadb229aa --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,3 @@ +sphinx==1.5.6 +commonmark==0.5.4 +mock