[master 13/18] Create html documentation under docs/html/

bcl installerbot-noreply at redhat.com
Tue May 12 00:22:03 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

---
 docs/Makefile | 13 ++++++-------
 docs/conf.py  | 14 ++++++++++++--
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index 9cf59fc..863e6f8 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -6,7 +6,7 @@ SPHINXOPTS    =
 SPHINXBUILD   = sphinx-build
 SPHINXAPIDOC  = sphinx-apidoc
 PAPER         =
-BUILDDIR      = _build
+BUILDDIR      = .
 SOURCEDIR     = ../src/
 MODULE_NAMES  = pylorax.rst modules.rst
 
@@ -18,7 +18,7 @@ endif
 # Internal variables.
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+ALLSPHINXOPTS   = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
 # the i18n builder cannot share the environment and doctrees with the others
 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
 
@@ -49,12 +49,11 @@ help:
 	@echo "  linkcheck  to check all external links for integrity"
 	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
 
-clean:
-	rm -rf $(BUILDDIR)/*
-
 apidoc:
-	-rm $(addprefix ./, $(MODULE_NAMES))
-	$(SPHINXAPIDOC) -o . $(SOURCEDIR)
+	if [ -f /usr/bin/$(SPHINXAPIDOC) ]; then \
+		-rm $(addprefix ./, $(MODULE_NAMES))
+		$(SPHINXAPIDOC) -o . $(SOURCEDIR)
+	fi
 
 html:
 	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
diff --git a/docs/conf.py b/docs/conf.py
index 41183d0..a3ecc7f 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -83,7 +83,7 @@ def read_version():
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['_build']
+exclude_patterns = ['_build', 'html']
 
 # The reST default role (used for this markup: `text`) to use for all
 # documents.
@@ -344,7 +344,17 @@ def read_version():
 #epub_use_index = True
 
 # Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'https://docs.python.org/2': None}
+intersphinx_mapping = {'https://docs.python.org/3': None}
+
+# on_rtd is whether we are on readthedocs.org
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+if not on_rtd:  # only import and set the theme if we're building docs locally
+    import sphinx_rtd_theme
+    html_theme = 'sphinx_rtd_theme'
+    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+
+# otherwise, readthedocs.org uses their theme by default, so no need to specify it
 
 # This was taken directly from here:
 # http://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules


-- 
To view this commit on github, visit https://github.com/rhinstaller/lorax/commit/dfce50b7ab7075e428cb8ffe857a79d1534730fe


More information about the anaconda-patches mailing list