- sub do_doc {
- my( $type, $xml_path ) = @_;
-
- ## Read and validate the XML file
- my $xml = XML::LibXML->new()->parse_file( $xml_path ) or die $!;
-
- ## Get the version number
- my $version = $xml->findvalue('/book/bookinfo/revhistory/revision/revnumber');
- die "Unable to get version number\n" unless defined $version && $version =~ /^\d+(\.\d+)*$/;
-
- ## Prepend chapter filenames?
- my $prepend_chapter = $type eq 'filter' ? 'filter_' : '';
-
- ## Add the canonical url for this document
- $xml->documentElement()->appendTextChild('canonical_url',"${canonical_url}exim-html-current/doc/html/spec_html/".($type eq 'spec'?'index':'filter').".html");
-
- ## Fixup the XML
- xref_fixup( $xml, $prepend_chapter );
-
- ## Generate the front page
- {
- my $path = "exim-html-$version/doc/html/spec_html/".($type eq 'filter'?$type:'index').".html";
- print "Generating : docroot:/$path\n";
- transform( $xml,
- "$opt{tmpl}/doc/index.xsl",
- "$opt{docroot}/$path",
- );
- }
-
- ## Generate a Table of Contents XML file
- {
- my $path = "exim-html-$version/doc/html/spec_html/".($type eq 'filter'?'filter_toc':'index_toc').".xml";
- print "Generating : docroot:/$path\n";
- transform( $xml,
- "$opt{tmpl}/doc/toc.xsl",
- "$opt{docroot}/$path",
- );
- }
-
- ## Generate the chapters
- my $counter = 0;
- foreach my $chapter ( map {$_->cloneNode(1)} $xml->findnodes('/book/chapter') ){
-
- ## Add a <chapter_id>N</chapter_id> node for the stylesheet to use
- $chapter->appendTextChild( 'chapter_id', ++$counter );
-
- ## Add previous/next/canonical urls for nav
- {
- $chapter->appendTextChild( 'prev_url',
+sub do_doc {
+ my ( $type, $xml_path ) = @_;
+
+ ## Read and validate the XML file
+ my $xml = XML::LibXML->new()->parse_file($xml_path) or die $!;
+
+ ## Get the version number
+ my $version = $xml->findvalue('/book/bookinfo/revhistory/revision/revnumber');
+ die "Unable to get version number\n" unless defined $version && $version =~ /^\d+(\.\d+)*$/;
+
+ ## Prepend chapter filenames?
+ my $prepend_chapter = $type eq 'filter' ? 'filter_' : '';
+
+ ## Add the canonical url for this document
+ $xml->documentElement()
+ ->appendTextChild( 'canonical_url',
+ "${canonical_url}exim-html-current/doc/html/spec_html/" . ( $type eq 'spec' ? 'index' : 'filter' ) . ".html" );
+
+ ## Fixup the XML
+ xref_fixup( $xml, $prepend_chapter );
+
+ ## Generate the front page
+ {
+ my $path = "exim-html-$version/doc/html/spec_html/" . ( $type eq 'filter' ? $type : 'index' ) . ".html";
+ print "Generating : docroot:/$path\n";
+ transform( $xml, "$opt{tmpl}/doc/index.xsl", "$opt{docroot}/$path", );
+ }
+
+ ## Generate a Table of Contents XML file
+ {
+ my $path = "exim-html-$version/doc/html/spec_html/" . ( $type eq 'filter' ? 'filter_toc' : 'index_toc' ) . ".xml";
+ print "Generating : docroot:/$path\n";
+ transform( $xml, "$opt{tmpl}/doc/toc.xsl", "$opt{docroot}/$path", );
+ }
+
+ ## Generate the chapters
+ my $counter = 0;
+ foreach my $chapter ( map { $_->cloneNode(1) } $xml->findnodes('/book/chapter') ) {
+
+ ## Add a <chapter_id>N</chapter_id> node for the stylesheet to use
+ $chapter->appendTextChild( 'chapter_id', ++$counter );
+
+ ## Add previous/next/canonical urls for nav
+ {
+ $chapter->appendTextChild( 'prev_url',