public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH v3 1/5] python-utils-r1.eclass: Introduce build_sphins() helper
@ 2019-11-22  6:46 Michał Górny
  2019-11-22  6:46 ` [gentoo-dev] [PATCH v3 2/5] distutils-r1.eclass: Add distutils_enable_sphinx helper function Michał Górny
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Michał Górny @ 2019-11-22  6:46 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, Michał Górny

Introduce a helper to build HTML docs using Sphinx, providing for
Intersphinx cleanup and HTML_DOCS appending.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-utils-r1.eclass | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

(changes in PATCH 2)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 647eb04344d2..f507b28ca90c 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1344,6 +1344,31 @@ python_export_utf8_locale() {
 	return 0
 }
 
+# @FUNCTION: build_sphinx
+# @USAGE: <directory>
+# @DESCRIPTION:
+# Build HTML documentation using dev-python/sphinx in the specified
+# <directory>.  Takes care of disabling Intersphinx and appending
+# to HTML_DOCS.
+#
+# If <directory> is relative to the current directory, care needs
+# to be taken to run einstalldocs from the same directory
+# (usually ${S}).
+build_sphinx() {
+	debug-print-function ${FUNCNAME} "${@}"
+	[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes 1 arg: <directory>"
+
+	local dir=${1}
+
+	sed -i -e 's:^intersphinx_mapping:disabled_&:' \
+		"${dir}"/conf.py || die
+	# not all packages include the Makefile in pypi tarball
+	sphinx-build -b html -d "${dir}"/_build/doctrees "${dir}" \
+		"${dir}"/_build/html || die
+
+	HTML_DOCS+=( "${dir}/_build/html/." )
+}
+
 # -- python.eclass functions --
 
 _python_check_dead_variables() {
-- 
2.24.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-22 10:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-22  6:46 [gentoo-dev] [PATCH v3 1/5] python-utils-r1.eclass: Introduce build_sphins() helper Michał Górny
2019-11-22  6:46 ` [gentoo-dev] [PATCH v3 2/5] distutils-r1.eclass: Add distutils_enable_sphinx helper function Michał Górny
2019-11-22  6:46 ` [gentoo-dev] [PATCH v3 3/5] dev-python/cssselect: Use distutils_enable_sphinx Michał Górny
2019-11-22  6:46 ` [gentoo-dev] [PATCH v3 4/5] dev-python/future: " Michał Górny
2019-11-22  6:46 ` [gentoo-dev] [PATCH v3 5/5] dev-python/jinja: " Michał Górny
2019-11-22  9:43 ` [gentoo-dev] [PATCH v3 1/5] python-utils-r1.eclass: Introduce build_sphins() helper Kent Fredric
2019-11-22 10:10   ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox