Add pdf generation via latex.
diff --git a/asio/src/doc/.cvsignore b/asio/src/doc/.cvsignore index 2318f6b..32e513a 100644 --- a/asio/src/doc/.cvsignore +++ b/asio/src/doc/.cvsignore
@@ -1,3 +1,5 @@ bin html reference.tags +asio.docbook +*.pdf
diff --git a/asio/src/doc/Jamfile.v2 b/asio/src/doc/Jamfile.v2 index 67ddf29..e2dc9a8 100644 --- a/asio/src/doc/Jamfile.v2 +++ b/asio/src/doc/Jamfile.v2
@@ -57,3 +57,6 @@ overview/async_op2.png asio.png ; + +install asioref : standalone : <location>. <format>docbook ; +explicit asioref ;
diff --git a/asio/src/doc/asioref.sty b/asio/src/doc/asioref.sty new file mode 100644 index 0000000..2bf5a8d --- /dev/null +++ b/asio/src/doc/asioref.sty
@@ -0,0 +1,90 @@ +%% +%% This is a DocBook LaTeX style for Asio +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mybook}[2008/11/11 Asio DocBook Style] + +% The defined options +\DeclareOption{hyperlink}{ \def\DBKhyperlink{yes} } +\DeclareOption{nohyperlink}{ \def\DBKhyperlink{no} } + +% Default values +\ExecuteOptions{nohyperlink} + +% If defined, process the options +\ProcessOptions\relax + +% Needed packages +\usepackage[top=2cm,bottom=2cm,left=1.5cm,right=1.5cm]{geometry} +\usepackage{float} +\usepackage{dbk_core} +\usepackage{dbk_admonition} +\usepackage{fancyvrb} + +% Text layout +\setlength\parskip{\medskipamount} +\setlength\parindent{0pt} +\raggedbottom + +% Stuff we don't need +\def\DBKinditem#1#2{} +\newenvironment{DBKindtable}{}{} +\newenvironment{DBKrevtable}{}{} +\newenvironment{DBKlegalnotice}{}{} + +% Admonitions +\floatstyle{boxed} +\newfloat{DBKadmonition}{h}{lop} +\newfloat{sidebar}{h}{lop} + +% Page break before sections +\let\orig@section\section +\renewcommand\section{ + \clearpage\orig@section +} + +% Ensure line break after paragraph heading +\renewcommand\paragraph{% + \@startsection{paragraph}{4}{\z@}% + {-2.25ex\@plus -1ex \@minus -.2ex}% + {0.5ex \@plus .2ex}% + {\normalfont\normalsize\bfseries}% +} + +% Add page numbers to hyperlinks +%\let\orig@hyperlink\hyperlink +%\renewcommand{\hyperlink}[2]{ +% \orig@hyperlink{#1}{#2} (page \pageref{#1}) +%} + +% Extra indent on TOC section numbers +\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{3.3em}} +\renewcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{4.2em}} +\renewcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{5.1em}} + +% Title page +\renewcommand\maketitle{ + \null + \thispagestyle{empty} + \begin{center} + \null\vskip 7cm + \begin{LARGE} + asio C++ library + \end{LARGE} + \null\vskip 1cm + \begin{large} + \DBKsubtitle{} + \end{large} + \null\vskip 1cm + \begin{Large} + Reference Manual + \end{Large} + \null\vskip 5cm + \begin{small} + \DBKcopyright{} + \end{small} + \end{center} + \vfill + \null + \cleardoublepage +}
diff --git a/asio/src/doc/asioref.xsl b/asio/src/doc/asioref.xsl new file mode 100644 index 0000000..cdc9280 --- /dev/null +++ b/asio/src/doc/asioref.xsl
@@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + +<!-- + Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot 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) +--> + +<xsl:output method="xml"/> +<xsl:strip-space elements="title"/> + +<xsl:param name="asio.version">X.Y.Z</xsl:param> + +<xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> +</xsl:template> + +<xsl:template match="blockquote/para"> + <xsl:apply-templates select="para"/> +</xsl:template> + +<xsl:template match="title/link"> + <xsl:value-of select="normalize-space(.)"/> +</xsl:template> + +<xsl:template match="bridgehead[count(link) > 0]"> + <xsl:element name="bridgehead"> + <xsl:attribute name="renderas"> + <xsl:value-of select="@renderas"/> + </xsl:attribute> + <xsl:value-of select="normalize-space(link)"/> + </xsl:element> +</xsl:template> + +<xsl:template match="chapter"> + <article id="asio" name="Asio Reference Manual" dirname="asio"> + <xsl:apply-templates select="chapterinfo"/> + <title>Asio Reference Manual</title> + <xsl:apply-templates select="section"/> + </article> +</xsl:template> + +<xsl:template match="chapterinfo"> + <articleinfo> + <xsl:apply-templates select="*"/> + <subtitle><xsl:value-of select="$asio.version"/></subtitle> + </articleinfo> +</xsl:template> + +<xsl:template match="section[@id='asio.reference']/informaltable"> + <xsl:element name="informaltable"> + <xsl:attribute name="role">scriptsize</xsl:attribute> + <xsl:apply-templates select="*"/> + </xsl:element> +</xsl:template> + +<xsl:template match="section[@id='asio.examples']/*/listitem"> + <xsl:element name="listitem"> + <xsl:value-of select="substring-after(normalize-space(ulink), '../')"/> + </xsl:element> +</xsl:template> + +<xsl:template match="imagedata"> + <xsl:element name="imagedata"> + <xsl:attribute name="fileref"> + <xsl:value-of select="@fileref"/> + </xsl:attribute> + <xsl:attribute name="scale">75</xsl:attribute> + <xsl:attribute name="align">center</xsl:attribute> + </xsl:element> +</xsl:template> + +<xsl:template match="section[@id='asio.index']"></xsl:template> + +</xsl:stylesheet> +
diff --git a/asio/src/doc/makepdf.pl b/asio/src/doc/makepdf.pl new file mode 100755 index 0000000..a37bdab --- /dev/null +++ b/asio/src/doc/makepdf.pl
@@ -0,0 +1,26 @@ +#!/usr/bin/perl -w + +# Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot 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) + +use strict; + +# Determine version number +my $version = "X.Y.Z"; +open(VERSION, "../../include/asio/version.hpp") or die("Can't open version.hpp"); +while (my $line = <VERSION>) +{ + if ($line =~ /^#define ASIO_VERSION .* \/\/ (.*)$/) + { + $version = $1; + } +} +close(VERSION); + +# Generate PDF output +system("bjam asioref"); +system("xsltproc --stringparam asio.version $version asioref.xsl asio.docbook > asioref.docbook"); +system("dblatex -I overview -s asioref.sty -P table.in.float=0 -o asioref-$version.pdf asioref.docbook"); +system("rm asioref.docbook");