← Prev in month ← Prev in thread

DOCBOOK-APPS: sgml auto-indenter

From
Kevin M. Dunn <>
Date
2000-11-26T20:23:18+00:00
ID
Thread
DOCBOOK-APPS: sgml auto-indenter
#!/usr/bin/perl -w
#
# sb: the sgml beautifier
# indents non-empty sgml tags
# usage: sb filename or sb < filename or | sb
# author: Kevin M. Dunn ()
# license: anyone is free to use this for any purpose whatever
#
$jl = 80; #text will be justified to 80 characters/line
$nl = 0;
$sp = 0;
$newline = ""; # hack to prevent extraneous blank first line
$space[0] = "";
separate_tags();
get_tags();
indent_tags();
unlink ("$$.tmp"); # remove temporary file
print "\n"; # add final newline to output
sub separate_tags {
  open(FILETMP, ">$$.tmp");
  while (<>){
    $_ =~ s/</\n</g;
← Prev in month ← Prev in thread