Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51104 - in trunk: doc/pdf doc/test libs/accumulators/doc libs/asio/doc libs/bimap/doc libs/functional/hash/doc libs/lambda/doc libs/proto/doc libs/python/doc/tutorial/doc libs/spirit/phoenix/doc libs/units/doc libs/unordered/doc tools/boostbook/xsl tools/jam/doc tools/quickbook/doc
From: john_at_[hidden]
Date: 2009-02-08 11:59:16


Author: johnmaddock
Date: 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
New Revision: 51104
URL: http://svn.boost.org/trac/boost/changeset/51104

Log:
Add Jamfile to build PDF versions of all the docs.
Tweaked some existing Jamfiles so that PDF build finds all the necessary image files etc.
Tweaked fo.xsl to provide more options by default, and improve formatting.
Added:
   trunk/doc/pdf/
   trunk/doc/pdf/Jamfile.v2 (contents, props changed)
Text files modified:
   trunk/doc/test/Jamfile.v2 | 24 -------------------
   trunk/doc/test/test.qbk | 6 +++++
   trunk/libs/accumulators/doc/Jamfile.v2 | 4 +++
   trunk/libs/asio/doc/Jamfile.v2 | 3 ++
   trunk/libs/bimap/doc/jamfile.v2 | 3 ++
   trunk/libs/functional/hash/doc/Jamfile.v2 | 2
   trunk/libs/lambda/doc/Jamfile.v2 | 8 +++++
   trunk/libs/proto/doc/Jamfile.v2 | 6 ++--
   trunk/libs/python/doc/tutorial/doc/Jamfile.v2 | 3 ++
   trunk/libs/spirit/phoenix/doc/Jamfile.v2 | 4 +++
   trunk/libs/units/doc/Jamfile.v2 | 25 +-------------------
   trunk/libs/unordered/doc/Jamfile.v2 | 2
   trunk/tools/boostbook/xsl/fo.xsl | 47 +++++++++++++++++++++++++++++++++++++--
   trunk/tools/jam/doc/build.jam | 6 ++--
   trunk/tools/quickbook/doc/Jamfile.v2 | 3 ++
   15 files changed, 88 insertions(+), 58 deletions(-)

Added: trunk/doc/pdf/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/doc/pdf/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,62 @@
+# Copyright (c) 2008 John Maddock
+#
+# 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)
+
+
+install pdf-install
+ :
+ ../../libs/accumulators/doc//standalone
+ ../../libs/algorithm/string/doc//string_algo
+ ../../libs/asio/doc//asio
+ ../../libs/bimap/doc//standalone
+ ../../libs/bind/doc//ref-doc
+ ../../libs/concept_check/doc//concepts
+ ../../libs/config/doc//standalone
+ ../../libs/date_time/xmldoc//date_time
+ ../../libs/foreach/doc//standalone
+ ../../libs/function/doc//function-doc
+ ../../libs/functional/hash/doc//standalone
+ ../../libs/interprocess/doc//standalone
+ ../../libs/intrusive/doc//standalone
+ ../../libs/iterator/doc//standalone
+ ../../libs/lambda/doc//lambda-doc
+ ../../libs/logic/doc//tribool
+ ../../libs/math/doc/complex//standalone
+ ../../libs/math/doc/octonion//standalone
+ ../../libs/math/doc/quaternion//standalone
+ ../../libs/math/doc/gcd//standalone
+ ../../libs/math/doc/sf_and_dist//standalone
+ ../../libs/numeric/conversion/doc//standalone
+ ../../libs/optional/doc//standalone
+ ../../libs/proto/doc//standalone
+ #../../libs/ptr_container/doc//doc
+ ../../libs/optional/doc//standalone
+ ../../libs/python/doc/tutorial/doc//tutorial
+ ../../libs/range/doc//standalone
+ ../../libs/regex/doc//standalone
+ ../../libs/scope_exit/doc//standalone
+ ../../libs/signals/doc//doc
+ ../../libs/spirit/phoenix/doc//quickbook
+ ../../libs/static_assert/doc//standalone
+ ../../libs/thread/doc//standalone
+ ../../libs/tr1/doc//standalone
+ ../../libs/type_traits/doc//standalone
+ ../../libs/typeof/doc//standalone
+ ../../libs/units/doc//standalone
+ ../../libs/unordered/doc//standalone
+ ../../libs/variant/doc//variant-doc
+ ../../libs/xpressive/doc//standalone
+
+ ../../tools/boostbook/doc//boostbook
+ ../../tools/jam/doc//standalone
+ ../../tools/quickbook/doc//standalone
+ ../../tools/build/v2/doc//userman
+ :
+ <location>.
+ <install-type>PDF
+ <format>pdf
+ ;
+
+

Modified: trunk/doc/test/Jamfile.v2
==============================================================================
--- trunk/doc/test/Jamfile.v2 (original)
+++ trunk/doc/test/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -163,30 +163,8 @@
 
         # PDF Options:
         #======================================================================
-
- # PDF Options:
- # TOC Generation: only one of these should be set:
- <format>pdf:<xsl:param>fop.extensions=0
- <format>pdf:<xsl:param>fop1.extensions=0
- <format>pdf:<xsl:param>xep.extensions=1
- # No indent on body text:
- <format>pdf:<xsl:param>body.start.indent=0pt
- # Margin size:
- <format>pdf:<xsl:param>page.margin.inner=0.5in
- <format>pdf:<xsl:param>page.margin.outer=0.5in
- # Paper type = A4
- <format>pdf:<xsl:param>paper.type=A4
- # Yes, we want graphics for admonishments:
- <xsl:param>admon.graphics=1
- # Set this one for PDF generation *only*:
- # default pnd graphics are awful in PDF form,
- # better use SVG's instead:
- <format>pdf:<xsl:param>admon.graphics.extension=".svg"
         <format>pdf:<xsl:param>img.src.path=$(images_location)/
- <format>pdf:<xsl:param>admon.graphics.path=$(images_location)/../../src/images/
- <format>pdf:<xsl:param>callout.graphics.path=$(images_location)/../../src/images/callouts/
- <format>pdf:<xsl:param>draft.mode="no"
     ;
 
 
-install pdf-install : standalone : <location>. <install-type>PDF ;
\ No newline at end of file
+install pdf-install : standalone : <location>. <install-type>PDF ;

Modified: trunk/doc/test/test.qbk
==============================================================================
--- trunk/doc/test/test.qbk (original)
+++ trunk/doc/test/test.qbk 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -57,6 +57,12 @@
 
 [endsect]
 
+[section This should cause an error in PDF builds]
+
+ template <class RealType> RealType inline foo(const RealType& a, const RealType& b, const RealType& c, const RealType& d, const RealType& e, const RealType& f, const RealType& g, const RealType& h){ return 0; }
+
+[endsect]
+
 [section Imported code and callouts]
 
 [import stub.cpp]

Modified: trunk/libs/accumulators/doc/Jamfile.v2
==============================================================================
--- trunk/libs/accumulators/doc/Jamfile.v2 (original)
+++ trunk/libs/accumulators/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -228,6 +228,8 @@
         <xsl:param>chunk.section.depth=2
     ;
 
+path-constant images_location : html ;
+
 boostbook standalone
     :
         accumulators
@@ -239,4 +241,6 @@
         <dependency>accdoc
         <dependency>statsdoc
         <dependency>opdoc
+ <format>pdf:<xsl:param>img.src.path=$(images_location)/
     ;
+

Modified: trunk/libs/asio/doc/Jamfile.v2
==============================================================================
--- trunk/libs/asio/doc/Jamfile.v2 (original)
+++ trunk/libs/asio/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -89,6 +89,8 @@
 
 explicit asio_examples ;
 
+path-constant images_location : ../../../doc/html ;
+
 boostbook asio
   :
     asio_doc
@@ -101,6 +103,7 @@
     <xsl:param>generate.section.toc.level=1
     <xsl:param>generate.toc="chapter nop section nop"
     <xsl:param>root.filename=boost_asio
+ <format>pdf:<xsl:param>img.src.path=$(images_location)/
   :
     <dependency>asio_doc_images
     <dependency>asio_examples

Modified: trunk/libs/bimap/doc/jamfile.v2
==============================================================================
--- trunk/libs/bimap/doc/jamfile.v2 (original)
+++ trunk/libs/bimap/doc/jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -17,6 +17,8 @@
         bimap.qbk
     ;
 
+path-constant images_location : html ;
+
 boostbook standalone
     :
         bimap
@@ -26,6 +28,7 @@
         <xsl:param>toc.max.depth=2
         <xsl:param>toc.section.depth=4
         <xsl:param>chunk.section.depth=2
+ <format>pdf:<xsl:param>img.src.path=$(images_location)/
     ;
 
 

Modified: trunk/libs/functional/hash/doc/Jamfile.v2
==============================================================================
--- trunk/libs/functional/hash/doc/Jamfile.v2 (original)
+++ trunk/libs/functional/hash/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -5,7 +5,7 @@
 
 xml hash : hash.qbk ;
 boostbook standalone : hash :
- <xsl:param>admon.graphics.path=images/
+ <format>html:<xsl:param>admon.graphics.path=images/
     <xsl:param>navig.graphics.path=images/
     <xsl:param>html.stylesheet=boostbook.css
     <xsl:param>boost.root=../../../../..

Modified: trunk/libs/lambda/doc/Jamfile.v2
==============================================================================
--- trunk/libs/lambda/doc/Jamfile.v2 (original)
+++ trunk/libs/lambda/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -1,5 +1,11 @@
 project boost/doc ;
 import boostbook : boostbook ;
 
-boostbook lambda-doc : lambda.xml ;
+# Are these really the correct images??
+path-constant images : ../../spirit/phoenix/doc/html ;
+
+boostbook lambda-doc : lambda.xml
+:
+ <format>pdf:<xsl:param>img.src.path=$(images)/
+;
 

Modified: trunk/libs/proto/doc/Jamfile.v2
==============================================================================
--- trunk/libs/proto/doc/Jamfile.v2 (original)
+++ trunk/libs/proto/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -67,7 +67,7 @@
         # Set this one for PDF generation *only*:
         # default png graphics are awful in PDF form,
         # better use SVG's instead:
- <format>pdf:<xsl:param>admon.graphics.extension=".svg"
- <format>pdf:<xsl:param>admon.graphics.path="$(admon-graphics-path)"
- <format>pdf:<xsl:param>callout.graphics.path="$(callout-graphics-path)"
+ #<format>pdf:<xsl:param>admon.graphics.extension=".svg"
+ #<format>pdf:<xsl:param>admon.graphics.path="$(admon-graphics-path)"
+ #<format>pdf:<xsl:param>callout.graphics.path="$(callout-graphics-path)"
     ;

Modified: trunk/libs/python/doc/tutorial/doc/Jamfile.v2
==============================================================================
--- trunk/libs/python/doc/tutorial/doc/Jamfile.v2 (original)
+++ trunk/libs/python/doc/tutorial/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -6,6 +6,8 @@
 import boostbook : boostbook ;
 using quickbook ;
 
+path-constant images : html ;
+
 boostbook tutorial
     :
         tutorial.qbk
@@ -13,4 +15,5 @@
         <xsl:param>boost.root=../../../../../..
         <xsl:param>boost.libraries=../../../../../../libs/libraries.htm
         <xsl:param>html.stylesheet=../../../../../../doc/html/boostbook.css
+ <format>pdf:<xsl:param>img.src.path=$(images)/
     ;

Modified: trunk/libs/spirit/phoenix/doc/Jamfile.v2
==============================================================================
--- trunk/libs/spirit/phoenix/doc/Jamfile.v2 (original)
+++ trunk/libs/spirit/phoenix/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -10,6 +10,8 @@
 import boostbook : boostbook ;
 using quickbook ;
 
+path-constant images : html ;
+
 boostbook quickbook
     :
         users_manual.qbk
@@ -17,5 +19,7 @@
         <xsl:param>boost.root=../../../../..
         <xsl:param>boost.libraries=../../../../libraries.htm
         <xsl:param>html.stylesheet=../../../../../doc/html/boostbook.css
+ <format>pdf:<xsl:param>img.src.path=$(images)/
     ;
 
+

Modified: trunk/libs/units/doc/Jamfile.v2
==============================================================================
--- trunk/libs/units/doc/Jamfile.v2 (original)
+++ trunk/libs/units/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -204,29 +204,8 @@
     <xsl:param>chunk.section.depth=8
     <xsl:param>boost.root="../../../.."
     <xsl:param>html.stylesheet=../../../../doc/html/boostbook.css
-
- # PDF Options:
- # TOC generation: uses XEP extensions at present, change to fop1 to use Apache FOP.
- <format>pdf:<xsl:param>xep.extensions=1
- <format>pdf:<xsl:param>fop.extensions=0
- <format>pdf:<xsl:param>fop1.extensions=0
- # No indent on body text:
- <format>pdf:<xsl:param>body.start.indent=0pt
- # Margin size:
- <format>pdf:<xsl:param>page.margin.inner=0.5in
- # Margin size:
- <format>pdf:<xsl:param>page.margin.outer=0.5in
- # Paper type = A4
- <format>pdf:<xsl:param>paper.type=A4
- # Yes, we want graphics for admonishments:
- <xsl:param>admon.graphics=1
- # Set this one for PDF generation *only*:
- # default pnd graphics are awful in PDF form,
- # better use SVG's instead:
- <format>pdf:<xsl:param>admon.graphics.extension=".svg"
- <format>pdf:<xsl:param>img.src.path=$(images_location)/
- <format>pdf:<xsl:param>admon.graphics.path=../../../doc/src/images
- <format>pdf:<xsl:param>draft.mode="no"
 ;
 
 
+
+

Modified: trunk/libs/unordered/doc/Jamfile.v2
==============================================================================
--- trunk/libs/unordered/doc/Jamfile.v2 (original)
+++ trunk/libs/unordered/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -8,7 +8,7 @@
 
 xml unordered : unordered.qbk ;
 boostbook standalone : unordered :
- <xsl:param>admon.graphics.path=images/
+ <format>html:<xsl:param>admon.graphics.path=images/
     <xsl:param>navig.graphics.path=images/
     <xsl:param>html.stylesheet=boostbook.css
     <xsl:param>boost.root=../../../..

Modified: trunk/tools/boostbook/xsl/fo.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/fo.xsl (original)
+++ trunk/tools/boostbook/xsl/fo.xsl 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -180,7 +180,8 @@
 
 <!--
 Put a box around code blocks, also set the font size
-and keep the block together if we can:
+and keep the block together if we can using the widows
+and orphans controls:
 -->
 <xsl:attribute-set name="monospace.verbatim.properties">
   <xsl:attribute name="border-color">#DCDCDC</xsl:attribute>
@@ -190,10 +191,15 @@
   <xsl:attribute name="padding-right">0.2cm</xsl:attribute>
   <xsl:attribute name="padding-top">0.2cm</xsl:attribute>
   <xsl:attribute name="padding-bottom">0.2cm</xsl:attribute>
- <xsl:attribute name="keep-together">1</xsl:attribute>
+ <xsl:attribute name="widows">6</xsl:attribute>
+ <xsl:attribute name="orphans">40</xsl:attribute>
   <xsl:attribute name="font-size">9pt</xsl:attribute>
 </xsl:attribute-set>
 
+<!--
+Put some small amount of padding around table cells, and keep tables
+together on one page if possible:
+-->
 <xsl:attribute-set name="table.cell.padding">
   <xsl:attribute name="padding-left">0.2cm</xsl:attribute>
   <xsl:attribute name="padding-right">0.2cm</xsl:attribute>
@@ -205,8 +211,43 @@
   <xsl:attribute name="keep-together">1</xsl:attribute>
 </xsl:attribute-set>
 
- <xsl:param name="table.frame.border.color">#DCDCDC</xsl:param>
+<!--
+General default options go here:
+* Borders are mid-grey.
+* Body text is not indented compared to the titles.
+* Page margins are a rather small 0.5in, but we need
+ all the space we can get for code blocks.
+* Paper size is A4: an ISO standard, and just slightly smaller than US Letter.
+* Use SVG graphics for admonishments: the bitmaps look awful in PDF's.
+* Disable draft mode so we're not constantly trying to download the necessary graphic.
+* Set default image paths to pull down direct from SVN: individual Jamfiles can override this
+ and pass an absolute path to local versions of the images, but we can't get that here, so
+ we'll use SVN instead so that most things "just work".
+-->
+<xsl:param name="table.frame.border.color">#DCDCDC</xsl:param>
 <xsl:param name="table.cell.border.color">#DCDCDC</xsl:param>
+<xsl:param name="body.start.indent">0pt</xsl:param>
+<xsl:param name="page.margin.inner">0.5in</xsl:param>
+<xsl:param name="page.margin.outer">0.5in</xsl:param>
+<xsl:param name="paper.type">A4</xsl:param>
+<xsl:param name="admon.graphics">1</xsl:param>
+<xsl:param name="admon.graphics.extension">.svg</xsl:param>
+<xsl:param name="draft.mode">no</xsl:param>
+<xsl:param name="admon.graphics.path">http://svn.boost.org/svn/boost/trunk/doc/src/images/>
+<xsl:param name="callout.graphics.path">
http://svn.boost.org/svn/boost/trunk/doc/src/images/callouts/>
+<xsl:param name="img.src.path">
http://svn.boost.org/svn/boost/trunk/doc/html/>
+
+<!-- Ideally we would use this to force top level sections
+ to start on a new page, unfortunately this causes rather
+ unfortunate page breaks in some Doxygen-generated
+ documentation which uses <refentry> and <synopsis>
+ sections :-(
 
+<xsl:attribute-set name="section.level1.properties">
+ <xsl:attribute name="break-before">page</xsl:attribute>
+</xsl:attribute-set>
+
+-->
+
 </xsl:stylesheet>
 

Modified: trunk/tools/jam/doc/build.jam
==============================================================================
--- trunk/tools/jam/doc/build.jam (original)
+++ trunk/tools/jam/doc/build.jam 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -25,14 +25,14 @@
     :
         bjam
     :
- <format>html
+ #<format>html
         <name>html
         <dependency>html
         <dependency>html/images
         <xsl:param>boost.root=.
         <xsl:param>nav.layout=none
- <xsl:param>admon.graphics.path=images/
- <xsl:param>navig.graphics.path=images/
+ <format>html:<xsl:param>admon.graphics.path=images/
+ <format>html:<xsl:param>navig.graphics.path=images/
     ;
 
 # Copyright Rene Rivera 2005-2006. Use, modification, and distribution are

Modified: trunk/tools/quickbook/doc/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/doc/Jamfile.v2 (original)
+++ trunk/tools/quickbook/doc/Jamfile.v2 2009-02-08 11:59:14 EST (Sun, 08 Feb 2009)
@@ -5,6 +5,8 @@
 
 xml quickbook : quickbook.qbk ;
 
+path-constant images : ../../../doc/html ;
+
 boostbook standalone
     :
         quickbook
@@ -17,4 +19,5 @@
         <xsl:param>chunk.first.sections=1
 
         #<xsl:param>callout.graphics.path=../../images/callouts//
+ <format>pdf:<xsl:param>img.src.path=$(images)/
     ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk