On Wed, Aug 04, 1999 at 05:01:20AM +0200, Michael Bramer wrote: > I work a little with debiandoc and I nned index support. > > With latex is index a nice and a easy thing. Have someone work on this? > If not, I try to add index support, but only for the latex-output. > (not html, this perl-script must write another) > > Commnets? No comments? ok. I make the patch: ###################################### diff -ur usr/lib/debiandoc-sgml/lib/DebianDoc_SGML/Format/Driver.pm usr-new/lib/debiandoc-sgml/lib/DebianDoc_SGML/Format/Driver.pm --- usr/lib/debiandoc-sgml/lib/DebianDoc_SGML/Format/Driver.pm Fri Jul 23 02:33:55 1999 +++ usr-new/lib/debiandoc-sgml/lib/DebianDoc_SGML/Format/Driver.pm Thu Aug 5 00:49:50 1999 @@ -876,6 +876,21 @@ } ## ---------------------------------------------------------------------- +sub start_index +{ + ( $element, $event ) = @_; + my $index = _a( 'ID' ); + $index =~ s/^\s+//; + $index =~ s/\s+$//; + $index =~ s/\s+/ /g; + &{$Format."::"._output_index}( $index ) + if length( $index and $Format eq "DebianDoc_SGML::Format::LaTeX" ); +} +sub end_index +{ +} + +## ---------------------------------------------------------------------- sub start_ref { ( $element, $event ) = @_; @@ -1252,6 +1267,10 @@ ## ---------------------------------------------------------------------- ::sgml( '<QREF>', \&start_qref ); ::sgml( '</QREF>', \&end_qref ); + +## ---------------------------------------------------------------------- +::sgml( '<INDEX>', \&start_index ); +::sgml( '</INDEX>', \&end_index ); ## ---------------------------------------------------------------------- ::sgml( '<REF>', \&start_ref ); diff -ur usr/lib/debiandoc-sgml/lib/DebianDoc_SGML/Format/LaTeX.pm usr-new/lib/debiandoc-sgml/lib/DebianDoc_SGML/Format/LaTeX.pm --- usr/lib/debiandoc-sgml/lib/DebianDoc_SGML/Format/LaTeX.pm Fri Jul 23 02:33:55 1999 +++ usr-new/lib/debiandoc-sgml/lib/DebianDoc_SGML/Format/LaTeX.pm Wed Aug 4 19:46:03 1999 @@ -435,6 +435,10 @@ ## ---------------------------------------------------------------------- ## xref output subroutines ## ---------------------------------------------------------------------- +sub _output_index +{ + output( "\\index{$_[0]}" ); +} sub _output_ref { output( "`$_[0]' \\vpageref{$_[2]}" ); diff -ur usr/lib/sgml/DebianDoc/dtd/DebianDoc usr-new/lib/sgml/DebianDoc/dtd/DebianDoc --- usr/lib/sgml/DebianDoc/dtd/DebianDoc Fri Jul 23 02:33:56 1999 +++ usr-new/lib/sgml/DebianDoc/dtd/DebianDoc Wed Aug 4 20:45:18 1999 @@ -37,7 +37,7 @@ <!entity urlname sdata "urlname" > -<!entity % xref "ref|manref|email|ftpsite|ftppath|httpsite|httppath|url"> +<!entity % xref "ref|manref|email|ftpsite|ftppath|httpsite|httppath|url|index"> <!entity % emph "em|strong|var|package|prgn|file|tt|qref"> <!entity % list "list|enumlist|taglist"> <!entity % inline "(#pcdata|%emph|%xref|footnote|comment)+"> @@ -108,6 +108,10 @@ <!element tt - - (%inline)> <!element qref - - (%inline)> <!attlist qref id cdata #required> +<!-- by grisu --> + +<!element index - o empty> +<!attlist index id cdata #required> <!element ref - o empty> <!attlist ref id cdata #required> diff -ur usr/lib/sgml/dtd/debiandoc.dtd usr-new/lib/sgml/dtd/debiandoc.dtd --- usr/lib/sgml/dtd/debiandoc.dtd Fri Jul 23 02:33:56 1999 +++ usr-new/lib/sgml/dtd/debiandoc.dtd Wed Aug 4 20:45:18 1999 @@ -37,7 +37,7 @@ <!entity urlname sdata "urlname" > -<!entity % xref "ref|manref|email|ftpsite|ftppath|httpsite|httppath|url"> +<!entity % xref "ref|manref|email|ftpsite|ftppath|httpsite|httppath|url|index"> <!entity % emph "em|strong|var|package|prgn|file|tt|qref"> <!entity % list "list|enumlist|taglist"> <!entity % inline "(#pcdata|%emph|%xref|footnote|comment)+"> @@ -108,6 +108,10 @@ <!element tt - - (%inline)> <!element qref - - (%inline)> <!attlist qref id cdata #required> +<!-- by grisu --> + +<!element index - o empty> +<!attlist index id cdata #required> <!element ref - o empty> <!attlist ref id cdata #required> ###################################### Gruss Grisu -- Michael Bramer -- a Debian Linux Developer http://www.debian.org PGP: finger grisu@master.debian.org -- Linux Sysadmin -- Use Debian Linux "The Box said 'Windows NT or better', so I installed Debian Linux"
Attachment:
pgp5joKVBbWfy.pgp
Description: PGP signature