diff options
author | Eugene Sandulenko | 2009-05-23 20:21:17 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-05-23 20:21:17 +0000 |
commit | 434af6e42dfe0eacd7e048f9896bf91a7e2a29cc (patch) | |
tree | 267ec3b6de9d8d680647830e009777b31432c662 | |
parent | 8dd601d35e26c7a50ee8cabf3ec69ba72e268d20 (diff) | |
download | scummvm-rg350-434af6e42dfe0eacd7e048f9896bf91a7e2a29cc.tar.gz scummvm-rg350-434af6e42dfe0eacd7e048f9896bf91a7e2a29cc.tar.bz2 scummvm-rg350-434af6e42dfe0eacd7e048f9896bf91a7e2a29cc.zip |
Adjust credits.pl for new website code.
svn-id: r40819
-rwxr-xr-x | tools/credits.pl | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/tools/credits.pl b/tools/credits.pl index bee960ccaf..949f8ef1fa 100755 --- a/tools/credits.pl +++ b/tools/credits.pl @@ -6,7 +6,7 @@ # - The AUTHORS file # - The gui/credits.h header file # - The credits.xml file, part of the DocBook manual -# - Finally, credits.inc, from the website +# - Finally, credits.xml, for use on the website (different format than the DocBook one) # And maybe in the future, also "doc/10.tex", the LaTeX version of the README. # Although that might soon be obsolete, if the manual evolves enough. # @@ -33,16 +33,16 @@ my @section_count = ( 0, 0, 0 ); if ($#ARGV >= 0) { $mode = "TEXT" if ($ARGV[0] eq "--text"); # AUTHORS file - $mode = "HTML" if ($ARGV[0] eq "--html"); # credits.inc (for use on the website) + $mode = "XML-WEB" if ($ARGV[0] eq "--xml-website"); # credits.xml (for use on the website) $mode = "CPP" if ($ARGV[0] eq "--cpp"); # credits.h (for use by about.cpp) - $mode = "XML" if ($ARGV[0] eq "--xml"); # credits.xml (DocBook) + $mode = "XML-DOC" if ($ARGV[0] eq "--xml-docbook"); # credits.xml (DocBook) $mode = "RTF" if ($ARGV[0] eq "--rtf"); # Credits.rtf (Mac OS X About box) $mode = "TEX" if ($ARGV[0] eq "--tex"); # 10.tex (LaTeX) } if ($mode eq "") { - print STDERR "Usage: $0 [--text | --html | --cpp | --xml | --rtf]\n"; - print STDERR " Just pass --text / --html / --cpp / --xml / --rtf as parameter, and credits.pl\n"; + print STDERR "Usage: $0 [--text | --xml-website | --cpp | --xml-docbook | --rtf]\n"; + print STDERR " Just pass --text / --xml-website / --cpp / --xml-docbook / --rtf as parameter, and credits.pl\n"; print STDERR " will print out the corresponding version of the credits to stdout.\n"; exit 1; } @@ -178,7 +178,7 @@ sub begin_credits { } elsif ($mode eq "CPP") { print "// This file was generated by credits.pl. Do not edit by hand!\n"; print "static const char *credits[] = {\n"; - } elsif ($mode eq "XML") { + } elsif ($mode eq "XML-DOC") { print "<?xml version='1.0'?>\n"; print "<!-- This file was generated by credits.pl. Do not edit by hand! -->\n"; print "<!DOCTYPE appendix PUBLIC '-//OASIS//DTD DocBook XML V4.2//EN'\n"; @@ -191,8 +191,10 @@ sub begin_credits { print " <colspec colname='name' colwidth='4cm'/>\n"; print " <colspec colname='job'/>\n"; print " <tbody>\n"; - } elsif ($mode eq "HTML") { + } elsif ($mode eq "XML-WEB") { + print "<?xml version='1.0'?>\n"; print "<!-- This file was generated by credits.pl. Do not edit by hand! -->\n"; + print "<credits>\n"; } } @@ -205,13 +207,13 @@ sub end_credits { print "}\n"; } elsif ($mode eq "CPP") { print "};\n"; - } elsif ($mode eq "XML") { + } elsif ($mode eq "XML-DOC") { print " </tbody>\n"; print " </tgroup>\n"; print " </informaltable>\n"; print "</appendix>\n"; - } elsif ($mode eq "HTML") { - print "\n"; + } elsif ($mode eq "XML-WEB") { + print "</credits>\n"; } } @@ -270,25 +272,26 @@ sub begin_section { $title = html_entities_to_cpp($title); print '"C1""'.$title.'",' . "\n"; } - } elsif ($mode eq "XML") { + } elsif ($mode eq "XML-DOC") { print " <row><entry namest='start' nameend='job'>"; print "<emphasis role='bold'>" . $title . ":</emphasis>"; print "</entry></row>\n"; - } elsif ($mode eq "HTML") { + } elsif ($mode eq "XML-WEB") { if ($section_level eq 0) { - print "<div class='par-item'><div class='par-head'>$title</div><div class='par-content'> \n"; + print "\t<section>\n"; + print "\t\t<title>" . $title . "</title>\n"; } elsif ($section_level eq 1) { - print "<div class='par-subhead'>$title</div>\n"; - print "<div class='par-subhead-dots'> </div>\n"; - print "<div class='par-subhead-content'>\n" + print "\t\t<subsection>\n"; + print "\t\t\t<title>" . $title . "</title>\n"; } else { - print "<span style='font-weight: bold'>$title:</span>\n"; + #print "\t\t\t<group>" . $title . "</group>\n"; + #print "\t\t\t\t<name>" . $title . "</name>\n"; } } # Implicit start of person list on section level 2 if ($section_level >= 2) { - begin_persons(); + begin_persons($title); } @section_count[$section_level]++; $section_level++; @@ -311,20 +314,25 @@ sub end_section { # nothing } elsif ($mode eq "CPP") { print '"",' . "\n"; - } elsif ($mode eq "XML") { + } elsif ($mode eq "XML-DOC") { print " <row><entry namest='start' nameend='job'> </entry></row>\n\n"; - } elsif ($mode eq "HTML") { + } elsif ($mode eq "XML-WEB") { if ($section_level eq 0) { - print "</div></div>\n"; + print "\t</section>\n"; } elsif ($section_level eq 1) { - print "</div>\n"; + print "\t\t</subsection>\n"; + } else { + #print "\t\t\t</group>\n"; } } } sub begin_persons { - if ($mode eq "HTML") { - print "<table style='margin-left:2em; margin-bottom: 1em'>\n"; + my $title = shift; + if ($mode eq "XML-WEB") { + print "\t\t\t<group>\n"; + print "\t\t\t\t<name>" . $title . "</name>\n"; + #print "\t\t\t\t<persons>\n"; } elsif ($mode eq "TEX") { print '\item \begin{tabular}[h]{p{0.3\linewidth}p{0.6\linewidth}}' . "\n"; } @@ -337,8 +345,9 @@ sub end_persons { print ' \end{tabular}' . "\n"; } elsif ($mode eq "RTF") { # nothing - } elsif ($mode eq "HTML") { - print "</table>\n"; + } elsif ($mode eq "XML-WEB") { + #print "\t\t\t\t</persons>\n"; + print "\t\t\t</group>\n"; } } @@ -396,23 +405,18 @@ sub add_person { $desc = html_entities_to_cpp($desc); print '"C2""'.$desc.'",' . "\n"; } - } elsif ($mode eq "XML") { + } elsif ($mode eq "XML-DOC") { $name = $nick if $name eq ""; print " <row><entry namest='name'>" . $name . "</entry>"; print "<entry>" . $desc . "</entry></row>\n"; - } elsif ($mode eq "HTML") { + } elsif ($mode eq "XML-WEB") { $name = "???" if $name eq ""; - print "<tr>"; - print "<td style='width:13em; padding:2px;'>".$name."</td>"; - if ($nick ne "") { - print "<td style='width:10em; text-align: left;' class='news-author'>".$nick."</td>"; - } else { - print "<td></td>"; - } - print "<td>".$desc."</td>\n"; + print "\t\t\t\t<person>\n"; + print "\t\t\t\t\t<name>" . $name . "</name>\n"; + print "\t\t\t\t\t<alias>" . $nick . "</alias>\n"; + print "\t\t\t\t\t<description>" . $desc . "</description>\n"; + print "\t\t\t\t</person>\n"; } - - } sub add_paragraph { @@ -437,13 +441,11 @@ sub add_paragraph { my $line_end = '",'; print $line_start . $text . $line_end . "\n"; print $line_start . $line_end . "\n"; - } elsif ($mode eq "XML") { + } elsif ($mode eq "XML-DOC") { print " <row><entry namest='start' nameend='job'>" . $text . "</entry></row>\n"; print " <row><entry namest='start' nameend='job'> </entry></row>\n\n"; - } elsif ($mode eq "HTML") { - print "<p style='margin-left:2em; margin-bottom: 1em'>"; - print $text; - print "</p>\n"; + } elsif ($mode eq "XML-WEB") { + print "\t\t<paragraph>" . $text . "</paragraph>\n"; } } |