--- embedaddon/bird/tools/progdoc 2017/08/22 12:33:54 1.1 +++ embedaddon/bird/tools/progdoc 2021/03/17 19:50:23 1.1.1.2 @@ -3,9 +3,7 @@ $srcdir = $ARGV[0]; open(OUT, ">prog.sgml") || die "Cannot create output file"; -include("doc/prog-head.sgml"); -process(""); -include("doc/prog-foot.sgml"); +process("", "doc/prog-root"); close OUT; exit 0; @@ -20,8 +18,9 @@ sub include { sub process { my $dir = shift @_; - print "$dir/Doc\n"; - open(IN, "$srcdir/$dir/Doc") || die "Unable to read $dir/Doc"; + my $doc = "$dir/" . shift @_; + print "$doc\n"; + open(IN, "$srcdir/$doc") || die "Unable to read $doc"; my @docfile = ; close IN; foreach $_ (@docfile) { @@ -30,7 +29,7 @@ sub process { /^([A-Z]+)\s*(.*)/ || die "Parse error: $_"; $cmd = $1; $arg = $2; - if ($cmd eq "C") { process("$dir/$arg"); } + if ($cmd eq "C") { process("$dir/$arg", "Doc"); } elsif ($cmd eq "H") { push @stack, "H"; print OUT "$arg\n";