root/documentation/trunk/tutorials/generate-html.bat @ 25472

Revision 25472, 1.7 KB (checked in by ak19, 7 years ago)

1. ApplyXSLT takes an additional parameter: the Greenstone major version number, or sets this to 2 if none is provided. This is then passed onto the XSLT files. 2. generate-html.sh/bat will pass any commandline parameters on to ApplyXSLT.java. 3. Simplified the generate-html.bat file with a for loop to avoid code duplication. 4. The MajorVersion? element will now be processed by processing/common.xsl: anything in a MajorVersion? element whose number matches the Greenstone major version number specified to generate-html.sh/bat (or ApplyXSLT.java) will be output to html, if the MajorVersion? number does not match, it won't be output.

  • Property svn:keywords set to Author Date Id Revision
Line 
1@echo off
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
5if not "%GSDLHOME%" == "" goto generate
6
7echo You must run 'setup' in the top level folder of your Greenstone installation before running this script
8echo Usage: $0 [gs-major-version-number=2]
9goto exit
10
11setlocal
12
13set top_dir=%CD%
14set source_dir=%CD%\xml-source
15set processing_dir=%CD%\processing
16set output_dir=%CD%\html
17:generate:
18if not exist "%output_dir" mkdir %output_dir%
19cd ..
20cd shared
21set shared_dir=%CD%
22cd %output_dir%
23
24
25set CLASSPATH=%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar
26
27echo "processing top level index"
28
29java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-top-index.xsl"  "%source_dir%\tutorial_en.xml" %* > "%output_dir%\index.html"
30
31echo "generating wiki index page"
32java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-wiki-index.xsl" "%source_dir%\tutorial_en.xml" %* > "%output_dir%\wiki-index.txt"
33
34
35for %%G IN (en,fr,ru,es) do (
36if not exist "html\%%G" mkdir html\%%G
37
38echo "procesing %%G version"
39cd %output_dir%\%%G
40java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_%%G.xml" %* > "index.html"
41java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_%%G.xml" %* > "all_tutorials.html"
42java -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"
43cd ..
44)
45
46endlocal
47
48:exit:
49
50
Note: See TracBrowser for help on using the browser.