[Libreoffice-commits] help.git: GeneratedPackage_html_media.mk help3xsl/help.js help3xsl/online_transform.xsl help3xsl/xhp2html.sh source/media source/text
Olivier Hallot
olivier.hallot at libreoffice.org
Thu Mar 22 13:10:40 UTC 2018
GeneratedPackage_html_media.mk | 1 +
help3xsl/help.js | 5 ++++-
help3xsl/online_transform.xsl | 18 ++++++++++++++++++
help3xsl/xhp2html.sh | 10 +++++++---
source/media/files/scalc/imtrigon.ods |binary
source/text/scalc/01/func_imsin.xhp | 2 ++
6 files changed, 32 insertions(+), 4 deletions(-)
New commits:
commit 0d0de1b0c16334322e584fcb770db68f66d2a042
Author: Olivier Hallot <olivier.hallot at libreoffice.org>
Date: Thu Mar 22 00:21:04 2018 -0300
Add vnd.oasis.opendocument.* objects in new help
Add capability to link ODF files in help page as objects
Files are stored in media/files/ folder
Example in func_imsin.xhp
Change-Id: I4704e3cc235fd31251f3a4dba403e62f2ef1de0e
Reviewed-on: https://gerrit.libreoffice.org/51721
Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
Tested-by: Olivier Hallot <olivier.hallot at libreoffice.org>
diff --git a/GeneratedPackage_html_media.mk b/GeneratedPackage_html_media.mk
index cfc526b4e..5ff4521c4 100644
--- a/GeneratedPackage_html_media.mk
+++ b/GeneratedPackage_html_media.mk
@@ -14,5 +14,6 @@ $(eval $(call gb_GeneratedPackage_add_dir,helpcontent2_html_media,$(INSTROOT)/$(
$(eval $(call gb_GeneratedPackage_add_dir,helpcontent2_html_media,$(INSTROOT)/$(LIBO_SHARE_HELP_FOLDER)/$(if $(HELP_ONLINE),$(PRODUCTVERSION),)/media/helpimg,helpcontent2/source/media/helpimg))
$(eval $(call gb_GeneratedPackage_add_dir,helpcontent2_html_media,$(INSTROOT)/$(LIBO_SHARE_HELP_FOLDER)/$(if $(HELP_ONLINE),$(PRODUCTVERSION),)/media/navigation,helpcontent2/source/media/navigation))
$(eval $(call gb_GeneratedPackage_add_dir,helpcontent2_html_media,$(INSTROOT)/$(LIBO_SHARE_HELP_FOLDER)/$(if $(HELP_ONLINE),$(PRODUCTVERSION),)/media/screenshots,helpcontent2/source/media/screenshots))
+$(eval $(call gb_GeneratedPackage_add_dir,helpcontent2_html_media,$(INSTROOT)/$(LIBO_SHARE_HELP_FOLDER)/$(if $(HELP_ONLINE),$(PRODUCTVERSION),)/media/files,helpcontent2/source/media/files))
# vim: set noet sw=4 ts=4:
diff --git a/help3xsl/help.js b/help3xsl/help.js
index 838605526..cd454e6fb 100644
--- a/help3xsl/help.js
+++ b/help3xsl/help.js
@@ -48,13 +48,16 @@ function setSystem(system) {
}
}
/* add &DbPAR= and &System= to the links in DisplayArea div */
+/* skip for object files */
function fixURL(module, system) {
var itemlink = document.getElementById("DisplayArea").getElementsByTagName("a");
- var pSystem = (system === null) ? "WIN" : system;
+ var pSystem = (system === null) ? getSystem() : system;
var pAppl = (module === null) ? "WRITER" : module;
var n = itemlink.length;
for (var i = 0; i < n; i++) {
+ if (itemlink[i].getAttribute("class") != "objectfiles"){
setURLParam(itemlink[i], pSystem, pAppl);
+ };
}
}
//Set the params inside URL
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 467f093a9..6127ca924 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -1099,6 +1099,24 @@
<audio src="{$data}" type="{@type}" controls="'1'"></audio>
</div>
</xsl:when>
+ <xsl:when test="@type='application/vnd.oasis.opendocument.spreadsheet'">
+ <a class="objectfiles" href="{concat($target, at data)}"><img src="{concat($target,'media/navigation/libo-calc.svg')}" width="25px" height="30px"></img></a>
+ </xsl:when>
+ <xsl:when test="@type='application/vnd.oasis.opendocument.text'">
+ <a class="objectfiles" href="{concat($target, at data)}"><img src="{concat($target,'media/navigation/libo-writer.svg')}" width="25px" height="30px"></img></a>
+ </xsl:when>
+ <xsl:when test="@type='application/vnd.oasis.opendocument.presentation'">
+ <a class="objectfiles" href="{concat($target, at data)}"><img src="{concat($target,'media/navigation/libo-impress.svg')}" width="25px" height="30px"></img></a>
+ </xsl:when>
+ <xsl:when test="@type='application/vnd.oasis.opendocument.drawing'">
+ <a class="objectfiles" href="{concat($target, at data)}"><img src="{concat($target,'media/navigation/libo-draw.svg')}" width="25px" height="30px"></img></a>
+ </xsl:when>
+ <xsl:when test="@type='application/vnd.oasis.opendocument.formula'">
+ <a class="objectfiles" href="{concat($target, at data)}"><img src="{concat($target,'media/navigation/libo-math.svg')}" width="25px" height="30px"></img></a>
+ </xsl:when>
+ <xsl:when test="@type='application/vnd.oasis.opendocument.database'">
+ <a class="objectfiles" href="{concat($target, at data)}"><img src="{concat($target,'media/navigation/libo-base.svg')}" width="25px" height="30px"></img></a>
+ </xsl:when>
<xsl:otherwise>
<object width="{$width}" height="{$height}" data="{$data}" type="{@type}"></object>
</xsl:otherwise>
diff --git a/help3xsl/xhp2html.sh b/help3xsl/xhp2html.sh
index 335a1abe5..6da95dbd9 100755
--- a/help3xsl/xhp2html.sh
+++ b/help3xsl/xhp2html.sh
@@ -40,7 +40,7 @@ echo $stub1 >> $bookmarkFile
xslfile=get_bookmark.xsl
-param1=' --stringparam Language '$lang' --stringparam productversion '$productversion
+param1=' --stringparam Language '$lang' --stringparam productversion '$productversion' --stringparam local no'
# bookmarks for modules
@@ -90,9 +90,10 @@ function convert2HTML() {
#
###########################################
-xsltparm='--stringparam fileTree '$6' --stringparam local '$5' --stringparam Language '$3' --stringparam productversion '$4' --stringparam root '$1'/'
+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/}
@@ -115,11 +116,13 @@ ALL_TREE='sbasic.tree scalc.tree schart.tree shared.tree simpress.tree smat
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
+xsltparm='--stringparam lang '$3' --stringparam productversion '$4' --stringparam local no'
for tree in $ALL_TREE
do
treeSourceFile=$root'/helpcontent2/source/auxiliary/'$tree
@@ -155,6 +158,7 @@ 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/../..")
diff --git a/source/media/files/scalc/imtrigon.ods b/source/media/files/scalc/imtrigon.ods
new file mode 100644
index 000000000..5a8dfc8a4
Binary files /dev/null and b/source/media/files/scalc/imtrigon.ods differ
diff --git a/source/text/scalc/01/func_imsin.xhp b/source/text/scalc/01/func_imsin.xhp
index f6780401b..be59efc35 100644
--- a/source/text/scalc/01/func_imsin.xhp
+++ b/source/text/scalc/01/func_imsin.xhp
@@ -60,6 +60,8 @@
<item type="input">=IMSIN(2)</item><br/>
returns 0.909297426825682 as a string. <embedvar href="text/scalc/01/ful_func.xhp#func_imag_zero"/>
</paragraph>
+ <paragraph role="heading" id="hd_id161521663319917" level="3" xml-lang="en-US">Open file with example</paragraph>
+ <object data="media/files/scalc/imtrigon.ods" id="ods_id61521568603544" type="application/vnd.oasis.opendocument.spreadsheet" />
<section id="relatedtopics">
<paragraph id="par_id2773214341302" role="paragraph" localize="false" xml-lang="en-US">
<embedvar href="text/scalc/01/func_imsinh.xhp#imsinh_head"/>,
More information about the Libreoffice-commits
mailing list