To use this package to re-generate the Greenstone tutorial HTML, or generate a workshop, you need to have the following:
Note: The en folder for English is the primary one. Any changes should be made to this folder and let the translator take care of other languages.
When generate HTML files and PDF files without using the shell scripts, you should:
If you use the shell scripts, they will create the subdirectories for you.
The file structure of the build directory is like this:
--manuals --build --language-code --html (all the generated html files go here) --pdf (all the generated pdf files go here) --images style.css
The "Librarian Interface user guide" section in the User's Guide manual is generated from the GLI Help, so when GLI Help was updated, this section needs to be regenerated to an XML file under xml-source/language directory. To regenerate the XML file,
source setup.bash
gsdl-documentation/shared
directory, run java ApplyXSLT ../manuals/processing/gen-gli-help-to-manual-chapter.xsl $GSDLHOME/gli/help/{lang}/help.xml > ../manuals/xml-source/{lang}/help-{lang}.xml
replace {lang}
with a specific language code, for example:
java ApplyXSLT ../manuals/processing/gen-gli-help-to-manual-chapter.xsl $GSDLHOME/gli/help/en/help.xml > ../manuals/xml-source/en/help-en.xml
In the XML source file of User's Guide, GLI Help is included by means of defining an ENTITY(chap_gli) in the DTD. For example:
<!DOCTYPE Manual [ <!ENTITY chap_gli SYSTEM "help-en.xml"> ]>
The generate-html.sh scripts are shell scripts that carry out a lot of these commands for you, we recommend to use this script to generate the HTML pages.
The generate-pdf.sh scripts are shell scripts that carry out a lot of these commands for you, we recommend you to use
Develop_en.xml, User_en.xml, Install_en.xml and Paper_en.xml in the en directory are the main files. Make modifications in those. The translator takes care of the other languages.
All <Text> elements need a unique id, and all need to be on their own lines, with no other tags (apart from tags inside the text).
All <Chapter>, <Section>, <Subsection>, <Part>, <Table>, <Figure> elements need a unique id.
See the DTD file for more information.
To tranlate these manuals into other languages, use Greenstone Translator to do this, see here.
The "module-name" for the manuals are devmanual, installmanual, papermanual and usermanual.
For languages whose fonts are not included in the base 14 fonts that FOP supports, eg. Russian, new font may be required to install before generating PDF files in these languages. Install a new language to FOP have 3 steps:
java -cp .:/research/lh92/greenstone/documentation/modules/shared/fop/build/fop.jar:/research/lh92/greenstone/documentation/modules/shared/fop/lib/avalon-framework.jar:/research/lh92/greenstone/documentation/modules/shared/fop/lib/xml-apis.jar:/research/lh92/greenstone/documentation/modules/shared/fop/lib/xercesImpl.jar:/research/lh92/greenstone/documentation/modules/shared/fop/lib/xalan.jar org.apache.fop.fonts.apps.TTFReader /research/lh92/packages/fonts/ae_Arab.ttf /research/lh92/greenstone/documentation/modules/shared/fop/conf/Arab.xml
font
variable, and make sure the lang
attribute in the source xml file is set properly.[Example]
For example, for the Russian language, the L_10646.TTF
(under
Windows) TrueType Font file contains the required Cyrillic font, then run
java -cp build\fop.jar;lib\avalon-framework.jar;lib\xml-apis.jar;lib\xercesImpl.jar;lib\xalan.jar org.apache.fop.fonts.apps.TTFReader [options] L_10646.TTF Cyrillic.xml
to generate the font xml configure file Cyrillic.xml
.
Then go to the conf
directory under fop installation directory,
open userconfig.xml
file, in <fonts>
element, add
<font metrics-file="//research/lh92/gsdl-documentation/shared/fop/conf/Cyrillic.xml" kerning="yes" embed-file="//research/lh92/gsdl-documentation/shared/fop/conf/L_10646.TTF">
<font-triplet name="Cyrillic" style="normal" weight="normal"/>
<font-triplet name="Cyrillic" style="normal" weight="bold"/>
<font-triplet name="Cyrillic" style="italic" weight="normal"/>
<font-triplet name="Cyrillic" style="italic" weight="bold"/>
</font>
Then run fop with -c userconfig.xml
option to use the new
configuration. Preferably, use the generate-pdf script because this already
uses the option.
Note: when you see the [Fatal Error] :1:1: Content is not allowed in prolog
exception, please check
whether the filepaths of the configuration file (xml) and the font file (.ttf) are correct.
Texts like button names should be automatic generated, like in greenstone tutorials, but currently we didn't do this because the manuals are supposed to be rewritten soon, but this shall be done after the reversion.
The XML to PDF transform require for a correct font set for a specific language.
Images should not be too long, otherwise cannot generate the PDF file.
Add navigation buttons in the html pages.