# SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
# SPDX-License-Identifier: MIT

"""
SConstruct file for building SCons documentation.

The Developer Guide is only a stub, not build during a doc build.
"""

import os

env = Environment(ENV={'PATH' : os.environ['PATH']},
                  tools=['docbook'],
                  toolpath=['../../SCons/Tool'])

has_pdf = False
if (env.WhereIs('fop') or
    env.WhereIs('xep')):
    has_pdf = True

env.DocbookXInclude('developer_xi.xml', 'main.xml')
env.DocbookXslt('developer.xml', 'developer_xi.xml',
                xsl='../xslt/to_docbook.xslt')
env.DocbookHtml('developer.html','developer.xml')
if has_pdf:
    env.DocbookPdf('developer.pdf','developer.xml')
