diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-08-02 00:49:11 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@edx.srv.br> | 2017-08-02 06:01:42 +0200 |
commit | 9f9cebab254146cbae0a093626ed78801e85b98f (patch) | |
tree | 2a6e56904450fe3d88ad2d21e561a5c83d7c9dd8 /help3xsl/xhp2html.sh | |
parent | 4d6f86d203814a211eae9dfacd4baf195ca4ff1d (diff) |
tdf#97745 Handle offline browser help
* Rename index.html to LOHelp.html. index.html is a bad name,
too generic. LOHelp.html is invoked by LibreOffice and is not a
popular file name.
* Clean the XSLT transform, add suport for local help.
* reposition bookmark2file.js in the target tree.
* remove obsolete files
* page tree now capable to be opened by file:// protocol, passing
'online' parameter and folder address to the bash script.
Change-Id: I2cf9f69de7896bd74074745993ef033bef5c3503
Reviewed-on: https://gerrit.libreoffice.org/40661
Reviewed-by: Olivier Hallot <olivier.hallot@edx.srv.br>
Tested-by: Olivier Hallot <olivier.hallot@edx.srv.br>
Diffstat (limited to 'help3xsl/xhp2html.sh')
-rwxr-xr-x | help3xsl/xhp2html.sh | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/help3xsl/xhp2html.sh b/help3xsl/xhp2html.sh index eb2696a6e4..7ba59588fa 100755 --- a/help3xsl/xhp2html.sh +++ b/help3xsl/xhp2html.sh @@ -16,14 +16,24 @@ # # Note: change rootHelpex variable to your local git build # +# convert2HTML $outDirLang $outDirHTML $lang $productversion $online $fileTree & function convert2HTML() { #outDirLang =1 #outDirHTML =2 #lang =3 #productversion =4 +#online=5 +#filetree=6 + +########################################### +# +# Process translated XHP files +# +########################################### + +xsltparm='--stringparam fileTree '$6' --stringparam local '$5' --stringparam Language '$3' --stringparam productversion '$4' --stringparam root '$1'/' -xsltparm='--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 @@ -33,7 +43,11 @@ 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 @@ -69,8 +83,17 @@ rm -f $treePOFile echo 'Conversion to HTML finished for '$3 } +########################################### +# +# Start Main Process +# +########################################### + # Change root of git core productversion='6.0' +local='no' +fileTree='/home/tdf/git/core/helpcontent2/help3xsl/html/' + 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' @@ -87,6 +110,8 @@ mkdir -p $here'/html/'$productversion echo 'copy global service files' cp index.html $here'/html/' +cp LOHelp.html $here'/html/' +cp index2.html $here'/html/'$productversion'/index.html' cp help.js $here'/html/'$productversion'/' cp jquery-3.1.1.min.js $here'/html/'$productversion'/' cp normalize.css $here'/html/'$productversion'/' @@ -117,10 +142,14 @@ echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}" echo "setting search path to: ${LD_LIBRARY_PATH}" echo "execing: ${exedir}/helpex" +########################################### +# # Create the bookmark2file map +# +########################################### stub1='var map={' stub2='};' -ffile='html/bookmark2file.js' +ffile='html/'$productversion'/bookmark2file.js' ffile2=/tmp/tmpbkm.txt rm -f $ffile2 $ffile find $helpfiles -type f -name "*.xhp" -exec xsltproc get_url.xsl {} + > $ffile2 @@ -128,6 +157,12 @@ echo $stub1 >> $ffile awk 'NF' $ffile2 >> $ffile echo $stub2 >> $ffile +########################################### +# +# Process languages +# +########################################### + for lang in $ALL_LANGS do @@ -178,7 +213,7 @@ echo 'Extracting bookmarks' ./get_bookmark.sh $lang $productversion & # converting to HTML -convert2HTML $outDirLang $outDirHTML $lang $productversion & +convert2HTML $outDirLang $outDirHTML $lang $productversion $local $fileTree & rm -f $pofiles $xhpfiles done |