From 496728f97364bf04dc214ed9bdaeddc2ce4870ee Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 26 Mar 2003 04:39:01 +0000 Subject: [PATCH] boostbook.jam: Add rule to access XSL directory from other modules doxygen.jam: _Very_ preliminary support for Doxygen --> BoostBook conversion. Uses a hacked up Doxygen to output XML representation as one big XML file instead of many smaller (unlinked) XML files. [SVN r18087] --- boostbook.jam | 9 +++---- doxygen.jam | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 doxygen.jam diff --git a/boostbook.jam b/boostbook.jam index 9961c7f6e..e3e6490f5 100644 --- a/boostbook.jam +++ b/boostbook.jam @@ -90,6 +90,10 @@ rule init ( docbook-xsl-dir ? : docbook-dtd-dir ? : boostbook-xsl-dir ? } } +rule xsl-dir +{ + return $(.boostbook-xsl-dir) ; +} rule xslt ( target : source stylesheet : properties * ) { @@ -326,11 +330,6 @@ actions xslt-xsltproc-dir XML_CATALOG_FILES=catalog.xml xsltproc $(FLAGS) --xinclude -o $(DIRECTORY)/ $(STYLESHEET) $(>) } -############################################################################# -# XML Catalog Generation -############################################################################# - - # XInclude scanner. Mostly stolen from c-scanner :) # Note that this assumes an "xi" prefix for XIncludes. This isn't always the # case for XML documents, but we'll assume it's true for anything we encounter. diff --git a/doxygen.jam b/doxygen.jam new file mode 100644 index 000000000..16ce8bc61 --- /dev/null +++ b/doxygen.jam @@ -0,0 +1,70 @@ +# Copyright (C) 2003 Doug Gregor. Permission to copy, use, modify, +# sell and distribute this software is granted provided this +# copyright notice appears in all copies. This software is provided +# "as is" without express or implied warranty, and with no claim as +# to its suitability for any purpose. + +# This module defines rules to handle generation of BoostBook XML +# from Doxygen XML output. At the moment, this requires a special +# version of Doxygen that can output a single XML file instead of a +# set of XML files. + +import class : class new ; +import targets ; +import feature ; +import property ; +import generators ; +import boostbook ; + +type.register DOXYGEN_XML : doxygen ; # Doxygen XML output + +generators.register-standard doxygen.extract-xml : H C CPP : DOXYGEN_XML ; +generators.register-standard doxygen.xml-to-boostbook : DOXYGEN_XML : XML ; + +# Initialize the Doxygen module. Parameters are: +# name: the name of the 'doxygen' executable. If not specified, the name +# 'doxygen' will be used +rule init ( name ? ) +{ + if ! $(.initialized) + { + .initialized = true ; + + if $(name) + { + .doxygen = $(name) ; + } + } +} + +rule name ( ) +{ + return $(.doxygen) ; +} + +rule extract-xml ( target : sources * : properties * ) +{ + NAME on $(target) = [ name ] ; + doxygen-action $(<) : $(>) ; +} + +actions doxygen-action +{ + $(NAME:E=doxygen) -g $(<:S=.doxyfile) + echo "GENERATE_HTML = NO " >> $(<:S=.doxyfile) + echo "GENERATE_LATEX = NO " >> $(<:S=.doxyfile) + echo "GENERATE_XML = YES " >> $(<:S=.doxyfile) + echo "INPUT = $(>)" >> $(<:S=.doxyfile) + echo "MONOLITHIC_XML_FILE = $(<)" >> $(<:S=.doxyfile) + $(NAME:E=doxygen) $(<:S=.doxyfile) ; +} + +rule xml-to-boostbook ( target : source : properties * ) +{ + local xsl-dir = [ boostbook.xsl-dir ] ; + + boostbook.xslt $(target) + : $(source) "$(xsl-dir)/doxygen/doxygen2boostbook.xsl" + : $(properties) + ; +}