1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
8 Obsolete: epydoc no longer maintained.
11 from SCons
.Script
import Delete
, Touch
, WhereIs
13 epydoc_cli
= WhereIs('epydoc')
21 # adding Epydoc builder using imported module
22 def epydoc_builder_action(target
, source
, env
):
24 Take a list of `source` files and build docs for them in
27 `target` and `source` are lists.
29 Uses OUTDIR and EPYDOCFLAGS environment variables.
31 http://www.scons.org/doc/2.0.1/HTML/scons-user/x3594.html
34 # the epydoc build process is the following:
35 # 1. build documentation index
36 # 2. feed doc index to writer for docs
38 from epydoc
.docbuilder
import build_doc_index
39 from epydoc
.docwriter
.html
import HTMLWriter
40 # from epydoc.docwriter.latex import LatexWriter
42 # first arg is a list where can be names of python package dirs,
43 # python files, object names or objects itself
44 docindex
= build_doc_index([str(src
) for src
in source
])
48 if env
['EPYDOCFLAGS'] == '--html':
49 html_writer
= HTMLWriter(docindex
,
50 docformat
='restructuredText',
52 prj_url
='http://www.scons.org/')
54 html_writer
.write(env
['OUTDIR'])
55 except OSError: # If directory cannot be created or any file cannot
56 # be created or written to.
60 # PDF support requires external Linux utilites, so it's not crossplatform.
62 # http://epydoc.svn.sourceforge.net/viewvc/epydoc/trunk/epydoc/src/epydoc/cli.py
64 elif env['EPYDOCFLAGS'] == '--pdf':
65 pdf_writer = LatexWriter(docindex,
66 docformat='restructuredText',
68 prj_url='http://www.scons.org/')
74 epydoc_builder_action
,
82 '$EPYDOC $EPYDOCFLAGS --debug --output $OUTDIR --docformat=restructuredText --name SCons --url http://www.scons.org/ $SOURCES',