[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: DOCBOOK-APPS: sgml auto-indenter
Several people have discussed the use of tidy to indent sgml and xml sources. It didn't work for my documents, asThanks for the feedback. Before I make the changes, this is what I am thinking:
tidy did not recognize my entities. Rather than fix tidy, I just wrote a perl script to indent anything with sgml-type
tags. Only non-empty tags are indented, and text is justified at 80 characters/line (easily changed). Try it out, if you
like, and let me know what needs fixing. I am running perl under redhat 6.1.
<PARA>
Here is some text containing an <EMPHASIS>important</EMPHASIS> word.
But I would like to indent
<ORDEREDLIST>
<LISTITEM><PARA>
Lists</PARA></LISTITEM>
<LISTITEM><PARA>
Paragraphs but not <EMPHASIS>emphasis</EMPHASIS></PARA>
</LISTITEM>
</ORDEREDLIST>
This text will be passed through
unaltered.
</PARA>Would be processed to:
<PARA>
Here is some text containing an <EMPHASIS>important</EMPHASIS> word. But I
would like to indent
<ORDEREDLIST>
<LISTITEM>
<PARA>
Lists
</PARA>
</LISTITEM>
<LISTITEM>
<PARA>
Paragraphs but not <EMPHASIS>emphasis</EMPHASIS>
</PARA>
</LISTITEM>
</ORDEREDLIST>
This text will be passed through
unaltered.
</PARA>In this example, all <PARA>'s are indented because at least one </PARA> appeared first on a line. But <EMPHASIS> is not indented because none of the </EMPHASIS> tags appeared first on a line. If an author
-- Kevin M. Dunn kdunn@hsc.edu Department of Chemistry Hampden-Sydney College HSC, VA 23943 (804) 223-6181 (804) 223-6374 (Fax)
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC