1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy pypy3 )
10 DESCRIPTION="Python Documentation Utilities"
11 HOMEPAGE="http://docutils.sourceforge.net/ https://pypi.org/project/docutils/"
12 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
14 LICENSE="BSD-2 GPL-3 public-domain"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
19 DEPEND="dev-python/pygments[${PYTHON_USEDEP}]"
22 python_compile_all() {
23 # Generate html docs from reStructured text sources.
25 # Place html4css1.css in base directory to ensure that the generated reference to it is correct.
26 cp docutils/writers/html4css1/html4css1.css . || die
29 "${EPYTHON}" buildhtml.py --input-encoding=utf-8 \
30 --stylesheet-path=../html4css1.css, --traceback ../docs || die
34 if python_is_python3; then
35 pushd test3 > /dev/null || die
37 pushd test > /dev/null || die
39 "${EPYTHON}" alltests.py || die "Testing failed with ${EPYTHON}"
40 popd > /dev/null || die
44 distutils-r1_python_install
47 python_doscript tools/{buildhtml,quicktest}.py
52 local dir="txt/$(dirname ${doc})"
57 python_install_all() {
59 local HTML_DOCS=( docs tools docutils/writers/html4css1/html4css1.css )
61 distutils-r1_python_install_all
64 while IFS= read -r -d '' doc; do
65 install_txt_doc "${doc}"
66 done < <(find docs tools -name '*.txt' -print0)