[Scummvm-cvs-logs] SF.net SVN: scummvm:[40819] scummvm/trunk/tools/credits.pl

sev at users.sourceforge.net sev at users.sourceforge.net
Sat May 23 22:21:17 CEST 2009


Revision: 40819
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40819&view=rev
Author:   sev
Date:     2009-05-23 20:21:17 +0000 (Sat, 23 May 2009)

Log Message:
-----------
Adjust credits.pl for new website code.

Modified Paths:
--------------
    scummvm/trunk/tools/credits.pl

Modified: scummvm/trunk/tools/credits.pl
===================================================================
--- scummvm/trunk/tools/credits.pl	2009-05-23 19:59:42 UTC (rev 40818)
+++ scummvm/trunk/tools/credits.pl	2009-05-23 20:21:17 UTC (rev 40819)
@@ -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 @@
 
 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 @@
 	} 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 @@
 		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 @@
 		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 @@
 		  $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 @@
 		# 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 @@
 		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 @@
 			$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 @@
 		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";
 	}
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list