2
0
mirror of https://github.com/boostorg/json.git synced 2026-02-09 11:12:37 +00:00
Files
json/doc/Jamfile
Vinnie Falco 8f1348ed40 Add examples
2019-11-15 11:40:32 -08:00

226 lines
5.1 KiB
Plaintext

#
# Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/vinniefalco/json
#
project json/doc ;
import os ;
import path ;
import boostbook ;
import quickbook ;
import xsltproc ;
import doxygen ;
import modules ;
import saxonhe ;
local broot = [ os.environ BOOST_ROOT ] ;
path-constant out : . ;
#-------------------------------------------------------------------------------
#
# Build the list of header files that Doxygen will scan. We need
# this list to inform the build system of the dependencies so the
# docs can be rebuild if any of the header files change.
#
local sources = [ path.glob-tree ../include/boost/json : *.hpp *.ipp : detail impl ] ;
# Get the configured paths to doxygen and xsltproc
.doxygen = [ doxygen.name ] ;
.doxygen ?= doxygen ;
.xsltproc = [ xsltproc.name ] ;
.xsltproc ?= xsltproc ;
#-------------------------------------------------------------------------------
#
# Generate transform.xsl. This xsl transfomration takes as input
# the Doxygen-generated XML and produces QuickBook output.
#
make transform.xsl
:
docca/include/docca/doxygen.xsl
xsl/config.xsl
xsl/class_detail.xsl
xsl/includes.xsl
xsl/includes_foot.xsl
:
@make_transform
;
# Make a copy of the docca transform. Then, insert our
# customizations into the specially marked locations using sed.
#
actions make_transform
{
cp $(2[1]) $(1)
sed -i -e "/<!-- CONFIG_TEMPLATE -->/{r $(2[2])" -e "d}" $(1)
sed -i -e "/<!-- CLASS_DETAIL_TEMPLATE -->/{r $(2[3])" -e "d}" $(1)
sed -i -e "/<!-- INCLUDES_TEMPLATE -->/{r $(2[4])" -e "d}" $(1)
sed -i -e "/<!-- INCLUDES_FOOT_TEMPLATE -->/{r $(2[5])" -e "d}" $(1)
}
#-------------------------------------------------------------------------------
#
# Invoke Doxygen to process the header files and produce the XML
# containing the description of the C++ declarations and extracted
# Javadoc comments.
#
make index.xml
:
./source.dox
:
@make_doxygen_xml
:
<dependency>$(sources)
;
rule make_doxygen_xml ( targets * : sources * : properties * )
{
}
if [ os.name ] = NT
{
actions make_doxygen_xml
{
SET LIB_DIR=$(LIB_DIR)
SET XML_OUTPUT=$(1:D)
"$(.doxygen)" $(2)
}
}
else
{
actions make_doxygen_xml
{
export LIB_DIR=$(LIB_DIR)
export XML_OUTPUT=$(1:D)
"$(.doxygen)" $(2)
}
}
make combine.xslt : index.xml : @null_action ;
actions null_action
{
touch -c $(1) ;
}
make reference.xml
:
combine.xslt
index.xml
:
@call-xsltproc
;
actions call-xsltproc
{
"$(.xsltproc)" $(2) > $(1)
}
#-------------------------------------------------------------------------------
#
# Produce the reference.qbk file by running
# the reference xml through the transform.
#
make reference.qbk
:
reference.xml
transform.xsl
:
saxonhe.saxonhe
;
# We have to make a copy of reference.qbk and put it
# in a place where the static .qbk files can find it
#
install qbk : reference.qbk ;
#-------------------------------------------------------------------------------
#
# Produce the Boost.Book XML from the QuickBook
#
install stylesheets
:
$(broot)/doc/src/boostbook.css
:
<location>$(out)/html
;
explicit stylesheets ;
install images
:
[ glob $(broot)/doc/src/images/*.png ]
images/doc-logo.png
:
<location>$(out)/html/images
;
explicit images ;
install callouts
:
[ glob $(broot)/doc/src/images/callouts/*.png ]
:
<location>$(out)/html/images/callouts
;
explicit callout ;
xml json_doc
:
qbk/main.qbk
:
<dependency>qbk
# <include>$(broot)/tools/boostbook/dtd
;
explicit json_doc ;
#-------------------------------------------------------------------------------
#
# HTML documentation for $(BOOST_ROOT)/doc/html
#
#-------------------------------------------------------------------------------
boostbook json
:
json_doc
:
<xsl:param>boost.image.src=images/doc-logo.png
<xsl:param>boost.image.alt="Boost.JSON Logo"
<xsl:param>boost.image.w=880
<xsl:param>boost.image.h=80
<xsl:param>boost.graphics.root=images/
<xsl:param>html.stylesheet=boostbook.css
<xsl:param>nav.layout=none
<xsl:param>chapter.autolabel=0
<xsl:param>chunk.first.sections=1 # Chunk the first top-level section?
<xsl:param>chunk.section.depth=8 # Depth to which sections should be chunked
<xsl:param>generate.toc="chapter nop section nop"
:
<dependency>stylesheets
<dependency>images
;
#-------------------------------------------------------------------------------
#
# These are used to inform the build system of the
# means to build the integrated and stand-alone docs.
#
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : json ;
explicit boostrelease ;