From: Nigel Metheringham Date: Wed, 7 Jul 2010 21:15:59 +0000 (+0100) Subject: Made index have long references X-Git-Tag: exim-4_89_1~109 X-Git-Url: https://git.exim.org/exim-website.git/commitdiff_plain/596e5400822242a1076979102fa590054834b68a Made index have long references --- diff --git a/script/gen.pl b/script/gen.pl index 1b20793..7bc1309 100755 --- a/script/gen.pl +++ b/script/gen.pl @@ -185,8 +185,12 @@ sub xref_fixup { } my $section_title = $section->findvalue('title'); - $index{$section_id} = - { chapter_id => $chapter_counter, chapter_title => $chapter_title, section_id => $section_counter }; + $index{$section_id} = { + chapter_id => $chapter_counter, + chapter_title => $chapter_title, + section_id => $section_counter, + section_title => $section_title + }; } } ## Build indexes as new chapters @@ -198,7 +202,8 @@ sub xref_fixup { if ( exists $index{$linkend} ) { $xref->setAttribute( 'chapter_id', $index{$linkend}{'chapter_id'} ); $xref->setAttribute( 'chapter_title', $index{$linkend}{'chapter_title'} ); - $xref->setAttribute( 'section_id', $index{$linkend}{'section_id'} ) if $index{$linkend}{'section_id'}; + $xref->setAttribute( 'section_id', $index{$linkend}{'section_id'} ) if ( $index{$linkend}{'section_id'} ); + $xref->setAttribute( 'section_title', $index{$linkend}{'section_title'} ) if ( $index{$linkend}{'section_title'} ); $xref->setAttribute( 'url', sprintf( '%sch%02d.html', $prepend_chapter, $index{$linkend}{'chapter_id'} ) . ( $index{$linkend}{'section_id'} ? '#' . $linkend : '' ) ); @@ -271,6 +276,7 @@ sub build_indexes { if ( $count++ ); my $xrefel = XML::LibXML::Element->new('xref'); $xrefel->setAttribute( linkend => $ref ); + $xrefel->setAttribute( longref => 1 ); $spara->appendChild($xrefel); } } diff --git a/templates/wrapper.xsl b/templates/wrapper.xsl index ba0c634..c816ca2 100644 --- a/templates/wrapper.xsl +++ b/templates/wrapper.xsl @@ -141,10 +141,24 @@ - + + + + + + + + - + + + + + + + +