summaryrefslogtreecommitdiff
path: root/help3xsl
diff options
context:
space:
mode:
authorOlivier Hallot <ohallot@collabora.co.uk>2016-05-08 07:06:25 -0300
committerOlivier Hallot <ohallot@collabora.co.uk>2016-05-08 10:08:45 +0000
commit91e86eaee7102c538c432140a4ab6b44c25a9cd2 (patch)
treea63b49b2092584b99f2f79049f0430147c2a5b97 /help3xsl
parent6bf8d987d05e14c5efaf9f7ab6da79642d227307 (diff)
HC3: XSL to extract bookmarks from XHP files
Change-Id: Idaf6e4e890a1be1a44d96a5a36786fd480dc01f9 Reviewed-on: https://gerrit.libreoffice.org/24756 Reviewed-by: Olivier Hallot <ohallot@collabora.co.uk> Tested-by: Olivier Hallot <ohallot@collabora.co.uk>
Diffstat (limited to 'help3xsl')
-rwxr-xr-xhelp3xsl/get_bookmark.sh65
-rw-r--r--help3xsl/get_bookmark.xsl118
2 files changed, 183 insertions, 0 deletions
diff --git a/help3xsl/get_bookmark.sh b/help3xsl/get_bookmark.sh
new file mode 100755
index 0000000000..2ae124c712
--- /dev/null
+++ b/help3xsl/get_bookmark.sh
@@ -0,0 +1,65 @@
+#/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/.
+-->
+
+stub1='<html><head><link rel="stylesheet" type="text/css" href="/default.css"/></head><body><ul class="indexlink">'
+stub2='</ul></body></html>'
+ffile=bookmark_calc.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/scalc -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
+ffile=bookmark_writer.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/swriter -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
+ffile=bookmark_draw.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/sdraw -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
+ffile=bookmark_impress.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/simpress -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
+ffile=bookmark_shared.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/shared -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
+ffile=bookmark_chart.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/schart -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
+ffile=bookmark_math.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/smath -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
+ffile=bookmark_basic.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/sbasic -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
+ffile=bookmark_base.html
+rm -f $ffile
+echo $stub1 > $ffile
+find ../source/text/shared/explorer/database -type f -name "*.xhp" -exec xsltproc get_bookmark.xsl {} + >> $ffile
+echo $stub2 >> $ffile
+
diff --git a/help3xsl/get_bookmark.xsl b/help3xsl/get_bookmark.xsl
new file mode 100644
index 0000000000..b3e65ebfe3
--- /dev/null
+++ b/help3xsl/get_bookmark.xsl
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * 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/.
+-->
+<!--
+Stylesheet to extract index bookmarks from xhp files and output a link to
+the xhp file.
+Usage:
+xsltproc get_bookmark.xsl file.xhp
+-->
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output indent="yes" method="html"/>
+
+<!--
+############################
+# Variables and Parameters #
+############################
+//-->
+<xsl:variable name="filename" select="/helpdocument/meta/topic/filename"/>
+<!-- Product brand variables used in the help files -->
+<xsl:variable name="brand1" select="'$[officename]'"/>
+<xsl:variable name="brand2" select="'$[officeversion]'"/>
+<xsl:variable name="brand3" select="'%PRODUCTNAME'"/>
+<xsl:variable name="brand4" select="'%PRODUCTVERSION'"/>
+<xsl:param name="productname" select="'LibreOffice'"/>
+<xsl:param name="productversion" select="'5.2'"/>
+<!--
+#############
+# Templates #
+#############
+//-->
+
+<!-- Extract the bookmarks-->
+<xsl:template match="/">
+ <xsl:for-each select="//bookmark[@branch='index']">
+ <xsl:variable name="href" select="concat($filename,'#',@id)"/>
+ <xsl:for-each select="bookmark_value">
+ <li><a href="{$href}" target="_top">
+ <xsl:apply-templates>
+ <xsl:value-of select="."/>
+ </xsl:apply-templates>
+ </a></li><xsl:text>&#xA;</xsl:text>
+ </xsl:for-each>
+ </xsl:for-each>
+</xsl:template>
+
+<!-- Branding -->
+<xsl:template match="text()">
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+
+<xsl:template name="brand" >
+ <xsl:param name="string"/>
+
+ <xsl:choose>
+
+ <xsl:when test="contains($string,$brand1)">
+ <xsl:variable name="newstr">
+ <xsl:value-of select="substring-before($string,$brand1)"/>
+ <xsl:value-of select="$productname"/>
+ <xsl:value-of select="substring-after($string,$brand1)"/>
+ </xsl:variable>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($string,$brand2)">
+ <xsl:variable name="newstr">
+ <xsl:value-of select="substring-before($string,$brand2)"/>
+ <xsl:value-of select="$pversion"/>
+ <xsl:value-of select="substring-after($string,$brand2)"/>
+ </xsl:variable>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($string,$brand3)">
+ <xsl:variable name="newstr">
+ <xsl:value-of select="substring-before($string,$brand3)"/>
+ <xsl:value-of select="$productname"/>
+ <xsl:value-of select="substring-after($string,$brand3)"/>
+ </xsl:variable>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($string,$brand4)">
+ <xsl:variable name="newstr">
+ <xsl:value-of select="substring-before($string,$brand4)"/>
+ <xsl:value-of select="$pversion"/>
+ <xsl:value-of select="substring-after($string,$brand4)"/>
+ </xsl:variable>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:value-of select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+</xsl:template>
+
+</xsl:stylesheet>
='libreoffice-7-0-5'>libreoffice-7-0-5 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/sd/inc/family.hrc
AgeCommit message (Collapse)Author
2023-10-12Make NC_ constexpr-friendlyStephan Bergmann
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr paths into a new TranslateId::getId. And demonstrate constexpr'ability by making the aCategories var in OApplicationIconControl::Fill (dbaccess/source/ui/app/AppIconControl.cxx) constexpr. (And there might be more such cases that could now be made constexpr.) Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-21Recheck modules sd* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I97c1a0e8c7f26807b12e6062581066d09ea13086 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130114 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-08-05Pass context and resource string down to boost::locale separatelyNoel Grandin
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-24tdf#124176 Use pragma once in sdVincent LE GARREC
Change-Id: Ic439140d9ecdcdee9272185bd3c2d11e11288f07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112051 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2018-11-17Adapt to C++2a char_tStephan Bergmann
u8 literals incompatibly change their type (as implemented by recent Clang trunk) Change-Id: Ia4f7b91f5d86656a056303d2754981ab2093a739 Reviewed-on: https://gerrit.libreoffice.org/63494 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-19convert SFXSTYLEBIT to scoped enumNoel Grandin
drop SFXSTYLEBIT_HIERARCHY because it has no overlap with these values, it's used an extra bit in SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter Change-Id: I8ee5ecb9b5f8d2087d8eedd1f5526260ec1e4018 Reviewed-on: https://gerrit.libreoffice.org/53089 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21de-hrc various thingsCaolán McNamara
e.g. helpid[s].hrc -> helpids.h and insert include guards where missing move "ordinary" defines into .hxx files remove .hrc entries that are used as arguments to dialog factory when a dedicated method can be added instead Change-Id: I792fb8eb0adfaa63cf354e6e57401fc943e9196e
2017-07-21migrate to boost::gettextCaolán McNamara
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a