Changeset 25472
- Timestamp:
- 2012-04-24T20:30:19+12:00 (12 years ago)
- Location:
- documentation/trunk/tutorials
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/trunk/tutorials/generate-html.bat
r20953 r25472 1 1 @echo off 2 2 3 :: Usage: generate-html.bat [<gs-major-version-number] 4 :: The optional parameter major version number, which can be 2 or 3, will be assumed to be (Greenstone) "2" if none is provided 3 5 if not "%GSDLHOME%" == "" goto generate 4 6 5 7 echo You must run 'setup' in the top level folder of your Greenstone installation before running this script 8 echo Usage: $0 [gs-major-version-number=2] 6 9 goto exit 7 10 8 :generate: 9 mkdir html 10 cd html 11 :generate: 12 mkdir en 13 mkdir fr 14 mkdir ru 15 mkdir es 16 cd .. 11 setlocal 17 12 18 13 set top_dir=%CD% … … 20 15 set processing_dir=%CD%\processing 21 16 set output_dir=%CD%\html 17 :generate: 18 if not exist "%output_dir" mkdir %output_dir% 22 19 cd .. 23 20 cd shared … … 25 22 cd %output_dir% 26 23 24 25 set CLASSPATH=%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar 26 27 27 echo "processing top level index" 28 28 29 java -cp "% shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "" "%processing_dir%\xml-to-top-index.xsl" "%source_dir%\tutorial_en.xml"> "%output_dir%\index.html"29 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-top-index.xsl" "%source_dir%\tutorial_en.xml" %* > "%output_dir%\index.html" 30 30 31 31 echo "generating wiki index page" 32 java -cp "% shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "" "%processing_dir%\xml-to-wiki-index.xsl" "%source_dir%\tutorial_en.xml"> "%output_dir%\wiki-index.txt"32 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-wiki-index.xsl" "%source_dir%\tutorial_en.xml" %* > "%output_dir%\wiki-index.txt" 33 33 34 echo "procesing english version"35 34 36 cd %output_dir%\en 37 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT en "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_en.xml" > "index.html" 38 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT en "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_en.xml" > "all_tutorials.html" 39 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT en "%processing_dir%\xml-to-many-html.xsl" "%source_dir%\tutorial_en.xml" | perl -S "%GSDLHOME%\gli\help\splithelpdocument.pl" 35 for %%G IN (en,fr,ru,es) do ( 36 if not exist "html\%%G" mkdir html\%%G 37 38 echo "procesing %%G version" 39 cd %output_dir%\%%G 40 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_%%G.xml" %* > "index.html" 41 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_%%G.xml" %* > "all_tutorials.html" 42 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-many-html.xsl" "%source_dir%\tutorial_%%G.xml" %* | perl -S "%GSDLHOME%\gli\help\splithelpdocument.pl" 40 43 cd .. 44 ) 41 45 42 echo "procesing french version" 43 cd %output_dir%\fr 44 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT fr "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_fr.xml" > index.html 45 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT fr "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_fr.xml" > all_tutorials.html 46 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT fr "%processing_dir%\xml-to-many-html.xsl" "%source_dir%\tutorial_fr.xml" | perl -S "%GSDLHOME%\gli\help\splithelpdocument.pl" 47 cd .. 48 49 echo "procesing spanish version" 50 cd %output_dir%\es 51 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT es "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_es.xml" > index.html 52 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT es "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_es.xml" > all_tutorials.html 53 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT es "%processing_dir%\xml-to-many-html.xsl" "%source_dir%\tutorial_es.xml" | perl -S "%GSDLHOME%\gli\help\splithelpdocument.pl" 54 cd .. 55 56 echo "procesing russian version" 57 cd %output_dir%\ru 58 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT ru "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_ru.xml" > index.html 59 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT ru "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_ru.xml" > all_tutorials.html 60 java -cp "%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar" -DGSDLHOME="%GSDLHOME%" ApplyXSLT ru "%processing_dir%\xml-to-many-html.xsl" "%source_dir%\tutorial_ru.xml" | perl -S "%GSDLHOME%\gli\help\splithelpdocument.pl" 61 62 cd .. 46 endlocal 63 47 64 48 :exit: -
documentation/trunk/tutorials/generate-html.sh
r24145 r25472 1 1 #!/bin/bash 2 2 3 # Usage: ./generate-html.sh [<gs-major-version-number] 4 # The optional parameter major version number, which can be 2 or 3, will be assumed to be (Greenstone) "2" if none is provided 3 5 if [ "$GSDLHOME" == "" ]; then 4 6 echo "You must run 'source setup.bash' in the top level folder of your Greenstone installation before running this script" 7 echo "Usage: $0 [gs-major-version-number=2]" 5 8 exit 6 9 fi 10 11 #ApplyXSLT.java will take care of setting the default of the major Greenstone version if none is provided 12 #if [ "$1" != "" ]; then 13 # $major_version="2" 14 #fi 7 15 8 16 top_dir=`pwd` … … 14 22 export CLASSPATH=$shared_dir:$GSDLHOME/gli:$GSDLHOME/gli/classes:$GSDLHOME/perllib:$shared_dir/xalan.jar 15 23 16 mkdir $output_dir 24 if [ ! -d $output_dir ]; then 25 mkdir $output_dir 26 fi 17 27 18 28 langs="en fr es ru" 19 29 30 # http://tadek.pietraszek.org/blog/2006/01/05/messing-up-with-command-line-arguments-in-bash/ 31 # is on the difference between $@ and $* and when to add quotes around them 32 20 33 echo "processing top level index" 21 java -DGSDLHOME=$GSDLHOME ApplyXSLT en $processing_dir/xml-to-top-index.xsl $source_dir/tutorial_en.xml> $output_dir/index.html34 java -DGSDLHOME=$GSDLHOME ApplyXSLT "en" $processing_dir/xml-to-top-index.xsl $source_dir/tutorial_en.xml "$@" > $output_dir/index.html 22 35 23 36 echo "generating wiki index page" 24 java -DGSDLHOME=$GSDLHOME ApplyXSLT en $processing_dir/xml-to-wiki-index.xsl $source_dir/tutorial_en.xml> $output_dir/wiki-index.txt37 java -DGSDLHOME=$GSDLHOME ApplyXSLT "en" $processing_dir/xml-to-wiki-index.xsl $source_dir/tutorial_en.xml "$@" > $output_dir/wiki-index.txt 25 38 26 39 for l in $langs; do 27 40 echo "Processing $l version" 28 mkdir $output_dir/$l 41 if [ ! -d $output_dir/$l ]; then 42 mkdir $output_dir/$l 43 fi 29 44 cd $output_dir/$l 30 java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-index.xsl $source_dir/tutorial_$l.xml > index.html31 java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-one-html.xsl $source_dir/tutorial_$l.xml > all_tutorials.html32 java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-many-html.xsl $source_dir/tutorial_$l.xml | perl -S $GSDLHOME/gli/help/splithelpdocument.pl45 java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-index.xsl $source_dir/tutorial_$l.xml "$@" > index.html 46 java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-one-html.xsl $source_dir/tutorial_$l.xml "$@" > all_tutorials.html 47 java -DGSDLHOME=$GSDLHOME ApplyXSLT $l $processing_dir/xml-to-many-html.xsl $source_dir/tutorial_$l.xml "$@" | perl -S $GSDLHOME/gli/help/splithelpdocument.pl 33 48 cd $top_dir 34 49 done -
documentation/trunk/tutorials/processing/common.xsl
r13638 r25472 5 5 exclude-result-prefixes="dict"> 6 6 7 <!--The following strips newlines introduced by elements, in particular introduced around the MajorVersion template match 8 See http://stackoverflow.com/questions/3265244/removing-blank-lines-in-xslt 9 and http://msdn.microsoft.com/en-us/library/ms256107.aspx --> 10 <xsl:strip-space elements="*"/> 11 7 12 <xsl:variable name="diction" select="dict:new('en')"/> 8 13 … … 160 165 </xsl:template> 161 166 167 <!-- Do not process any elements marked with MajorVersion and whose version does not 168 specifically match the requested greenstone major version (2 or 3) --> 169 <!--To avoid multiple lines of whitespace around output, use 170 <xsl:for-each select="node()"><xsl:apply-templates/></xsl:for-each> 171 This outputs the contents on its own separate line. 172 To avoid thinking about unnecessary newlines and to avoid omitting any sub-xml items 173 that need to be processed, we can instead have the following at the top of the file: 174 <xsl:strip-space elements="*"/> --> 175 <xsl:template match="MajorVersion"> 176 <xsl:if test="$gs-major-version=@number"> 177 <xsl:apply-templates/> 178 </xsl:if> 179 </xsl:template> 180 162 181 <xsl:template name="SampleFiles"> 163 182 <xsl:param name="mode">web</xsl:param> -
documentation/trunk/tutorials/processing/xml-to-index.xsl
r17494 r25472 4 4 5 5 <xsl:output method="html"/> 6 <xsl:param name="gs-major-version"/> 6 7 <xsl:include href="common.xsl"/> 7 8 -
documentation/trunk/tutorials/processing/xml-to-many-html.xsl
r17494 r25472 3 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 4 4 5 <xsl:param name="gs-major-version"/> 5 6 <xsl:include href="common.xsl"/> 6 7 -
documentation/trunk/tutorials/processing/xml-to-one-html.xsl
r17494 r25472 3 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 4 4 5 <xsl:param name="gs-major-version"/> 5 6 <xsl:include href="common.xsl"/> 6 7 <xsl:output method="html"/> -
documentation/trunk/tutorials/processing/xml-to-one-workshop.xsl
r17494 r25472 4 4 xmlns:xalan="http://xml.apache.org/xalan"> 5 5 6 <xsl:param name="gs-major-version"/> 6 7 <xsl:include href="common.xsl"/> 7 8 -
documentation/trunk/tutorials/processing/xml-to-top-index.xsl
r13638 r25472 3 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 4 4 5 <xsl:param name="gs-major-version"/> 5 6 <xsl:include href="common.xsl"/> 6 7 -
documentation/trunk/tutorials/processing/xml-to-wiki-index.xsl
r13638 r25472 3 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 4 4 5 <xsl:param name="gs-major-version"/> 5 6 <xsl:include href="common.xsl"/> 6 7 -
documentation/trunk/tutorials/processing/xml-to-workshop.xsl
r13638 r25472 4 4 xmlns:xalan="http://xml.apache.org/xalan"> 5 5 6 <xsl:param name="gs-major-version"/> 6 7 <xsl:include href="common.xsl"/> 7 8
Note:
See TracChangeset
for help on using the changeset viewer.