diff options
| author | fukachan <fukachan> | 2001-04-28 14:37:03 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-04-28 14:37:03 +0000 |
| commit | b02a3dbea3fb71770be5a53f7fef2485a9f3465d (patch) | |
| tree | 3e7207281b77f751f2eb7afe78b84f83e720402f /fml/doc/ja/utils/bin/data2sgml.pl | |
| parent | d4bc98735a52ec6e2f9af1ed83840e58dbd84b5c (diff) | |
| download | fml8-b02a3dbea3fb71770be5a53f7fef2485a9f3465d.tar.gz fml8-b02a3dbea3fb71770be5a53f7fef2485a9f3465d.tar.bz2 fml8-b02a3dbea3fb71770be5a53f7fef2485a9f3465d.zip | |
list of default perl version which the shipped OS has.
import fml 4.0 doc/devel/OS_and_Perl.txt and SGML-ify it.
Diffstat (limited to 'fml/doc/ja/utils/bin/data2sgml.pl')
| -rwxr-xr-x | fml/doc/ja/utils/bin/data2sgml.pl | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/fml/doc/ja/utils/bin/data2sgml.pl b/fml/doc/ja/utils/bin/data2sgml.pl new file mode 100755 index 00000000..db737b60 --- /dev/null +++ b/fml/doc/ja/utils/bin/data2sgml.pl @@ -0,0 +1,81 @@ +#!/usr/local/bin/perl +# +# $FML$ +# + +use strict; +use Carp; +use vars qw(%list @ENTRY); + +@ENTRY = ('system', + 'release', + 'perl.version', + 'perl.path', + 'comments' + ); + +my ($system, $release, $key, $value); +my $in_row = 0; + + +while (<>) { + if (/^\s*$/) { + if ( $list{ 'title' } ) { + table_head(\%list, $list{'title'} ); + } + elsif (%list) { + show_row(); + show_list(\%list); + } + undef %list; + } + + if (/^\[(\S+)\]\s+(.*)/) { + ($key, $value) = ($1, $2); + $list{ $key } .= $value; + } +} + +print "\t</row>\n"; +print " </tbody>\n"; +print " </tgroup>\n"; +print "</table>\n"; + +exit 0; + + +sub table_head +{ + my ($list, $title) = @_; + my $cols = length(@ENTRY); + + print "<table>\n"; + print " <title> $title </title>\n\n"; + print " <tgroup cols=$cols>\n"; + print " <thead>\n"; + print "\t<row>\n"; + + show_list( $list ); + + print "\t</row>\n"; + print " </thead>\n\n"; + print " <tbody>\n"; +} + + +sub show_row +{ + print "\t</row>\n" if $in_row; + print "\n\t<row>\n"; + $in_row = 1; +} + + +sub show_list +{ + my ($list) = @_; + + for (@ENTRY) { + print "\t<entry>", $list->{ $_ }, "</entry>\n"; + } +} |
