summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2020-06-29 21:19:14 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2020-06-29 21:19:14 (GMT)
commitd38699f6f4b2ce404e51a8c562b1a5ef191a7e36 (patch)
treeefce12a514498cf83654b43915d18da5b311ba6a
parent65b94bb48fa9821bbbee5dce80691391d8871d54 (diff)
downloadSCons-d38699f6f4b2ce404e51a8c562b1a5ef191a7e36.zip
SCons-d38699f6f4b2ce404e51a8c562b1a5ef191a7e36.tar.gz
SCons-d38699f6f4b2ce404e51a8c562b1a5ef191a7e36.tar.bz2
Update logic to generate scons-api docs and include in the scons-docs tarball for distribution
-rw-r--r--doc/Makefile13
-rw-r--r--doc/SConscript67
-rw-r--r--doc/sphinx/conf.py2
3 files changed, 28 insertions, 54 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 4da19e3..76f4228 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -7,14 +7,21 @@ SPHINXBUILD = sphinx-build
SPHINXPROJ = SCons
SOURCEDIR = sphinx
BUILDDIR = ../build/doc/api
+DOCTREES = ../build/doc/api
# Put it first so that "make" without argument is like "make help".
help:
- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile rinoh
-.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ $(SPHINXBUILD) -M $@ -d "$(DOCTREES)" "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+
+
+# For macports need
+# sudo port install texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra
diff --git a/doc/SConscript b/doc/SConscript
index 46fb5ff..17f782a 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -499,56 +499,23 @@ else:
Local(css_file)
if not skip_doc:
- if True: #not epydoc_cli and not epydoc:
- print("doc: epydoc not found, skipping building API documentation.")
- else:
- # XXX Should be in common with reading the same thing in
- # the SConstruct file.
- # bootstrap.py runs outside of SCons, so need to process the path
- e = Dir('#').rstr()
- sources = bootstrap.parseManifestLines(e, os.path.join(e, 'MANIFEST.in'))
-
- # Omit some files:
- #
- # Don't omit Platform as we need Platform.virtualenv for the examples to be run
- # sources = [x for x in sources if x.find('Platform') == -1]
- sources = [x for x in sources if x.find('Tool') == -1]
- sources = [x for x in sources if x.find('Options') == -1]
-
- e = os.path.join(build, '..', 'scons', 'engine')
- sources = [os.path.join(e, x) for x in sources]
-
- htmldir = os.path.join(build, 'HTML', 'scons-api')
- env.Command('${OUTDIR}/index.html', sources, epydoc_commands,
- EPYDOC=epydoc_cli, EPYDOCFLAGS='--html', OUTDIR=htmldir)
- tar_deps.append(htmldir)
- tar_list.append(htmldir)
-
- if sys.platform == 'darwin' or not epydoc_cli:
- print("doc: command line epydoc is not found, skipping PDF/PS/Tex output")
- else:
- # PDF and PostScript and TeX are built from the
- # same invocation.
- api_dir = os.path.join(build, 'scons-api')
- api_pdf = os.path.join(api_dir, 'api.pdf')
- api_ps = os.path.join(api_dir, 'api.ps')
- api_tex = os.path.join(api_dir, 'api.tex')
- api_targets = [api_pdf, api_ps, api_tex]
- env.Command(api_targets, sources, epydoc_commands,
- EPYDOC=epydoc_cli, EPYDOCFLAGS='--pdf', OUTDIR=api_dir)
- Local(api_targets)
-
- pdf_install = os.path.join(build, 'PDF', 'scons-api.pdf')
- env.InstallAs(pdf_install, api_pdf)
- tar_deps.append(pdf_install)
- tar_list.append(pdf_install)
- Local(pdf_install)
-
- ps_install = os.path.join(build, 'PS', 'scons-api.ps')
- env.InstallAs(ps_install, api_ps)
- tar_deps.append(ps_install)
- tar_list.append(ps_install)
- Local(ps_install)
+ # Build API DOCS
+ # TODO: Better specify depndencies on source files
+ pdf_file = env.Command('#/build/doc/api/latex/SConsAPIDocs.pdf',
+ env.Glob('#/SCons/*'),
+ "cd doc && make latexpdf")
+ pdf_install = os.path.join(build, 'PDF', 'scons-api.pdf')
+ env.InstallAs(pdf_install, pdf_file)
+ tar_deps.append(pdf_install)
+ tar_list.append(pdf_install)
+
+ htmldir = os.path.join(build, 'HTML', 'scons-api')
+ html_files = env.Command('#/build/doc/api/html/index.html',
+ env.Glob('#/SCons/*'),
+ "cd doc && make dirhtml BUILDDIR=${HTMLDIR}",
+ HTMLDIR=htmldir)
+ tar_deps.append(htmldir)
+ tar_list.append(htmldir)
#
# Now actually create the tar file of the documentation,
diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py
index 9469e06..7cbd208 100644
--- a/doc/sphinx/conf.py
+++ b/doc/sphinx/conf.py
@@ -142,7 +142,7 @@ htmlhelp_basename = 'SConsAPIDocs'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
- # 'papersize': 'letterpaper',
+ 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#