diff options
Diffstat (limited to 'source/help-to-html.sh')
-rwxr-xr-x | source/help-to-html.sh | 87 |
1 files changed, 70 insertions, 17 deletions
diff --git a/source/help-to-html.sh b/source/help-to-html.sh index 4dbfeeed64..f17b439c0d 100755 --- a/source/help-to-html.sh +++ b/source/help-to-html.sh @@ -6,22 +6,75 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -outdir=html/ -filter=online_transform.xsl -rm -rf $outdir -mkdir $outdir -cp default.css help.js jquery-3.1.1.min.js $outdir -cp -rap media $outdir'media' -./get_bookmark.sh $outdir -for filep in `find text/ -name *.xhp` +# +#Languages are merged in XHP files in +# workdir/HelpTranslatePartTarget/ +# + +# +# location of the script is in core/helpcontent2/source/ = sourceDir +# +sourceDir=`pwd` +# +# Location of the merged l10n help files from sourceDir +# +langDirSource=../../workdir/HelpTranslatePartTarget/ + +# Uggly hack: copy en-US from sourcedir to HelpTranslatePartTarget... +rm -rf $langDirSource/en-US +mkdir -p $langDirSource/en-US/helpcontent2/source +cp -r $sourceDir/text/ $langDirSource/en-US/helpcontent2/source/ + + +# +# Location of the resulting html +# +outDir=$sourceDir/html/ + +filter=$sourceDir/online_transform.xsl + +#clean and recreate the resulting html +rm -rf $outDir +mkdir $outDir + +#copy some service files +cp default.css help.js jquery-3.1.1.min.js $outDir +cp -rap media $outDir + +# Change to the merged l10 root folder +cd $langDirSource + +# get absolute path of merged l10n files +langDirSource=`pwd` + +# iterate existing languages +for lang in `ls $langDirSource` do -DIR=${filep%/*} -FILEN=${filep##*/} -name=${FILEN:0:-3} -outfile=$outdir$DIR/$name'html' -xsltproc -o $outfile $filter $filep -done -ln -s text/shared/main0108.html $outdir'index.html' -mkdir $outdir'media/icon-theme' -# cp -rap ../../../../../icon-themes/galaxy/* $outdir/media/icon-theme/ + echo $lang + cd $langDirSource/$lang/helpcontent2/source + ln -sf $filter . + ln -sf $sourceDir/get_bookmark.sh . + mkdir -p $outDir/$lang + ./get_bookmark.sh $outDir $lang + xsltparm='--stringparam Language '$lang + + # iterate all xhp files + for filep in `find text/ -name *.xhp` + do + DIR=${filep##*text/} + name=${DIR:0:-3} + outFile=$outDir$lang'/text/'$name'html' + xsltproc $xsltparm -o $outFile online_transform.xsl $filep + done + # some service links + ln -s text/shared/main0108.html $outDir/$lang/index.html + ln -s ../media $outDir/$lang/media + # back to l10n root folder + cd $langDirSource + +done +# Should copy core/icon-themes/galaxy/ to the media folder as icon-theme/ + #mkdir $outDir'media/icon-theme' + # cp -rap ../../../../../icon-themes/galaxy/* $outDir/media/icon-theme/ +exit |