diff options
| author | fukachan <fukachan> | 2005-12-15 03:10:13 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2005-12-15 03:10:13 +0000 |
| commit | 49dd96457838e676196ccf8963cd079160e98771 (patch) | |
| tree | 89004947164e4411acdb3098aa866c6cb3f4de28 /fml/utils | |
| parent | 009877f9f6afd294ded2a883e4086877b33b5381 (diff) | |
| download | fml8-49dd96457838e676196ccf8963cd079160e98771.tar.gz fml8-49dd96457838e676196ccf8963cd079160e98771.tar.bz2 fml8-49dd96457838e676196ccf8963cd079160e98771.zip | |
change title according to LANG_HIT env var.
change output style
<setc1>
<setc2>
<itemizedlist>
...
Diffstat (limited to 'fml/utils')
| -rwxr-xr-x | fml/utils/bin/listup_recipes.pl | 54 |
1 files changed, 51 insertions, 3 deletions
diff --git a/fml/utils/bin/listup_recipes.pl b/fml/utils/bin/listup_recipes.pl index 38a483ed..31a57dc9 100755 --- a/fml/utils/bin/listup_recipes.pl +++ b/fml/utils/bin/listup_recipes.pl @@ -1,13 +1,18 @@ #!/usr/bin/env perl #-*- perl -*- # -# $FML: check.pl,v 1.1.1.1 2005/09/30 13:30:31 fukachan Exp $ +# $FML: listup_recipes.pl,v 1.1 2005/11/19 03:50:51 fukachan Exp $ +# + +# +# *** CAUTION: THIS FILE CODE IS JAPANESE EUC. *** # use strict; use Carp; use vars qw(%entity %file %used %file_in_dir - $cur_id $on_table $in_question); + $cur_id $on_table $in_question $in_sect2 $in_itemizedlist + $found_chapter $found_title); my $entity = "include/chapters.ent"; parse($entity); @@ -58,15 +63,42 @@ sub scan my ($buf) = @_; if ($buf =~ /id=\"(\S+)\"/) { + if ($buf =~ /<chapter\s+/i) { + $found_chapter = 1; + } $cur_id = $1; return; } + if ($buf =~ /<title>/i) { + $found_title = 1; + return; + } + if ($buf =~ /TABLE_OF_RECIPES/) { $on_table = 1; return; } + if ($found_chapter && $found_title) { + if ($in_sect2) { + if ($in_itemizedlist) { + print "</itemizedlist>\n"; + $in_itemizedlist = 0; + } + print "</sect2>\n\n"; + } + + print "<sect2>\n"; + print "<title>\n"; + print "$buf\n"; + print "</title>\n"; + print "<para></para>\n"; + print "\n"; + $found_chapter = $found_title = 0; + $in_sect2 = 1; + } + if ($on_table) { if ($buf =~ /<question>/) { $in_question = 1; @@ -82,12 +114,19 @@ sub scan return if $buf =~ /<\/para>/; if ($in_question) { + unless ($in_itemizedlist) { + print "<itemizedlist>\n"; + $in_itemizedlist = 1; + } + + print "<listitem>\n"; print "<para>\n"; print "<link linkend=\"$cur_id\">\n"; # print "<xref linkend=\"$cur_id\">\n"; print $buf; print "</link>\n"; print "</para>\n\n"; + print "</listitem>\n"; } } @@ -96,12 +135,21 @@ sub header { print "<sect1 id=\"recipes\">\n"; print "<title>\n"; - print "list of recipes\n"; + if ($ENV{ LANG_HINT } eq 'ja') { + print "レシピ一覧"; + } + else { + print "List of Recipes\n"; + } print "</title>\n"; } sub footer { + if ($in_sect2) { + print "</sect2>\n\n"; + } + print "</sect1>\n"; } |
