diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-08-09 12:22:27 -0300 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-08-09 19:38:59 +0200 |
commit | bf35ef6d44af2999ccb64691ded0faf082946529 (patch) | |
tree | 1d06e7690fc5f1a053870cf2e0a3475b6c92547f | |
parent | 8af986212f7c9e1df236ebc0659d08a54cf6b40b (diff) |
New Help housekeeping
remove deprecated files (gbuild has replaced them)
Change-Id: I00a0a1558dfa80486dd64df37273c90bc6262fb0
Reviewed-on: https://gerrit.libreoffice.org/58784
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/58794
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
-rwxr-xr-x | help3xsl/convert2html.sh | 293 | ||||
-rwxr-xr-x | help3xsl/get_bookmark.sh | 79 | ||||
-rwxr-xr-x | help3xsl/get_hid2file.sh | 39 | ||||
-rwxr-xr-x | help3xsl/get_html.sh | 49 | ||||
-rwxr-xr-x | help3xsl/get_media.sh | 43 | ||||
-rwxr-xr-x | help3xsl/get_tree.sh | 93 | ||||
-rwxr-xr-x | help3xsl/makehelp.sh | 47 | ||||
-rwxr-xr-x | help3xsl/xhp2html.sh | 282 |
8 files changed, 0 insertions, 925 deletions
diff --git a/help3xsl/convert2html.sh b/help3xsl/convert2html.sh deleted file mode 100755 index 8a558691ee..0000000000 --- a/help3xsl/convert2html.sh +++ /dev/null @@ -1,293 +0,0 @@ -#/bin/bash -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. -# -# Convert localized XHP files and TREE files to HTML. -# -# Syntax: convert2html tarball productversion source -# -# Example -# ./convert2html.sh buildtargets_5403.tar.gz 5.4 libreoffice-help-5.4.0.3.tar.xz -# -# This script convert localized XHP and TREE files available as tarballs into -# a set of html pages. -# -# Conversion is done by listing the available languages in the tarball and -# execting the XSLT transformations on each XHP and tree files. -# -# Note: tarball, source and productversion must match. -# -# Special case for converting en-US XHP files to HTML. The en-US source is -# taken from the published helpcontent2 source tarball. -# -# companion files are moved to the right position in the html folder -# Media files are added too. -# - -function getBookmark() { -########################################### -# Extract <bookmarks_value> from each XHP file and build a <ul> list -# in a javascript file -# -# Function called by main routine -# -# $1 is Language -# $2 is productversion -# $3 is the tarname folder -########################################### - -local outdir=$(pwd)'/html/'$2'/'$1 - -local sourcedir=$3/HelpTranslatePartTarget/$1/helpcontent2/source -local ffile=$outdir/bookmarks.js -rm -f $ffile -local ffile2=$(mktemp) -local stub2=\' -local xslfile=get_bookmark.xsl - -local param1=' --stringparam Language '$1' --stringparam productversion '$2 - -########################################### -# bookmarks for modules -########################################### -for i in CALC CHART WRITER DRAW IMPRESS MATH BASIC -do -local stub1='document.getElementById("bookmark'$i'").innerHTML='\'\\ -sfind=$sourcedir'/'$(echo 'text/s'$i | tr '[:upper:]' '[:lower:]') -param=$param1' --stringparam app '$i -rm -f $ffile2 -find $sfind -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $ffile2 -echo $stub1 >> $ffile -sort -k3b -t\> -s -o $ffile2 $ffile2 -awk 'NF' $ffile2 >> $ffile -echo $stub2 >> $ffile -done - -########################################### -# Case of SHARED -########################################### -stub1='document.getElementById("bookmarkSHARED").innerHTML='\'\\ -rm -f $ffile2 -param=$param1' --stringparam app SHARED' -find $sourcedir'/text/shared' -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $ffile2 -echo $stub1 >> $ffile -sort -k3b -t\> -s -o $ffile2 $ffile2 -awk 'NF' $ffile2 >> $ffile -echo $stub2 >> $ffile - -########################################### -# Case of Explorer (BASE) -########################################### -stub1='document.getElementById("bookmarkBASE").innerHTML='\'\\ -rm -f $ffile2 -param=$param1' --stringparam app BASE' -find $sourcedir'/text/shared/explorer/database' -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $ffile2 -echo $stub1 >> $ffile -sort -k3b -t\> -s -o $ffile2 $ffile2 -awk 'NF' $ffile2 >> $ffile -echo $stub2 >> $ffile -rm -f $ffile2 -} - -########################################### -# Main routine -########################################### - -tarname=$1 -productversion=$2 -source=$3 - -sourceDir=$(pwd) - -########################################### -# Un-tar localized XHP and TREE files -########################################### -#tarname=${tarball:0:17} -rm -rf $tarname -#tar -zxf $tarball -cp -r /var/tmp/$tarname . -########################################### -# Un-tar source en-US XHP and TREE files -########################################### - -sourceName=$(tar -tf $source | head -1 | cut -f1 -d"/") -rm -rf $sourceName -tar -xf $source - -########################################### -# Location of the merged l10n help files from sourceDir -########################################### -langDirSource=$tarname/HelpTranslatePartTarget/ -enSource=$sourceName/helpcontent2 - -########################################### -# -# Hack: copy en-US from source help tarball to HelpTranslatePartTarget and HelpTreeTarget -# -########################################### -rm -rf $langDirSource/en-US -mkdir -p $langDirSource/en-US/helpcontent2 -cp -r $enSource/* $langDirSource/en-US/helpcontent2 - -########################################### -# -# Process the en-US tree files -# -########################################### -ALL_TREE='sbasic scalc schart shared simpress smath swriter' -for i in $ALL_TREE -do -cp -r $sourceDir'/'$enSource'/source/auxiliary/'$i.tree $tarname/HelpTreeTarget/$i'/en-US.tree' -done -########################################### -# -# Location of the resulting html -# -########################################### -outDir=$sourceDir/html/$productversion/ - -filter=$sourceDir/online_transform.xsl - -########################################### -# -# clean and recreate the target html folder -# -########################################### - -rm -rf $sourceDir/html -mkdir -p $sourceDir/html/$productversion - -########################################### -# -# Create the bookmark2file.js map. -# -# This file contains a map that convert bookmarks from LibreOffice apps into -# an URL of the corresponding page. -# The URL arriving is converted inside index.html and redirected -# -########################################### -stub1='var map={' -stub2='};' -sfind=$langDirSource'en-US/helpcontent2/source/text/' -ffile=$outDir/bookmark2file.js -ffile2=$(mktemp) -rm -f $ffile2 $ffile -find $sfind -type f -name "*.xhp" -exec xsltproc get_url.xsl {} + > $ffile2 -echo $stub1 >> $ffile -awk 'NF' $ffile2 >> $ffile -echo $stub2 >> $ffile -rm -f $ffile2 - -for lang in $(ls $langDirSource) -#for lang in pt-BR fr -do - echo 'Processing language '$lang - mkdir -p $outDir/$lang - getBookmark $lang $productversion $tarname & - - pPath=$langDirSource$lang'/helpcontent2/source' - xsltparm='--stringparam Language '$lang' --stringparam local no --stringparam productversion '$productversion' --stringparam root '$pPath'/' - - # iterate all xhp files - - for filep in $(find $pPath -name *.xhp) - do -# echo $filep - DIR=${filep##*/source} - name=${DIR:0:-3} - outFile=$outDir$lang$name'html' - xsltproc $xsltparm -o $outFile online_transform.xsl $filep - done - -########################################### -# -# Process tree files -# -########################################### - -treeFileHTML=html/$productversion/$lang/contents.js - -touch $treeFileHTML -echo 'document.getElementById("Contents").innerHTML='$'\047''\'>$treeFileHTML - -xsltparm='--stringparam lang '$lang' --stringparam productversion '$productversion -for tree in $ALL_TREE -do -treeSourceFile=$tarname/HelpTreeTarget/$tree/$lang.tree -treeTemp2=$(mktemp) - -xsltproc $xsltparm -o $treeTemp2 get_tree.xsl $treeSourceFile - -awk 'NF' $treeTemp2>>$treeFileHTML - -rm -f $treeTemp2 -done - -echo $'\047'';'>>$treeFileHTML -echo 'Conversion to HTML finished for '$lang -done -########################################### -# Process sitemap index for productversion -########################################### -url='https://help.libreoffice.org' - -ALL_LANGS=$(ls $outDir | sed 's/media//') -ALL_LANGS=$(echo $ALL_LANGS | sed 's/bookmark2file.js//') -echo $ALL_LANGS -sitemap=$outDir/sitemap.xml - -rm -f $sitemap -touch $sitemap - -echo '<?xml version="1.0" encoding="UTF-8"?>' > $sitemap -echo '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'>>$sitemap - -for lang1 in $ALL_LANGS -do -echo '<sitemap>' >>$sitemap -echo '<loc>'$url'/'$productversion'/sitemap-'$lang1'.xml</loc>' >>$sitemap -echo '<lastmod>'$(date -I)'</lastmod>'>>$sitemap -echo '</sitemap>'>>$sitemap - -########################################### -# -# Process sitemap for productversion-lang -# -########################################### -f=$outDir'/sitemap-'$lang1'.xml' - -rm -f $f -touch $f - -echo '<?xml version="1.0" encoding="UTF-8"?>' > $f -echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' >> $f - - -dd=./html/$productversion/$lang1 - -for ff in $(find $dd -name "*.html") -do -echo '<url><loc>'$url'/'${ff:7}'</loc></url>' >>$f -done -echo '</urlset>'>>$f - -done -echo '</sitemapindex>'>>$sitemap - -########################################### -# -# copy some service files -# -########################################### - -#cp help.html index.html html/ -cp normalize.css default.css help.js fuse.js paginathing.js $outDir -cp -r $enSource/source/media $outDir -mkdir -p $outDir/media/icon-themes -#cp -a ../../icon-themes/colibre/* $outDir/media/icon-themes/ -#ln -s $productversion html/latest - -exit diff --git a/help3xsl/get_bookmark.sh b/help3xsl/get_bookmark.sh deleted file mode 100755 index 652cef1bb6..0000000000 --- a/help3xsl/get_bookmark.sh +++ /dev/null @@ -1,79 +0,0 @@ -#/bin/bash - -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. -# -########################################### -# -# Create the file bookmarks.js containing the links between the -# keywords found in <bookmark_value> and the html help page. -# The file is used in the Index tab of the html help page -# -########################################### -# -# $1 is Language -# $2 is productversion -# $3 is location of $(WORKDIR) - -lang=$1 -productversion=$2 -workDir=$(realpath $3) - -outDir=$(realpath $workDir/HelpTargetHTML/$productversion/$lang) -sourceDir=$(realpath $workDir/HelpTranslatePartTarget/$lang/helpcontent2/source) - -bookmarkFile=$outDir/bookmarks.js -mkdir -p $outDir - -rm -f $bookmarkFile -touch $bookmarkFile - -stub2=\' - -xslfile=get_bookmark.xsl - -param1=' --stringparam Language '$lang' --stringparam productversion '$productversion - -# bookmarks for modules - -for i in CALC CHART WRITER DRAW IMPRESS MATH BASIC -do -stub1='document.getElementById("bookmark'$i'").innerHTML='\'\\ -sfind=$sourceDir'/'$(echo 'text/s'$i | tr '[:upper:]' '[:lower:]') -param=$param1' --stringparam app '$i -tempFile=$(mktemp) -find $sfind -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $tempFile -echo $stub1 >> $bookmarkFile -sort -k3b -t\> -s -o $tempFile $tempFile -awk 'NF' $tempFile >> $bookmarkFile -echo $stub2 >> $bookmarkFile -rm -f $tempFile -done - -# Case of SHARED - -stub1='document.getElementById("bookmarkSHARED").innerHTML='\'\\ -tempFile=$(mktemp) -param=$param1' --stringparam app SHARED' -find $sourceDir'/text/shared' -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $tempFile -echo $stub1 >> $bookmarkFile -sort -k3b -t\> -s -o $tempFile $tempFile -awk 'NF' $tempFile >> $bookmarkFile -echo $stub2 >> $bookmarkFile -rm -f $tempFile - -# Case of Explorer (BASE) - -stub1='document.getElementById("bookmarkBASE").innerHTML='\'\\ -tempFile=$(mktemp) -param=$param1' --stringparam app BASE' -find $sourceDir'/text/shared/explorer/database' -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $tempFile -echo $stub1 >> $bookmarkFile -sort -k3b -t\> -s -o $tempFile $tempFile -awk 'NF' $tempFile >> $bookmarkFile -echo $stub2 >> $bookmarkFile -rm -f $tempFile -exit diff --git a/help3xsl/get_hid2file.sh b/help3xsl/get_hid2file.sh deleted file mode 100755 index bf201da37f..0000000000 --- a/help3xsl/get_hid2file.sh +++ /dev/null @@ -1,39 +0,0 @@ -#/bin/bash - -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. -# -# $1 is Product Version -# $2 is location of $(WORKDIR) - -########################################### -# -# Create the hid2file map that mapd HIDs into -# HTML pages. Language independent. -# will be put in $WORKDIR/HelpTargetHTML/$productversion/ -# -########################################### - -workDir=$2 -productversion=$1 - -helpFiles=$(realpath $workDir/../helpcontent2/source/text) - -mkdir -p $workDir/HelpTargetHTML/$productversion -outDir=$(realpath $workDir/HelpTargetHTML/$productversion) - -bookmarkFile=$outDir'/hid2file.js' - -tempFile=$(mktemp) -rm -f $bookmarkFile -touch $bookmarkFile - -find $helpFiles -type f -name "*.xhp" -exec xsltproc get_url.xsl {} + > $tempFile - -echo 'var map={' >> $bookmarkFile -awk 'NF' $tempFile >> $bookmarkFile -echo '};' >> $bookmarkFile -rm -f $tempFile diff --git a/help3xsl/get_html.sh b/help3xsl/get_html.sh deleted file mode 100755 index 95224c144f..0000000000 --- a/help3xsl/get_html.sh +++ /dev/null @@ -1,49 +0,0 @@ -#/bin/bash - -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. -# -########################################### -# -# Takes all translated xhp files and convert into HTML files -# -########################################### -# -# $1 is Language -# $2 is productversion -# $3 is location of $(WORKDIR) -# $4 is local or website -# If local, the filetree should be $(installDir) -# If website, filetree should be '/' -# $5 is filetree for local - - -lang=$1 -productversion=$2 -workDir=$(realpath $3) -offline=$4 -fileTree=$5 - -outDir=$(realpath $workDir/HelpTargetHTML/$productversion/$lang) -sourceDir=$(realpath $workDir/HelpTranslatePartTarget/$lang/helpcontent2/source) - -########################################### -# -# Process translated XHP files -# -########################################### - -xsltparm='--stringparam fileTree '$fileTree' --stringparam local '$offline' --stringparam Language '$lang' --stringparam productversion '$productversion' --stringparam root '$sourceDir'/' - -echo 'Conversion to HTML started for '$lang -for filep in $(find $sourceDir/text -name "*.xhp") -do -DIR=${filep##*text/} -name=${DIR:0:-3} -outFile=$outDir'/text/'$name'html' -xsltproc $xsltparm -o $outFile online_transform.xsl $filep -done -exit diff --git a/help3xsl/get_media.sh b/help3xsl/get_media.sh deleted file mode 100755 index ac1e90fc5e..0000000000 --- a/help3xsl/get_media.sh +++ /dev/null @@ -1,43 +0,0 @@ -#/bin/bash - -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. -########################################### -# -# add auxiliary javascript and html files -# add media files -# will be located in $WORKDIR/HelpTargetHTML/$productversion/ -# -# -########################################### - -# $1 is Language -# $2 is productversion -# $3 is location of $(WORKDIR) - -lang=$1 -productVersion=$2 -workDir=$(realpath $3) - -# copy files - -echo 'copy global service files' - -outDir=$workDir'/HelpTargetHTML/' - -cp index.html $outDir -cp help.html $outDir -cp index2.html $outDir'/'$productVersion'/index.html' -cp help.js $outDir'/'$productVersion'/' -cp fuse.js $outDir'/'$productVersion'/' -cp paginathing.js $outDir'/'$productVersion'/' -cp normalize.css $outDir'/'$productVersion'/' -cp default.css $outDir'/'$productVersion'/' - -cp -a ../source/media $outDir'/'$productVersion'/' - -colibre=$(realpath $workDir'/../icon-themes/colibre') -cp -a $colibre $outDir'/'$productVersion'/media/icon-themes' diff --git a/help3xsl/get_tree.sh b/help3xsl/get_tree.sh deleted file mode 100755 index d9582f5514..0000000000 --- a/help3xsl/get_tree.sh +++ /dev/null @@ -1,93 +0,0 @@ -#/bin/bash - -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. -########################################### -# -# Create the tree file named contents.js -# -# will be located in $WORKDIR/HelpTargetHTML/$productversion/$lang -# -# -########################################### - -# $1 is Language -# $2 is productversion -# $3 is location of $(WORKDIR) - -lang=$1 -productversion=$2 -workDir=$(realpath $3) - -outDir=$(realpath $workDir/HelpTargetHTML/$productversion/$lang) -sourceDir=$(realpath $workDir/HelpTreeTarget) - -treeFileHTML=$outDir/contents.js -rm -f $treeFileHTML -touch $treeFileHTML - -echo 'document.getElementById("Contents").innerHTML='$'\047''\'>$treeFileHTML - -xsltparm='--stringparam lang '$lang' --stringparam productversion '$productversion - -for module in sbasic scalc schart shared simpress smath swriter -do - -treeSourceFile=$sourceDir'/'$module'/'$lang'.tree' - -treeTemp2=$(mktemp) - -xsltproc $xsltparm -o $treeTemp2 get_tree.xsl $treeSourceFile - -awk 'NF' $treeTemp2>>$treeFileHTML - -rm -f $treeTemp2 -done - -echo $'\047'';'>>$treeFileHTML -exit - -ALL_LANGS='en-US am ar ast bg bn bn-IN bo bs ca ca-valencia cs da de dz el en-GB en-ZA eo es et eu fi fr gl gu he hi hr hu id is it ja ka km ko lo lt lv mk nb ne nl nn om pl pt-BR pt ro ru sid si sk sl sq sv ta tg tr ug uk vi zh-CN zh-TW' - -here=$(pwd) -root=$(realpath "$here/../..") - -rootTreex=$root -exedir="${rootTreex}"/workdir/LinkTarget/Executable -export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${rootTreex}"/instdir/program - - -# rm -rf $here/l10n -rm -rf $here/html - - -ALL_LANGS='fr pt-BR' -ALL_TREE='sbasic.tree scalc.tree schart.tree shared.tree simpress.tree smath.tree swriter.tree' -for lang in $ALL_LANGS -do -treePOFile=`mktemp` -echo $root/translations/source/$lang/helpcontent2/source/auxiliary.po > $treePOFile -outDirLang=$here/html/$productversion/$lang -mkdir -p $outDirLang - -for tree in $ALL_TREE -do -treeSourceFile=$root'/helpcontent2/source/auxiliary/'$tree - -outDirLang=$here/html/$productversion/$lang/$tree - -"${exedir}/treex" -l $lang -i $treeSourceFile -m $treePOFile -o $outDirLang -done -# rm -f $treePOFile -done -exit -rm -f $treeSourceFiles - -exit -pofiles=/tmp/pofiles.txt -xhpfiles=/tmp/xhpfiles.txt -# mkdir -p $here/html -# mkdir -p $here'/html/'$productversion diff --git a/help3xsl/makehelp.sh b/help3xsl/makehelp.sh deleted file mode 100755 index cf3d78a48e..0000000000 --- a/help3xsl/makehelp.sh +++ /dev/null @@ -1,47 +0,0 @@ -#/bin/bash - -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. - -# Arguments - -# $1 build local or webroot help [default=yes] -# values: yes no -# $2 build english help [default=no] -# values: yes no - -productVersion=6.0 -workDir=$(realpath '../../workdir') -langDirSource=$workDir'/HelpTranslatePartTarget' -offline="yes" - -if [ "$1" == "no" ] -then -offline="no" -fi - -if [ "$2" == "yes" ] -then -mkdir -p $langDirSource/en-US/helpcontent2/source -cp -r ../source/text $langDirSource/en-US/helpcontent2/source/ -for i in sbasic scalc schart shared simpress smath swriter -do -cp "../source/auxiliary/$i.tree" "$workDir/HelpTreeTarget/$i/en-US.tree" -done -fi - -./get_hid2file.sh $productVersion $workDir - -for lang in $(ls $langDirSource) -do -./get_bookmark.sh $lang $productVersion $workDir -./get_html.sh $lang $productVersion $workDir $offline '/' -./get_tree.sh $lang $productVersion $workDir -done - -./get_media.sh 'dummy' $productVersion $workDir - -exit diff --git a/help3xsl/xhp2html.sh b/help3xsl/xhp2html.sh deleted file mode 100755 index 65715f7f10..0000000000 --- a/help3xsl/xhp2html.sh +++ /dev/null @@ -1,282 +0,0 @@ -#/bin/bash - -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# 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/. -# -# This script builds translated XHP file with helpex excutable -# and thes transform it to html pages -# 1) generates redirection from LibreOffice Help URL to right html page -# in index.html with bookmark2file.js -# 2) generates bookmark_<APP>.js for index search -# 3) generates HTML pages with online_transform.xs -# 4) copy service files (css, js, media) to right place. -# -# Note: change rootHelpex variable to your local git build -# -# convert2HTML $outDirLang $outDirHTML $lang $productversion $online $fileTree & - -function get_bookmark(){ -lang=$1 -productversion=$2 -#workDir=$(realpath $3) -workDir=$(pwd) - -outDir=$(realpath $workDir/html/$productversion/$lang) -#sourceDir=$(realpath $workDir/l10n/$lang/helpcontent2/source) -sourceDir=$(realpath $workDir/l10n/$productversion/$lang) - -bookmarkFile=$outDir/bookmarks.js -mkdir -p $outDir - -rm -f $bookmarkFile -touch $bookmarkFile - -stub2=\' -stub1='document.getElementsByClassName( "index" )[0].innerHTML='\'\\ -echo $stub1 >> $bookmarkFile - -xslfile=get_bookmark.xsl - -param1=' --stringparam Language '$lang' --stringparam productversion '$productversion' --stringparam local no' - -# bookmarks for modules - -for i in WRITER CALC DRAW IMPRESS CHART MATH BASIC -do -sfind=$sourceDir'/'$(echo 'text/s'$i | tr '[:upper:]' '[:lower:]') -param=$param1' --stringparam app '$i -tempFile=$(mktemp) -find $sfind -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $tempFile -sort -k3b -t\> -s -o $tempFile $tempFile -awk 'NF' $tempFile >> $bookmarkFile -rm -f $tempFile -done - -# Case of SHARED - -tempFile=$(mktemp) -param=$param1' --stringparam app SHARED' -find $sourceDir'/text/shared' -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $tempFile -sort -k3b -t\> -s -o $tempFile $tempFile -awk 'NF' $tempFile >> $bookmarkFile -rm -f $tempFile - -# Case of Explorer (BASE) - -tempFile=$(mktemp) -param=$param1' --stringparam app BASE' -find $sourceDir'/text/shared/explorer/database' -type f -name "*.xhp" -exec xsltproc $param $xslfile {} + >> $tempFile -sort -k3b -t\> -s -o $tempFile $tempFile -awk 'NF' $tempFile >> $bookmarkFile -rm -f $tempFile -echo $stub2 >> $bookmarkFile -} - - -function convert2HTML() { -#outDirLang =1 -#outDirHTML =2 -#lang =3 -#productversion =4 -#online=5 -#filetree=6 - -########################################### -# -# Process translated XHP files -# -########################################### - -xsltparm='--stringparam fileTree '$6' --stringparam local no --stringparam Language '$3' --stringparam productversion '$4' --stringparam root '$1'/' - -echo 'Conversion to HTML started for '$3 - -for filep in $(find $1/text -name "*.xhp") -do -DIR=${filep##*text/} -name=${DIR:0:-3} -outFile=$2'/text/'$name'html' -xsltproc $xsltparm -o $outFile online_transform.xsl $filep -done - -########################################### -# -# Process tree files -# -########################################### - -treePOFile=$(mktemp) -echo $root/translations/source/$3/helpcontent2/source/auxiliary.po > $treePOFile - -ALL_TREE='sbasic.tree scalc.tree schart.tree shared.tree simpress.tree smath.tree swriter.tree' - -xhpFiles=$here/l10n/$productversion/$3/text - -treeFileHTML=$outDirHTML/contents.js - -rm -f $treeFileHTML -touch $treeFileHTML - -echo 'document.getElementById("Contents").innerHTML='$'\047''\'>$treeFileHTML - -xsltparm='--stringparam lang '$3' --stringparam productversion '$4' --stringparam local no' -for tree in $ALL_TREE -do -treeSourceFile=$root'/helpcontent2/source/auxiliary/'$tree -treeTemp1=$(mktemp) -treeTemp2=$(mktemp) - -"${exedir}/treex" -l $3 -i $treeSourceFile -m $treePOFile -o $treeTemp1 -r $xhpFiles - -xsltproc $xsltparm -o $treeTemp2 get_tree.xsl $treeTemp1 - -awk 'NF' $treeTemp2>>$treeFileHTML - -rm -f $treeTemp1 $treeTemp2 -done -echo $'\047'';'>>$treeFileHTML - -rm -f $treePOFile - -echo 'Conversion to HTML finished for '$3 -} - -########################################### -# -# Start Main Process -# -########################################### - -# Change root of git core -productversion='6.1' -local='no' -fileTree='/' - -rootHelpex=/home/tdf/git/core - -ALL_LANGS='en-US am ar ast bg bn bn-IN bo bs ca ca-valencia cs da de dz el en-GB en-ZA eo es et eu fi fr gl gu he hi hr hu id is it ja ka km ko lo lt lv mk nb ne nl nn om pl pt-BR pt ro ru sid si sk sl sq sv ta tg tr ug uk vi zh-CN zh-TW' - -here=$(pwd) -root=$(realpath "$here/../..") - -rm -rf $here/l10n -rm -rf $here/html - -helpfiles=$root/helpcontent2/source/text - -mkdir -p $here'/html/'$productversion - -echo 'copy global service files' -cp index.html $here'/html/' -cp help.html $here'/html/' -cp index2.html $here'/html/'$productversion'/index.html' -cp help.js $here'/html/'$productversion'/' -cp fuse.js $here'/html/'$productversion'/' -cp paginathing.js $here'/html/'$productversion'/' -cp normalize.css $here'/html/'$productversion'/' -cp default.css $here'/html/'$productversion'/' - -cp -a ../source/media $here'/html/'$productversion'/' -mkdir -p $here'/html/'$productversion'/media/icon-themes' -cp -a ../../icon-themes/colibre/* $here'/html/'$productversion'/media/icon-themes/' -ln -s $productversion html/latest - -# Set helpex utilty and environment - -while test ! -d "${rootHelpex}/instdir/program" ; do -if test "${dir}" = "/"; then -echo "error: cannot find \"program\" dir from \"$(pwd)\"" -exit 1 -fi -rootHelpex=$(realpath "${rootHelpex}/..") -done - -exedir="${rootHelpex}"/workdir/LinkTarget/Executable -echo $exedir - -export URE_BOOTSTRAP=file://"${rootHelpex}"/instdir/program/fundamentalrc123 -export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${rootHelpex}"/instdir/program - -echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}" -echo "setting search path to: ${LD_LIBRARY_PATH}" -echo "execing: ${exedir}/helpex" - -########################################### -# -# Create the hid2file map -# -########################################### -stub1='var map={' -stub2='};' -ffile='html/'$productversion'/hid2file.js' -ffile2=/tmp/tmpbkm.txt -rm -f $ffile2 $ffile -find $helpfiles -type f -name "*.xhp" -exec xsltproc get_url.xsl {} + > $ffile2 -echo $stub1 >> $ffile -awk 'NF' $ffile2 >> $ffile -echo $stub2 >> $ffile - -########################################### -# -# Process languages -# -########################################### - -for lang in $ALL_LANGS -do - -echo 'Processing Language '$lang - -outDirLang=$here'/l10n/'$productversion'/'$lang -mkdir -p $outDirLang - -outDirHTML=$here'/html/'$productversion'/'$lang -mkdir -p $outDirHTML - -# Special case of en-US, tehre is no translation to do - -if [ "$lang" == en-US ]; -then - -cp -a $helpfiles $outDirLang - -else -# Create first all translations of xhp -translations=$root/translations/source/$lang/helpcontent2/source/text/ - -pofiles=`mktemp` -xhpfiles=`mktemp` - -# gather all po files of dir -find $translations -type f >$pofiles - -# For each po file -for ff in $(cat $pofiles) -do - echo 'Processing po file: '$ff - potemp=`mktemp` - echo $ff>$potemp - name=${ff:0:-3} - stub=${name##*text/} - hlpFileDir=$helpfiles'/'$stub - outDir=$outDirLang'/text/'$stub - mkdir -p $outDir - ls $hlpFileDir/*.xhp >$xhpfiles - "${exedir}/helpex" -l $lang -mi $xhpfiles -m $potemp -o $outDir - rm -f $potemp -done -fi - -#extracting bookmarks -echo 'Extracting bookmarks' -get_bookmark $lang $productversion $(pwd)/html & - -# converting to HTML -convert2HTML $outDirLang $outDirHTML $lang $productversion $local $fileTree & - -rm -f $pofiles $xhpfiles -done -exit |