[gcompris] improved web site generation, now the screenshots are sorted by level.
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris] improved web site generation, now the screenshots are sorted by level.
- Date: Sun, 25 Mar 2012 17:24:05 +0000 (UTC)
commit f72ce1ed42f0635def1d142a86d7febdc806bec1
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Sun Mar 25 17:09:45 2012 +0200
improved web site generation, now the screenshots are sorted by level.
docs/checkScreenshots.sh | 2 +-
docs/create_boards_menu.sh | 7 +++++--
docs/gcompris2spip.pl | 19 ++++++++++++++++---
docs/spip_menuboard.xsl | 7 +++----
docs/spip_oneboard.xsl | 3 +--
5 files changed, 26 insertions(+), 12 deletions(-)
---
diff --git a/docs/checkScreenshots.sh b/docs/checkScreenshots.sh
index 6db1cdc..e9196c6 100755
--- a/docs/checkScreenshots.sh
+++ b/docs/checkScreenshots.sh
@@ -1,4 +1,4 @@
#!/bin/sh
# Once gcompris2spip is run, run this one to check no screenshots
# are missing
-grep screenshots/ all_article.spip | cut -d= -f5 | cut -d \" -f2 | cut -d "&" -f1 |sort -u | xargs ls
+grep screenshots/ all_article.spip | grep -v _small | cut -d= -f5 | cut -d \" -f2 | cut -d "&" -f1 |sort -u | xargs ls
diff --git a/docs/create_boards_menu.sh b/docs/create_boards_menu.sh
index c4988fb..1bb56f4 100755
--- a/docs/create_boards_menu.sh
+++ b/docs/create_boards_menu.sh
@@ -11,6 +11,9 @@ do
/usr/bin/intltool-merge -x -u -c ../po/.intltool-merge-cache ../po $m boards/$menu
done
-rm boards/pythontemplate.xml
-rm boards/pythontest.xml
+for f in $(grep -l 'section="/experimental"' boards/*)
+do
+ echo removing experimental $f
+ rm -f $f
+done
rm boards/tuxpaint.xml
diff --git a/docs/gcompris2spip.pl b/docs/gcompris2spip.pl
index 0272de3..fdf4e39 100755
--- a/docs/gcompris2spip.pl
+++ b/docs/gcompris2spip.pl
@@ -101,6 +101,7 @@ my %sections = (
'sr latin', 0,
"sv", 208,
"ta", 154,
+ "te", 0,
"th", 0,
"tr", 157,
"uk", 161,
@@ -173,6 +174,7 @@ my %rubriques = (
'sr latin', 0,
"sv", 213,
"ta", 155,
+ "te", 0,
"th", 0,
"tr", 158,
"uk", 164,
@@ -246,6 +248,7 @@ my %rubriques_all = (
'sr latin', 0,
"sv", 220,
"ta", 156,
+ "te", 0,
"th", 0,
"tr", 159,
"uk", 165,
@@ -294,6 +297,7 @@ my $date = "".($year+1900)."-".($month+1)."-"."$day $hours:$min:$sec";
my $gcompris_root_dir = "..";
my $boards_dir = "$gcompris_root_dir/docs/boards";
my $ALL_LINGUAS_STR = `grep "ALL_LINGUAS=" $gcompris_root_dir/configure.ac | sed s/en_[A-Z][A-Z]//g | cut -d= -f2`;
+#my $ALL_LINGUAS_STR = "";
$ALL_LINGUAS_STR =~ s/\"//g;
my @ALL_LINGUAS = split(' ', $ALL_LINGUAS_STR);
push @ALL_LINGUAS, "en"; # Add english, it's not in the po list
@@ -327,9 +331,18 @@ my $article_id = $first_article;
# First, Get all the boards description files
-opendir DIR, $boards_dir or die "cannot open dir $boards_dir: $!";
-my @files = grep { $_ =~ /\.xml$/} readdir DIR;
-closedir DIR;
+my $boards_dir = "boards";
+my @files;
+
+# We get first the menu
+push @files, split(/ /, `grep -l 'type="menu"' $boards_dir/*.xml | sed s:boards/:: | xargs`);
+chomp($files[$#files]);
+
+# Then the difficulty 1 to 6
+for my $level (1..6) {
+ push @files, split(/ /, `grep -l 'difficulty="$level"' $boards_dir/*.xml | sed s:boards/:: | xargs`);
+ chomp($files[$#files]);
+}
#-------------------------------------------------------------------------------
# Menu creation
diff --git a/docs/spip_menuboard.xsl b/docs/spip_menuboard.xsl
index bf30854..572297a 100644
--- a/docs/spip_menuboard.xsl
+++ b/docs/spip_menuboard.xsl
@@ -10,7 +10,7 @@
standalone="no"
cdata-section-elements="namelist"
indent="yes"/>
-
+
<xsl:template match="/">
@@ -61,7 +61,7 @@
<HTML>
<DIV class="conteneur">
-
+
<xsl:for-each select="GComprisBoards/GCompris/Board[ section=$section and @type!='menu']">
<!-- order the result by difficulty -->
<xsl:sort select="@difficulty"
@@ -75,8 +75,7 @@
</xsl:attribute>
<IMG border="0" align="top" alt="">
<xsl:attribute name="src">
- <xsl:value-of select="concat('screenshots/',@name)"/>_small.jpg
- </xsl:attribute>
+ <xsl:value-of select="concat('screenshots/',@name)"/>_small.jpg</xsl:attribute>
<xsl:attribute name="title">
<xsl:variable name="tmptext" select="title[ xml:lang=$language]"/>
<xsl:if test="not($tmptext)">
diff --git a/docs/spip_oneboard.xsl b/docs/spip_oneboard.xsl
index 650e3cc..94f3c59 100644
--- a/docs/spip_oneboard.xsl
+++ b/docs/spip_oneboard.xsl
@@ -48,11 +48,10 @@
</surtitre>
<titre>__REMOVEME__
- <xsl:variable name="tmptext" select="title[ xml:lang=$language]"/>
+ <xsl:value-of select="$article_id"/>. <xsl:variable name="tmptext" select="title[ xml:lang=$language]"/>
<xsl:if test="not($tmptext)">
<xsl:value-of select="title"/>
</xsl:if>
- <xsl:value-of select="$tmptext"/>
</titre>
<descriptif>__REMOVEME__
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]