source: documentation/trunk/tutorials/generate-html.bat@ 25472

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