summaryrefslogtreecommitdiff
path: root/CustomTarget_html.mk
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2019-04-01 14:03:26 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2019-04-06 16:04:33 +0200
commit61f44912beec99f6211399ce567274aa369f817d (patch)
tree6021d73eac77f65f31fb254a08e35dd25bd0767f /CustomTarget_html.mk
parent0e323bedb182d71c72ef08ec0f745bb60830a2c3 (diff)
Create XSLT replacement table for missing icons
Missing UI icons have a replacement table in /core/icon-themes/colibre/links.txt Help must also use this replacement table when Help pages have missing icons. The previous approach was a manual creation of a XSLT for the replacement. The patch moves the replacement table creation inside the Custom makefile, making it automatic and carrying changes of the original links.txt source. Change-Id: I7f834fa03bbd85f329efbec43e5c51cc86d51586 Reviewed-on: https://gerrit.libreoffice.org/70080 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'CustomTarget_html.mk')
-rw-r--r--CustomTarget_html.mk17
1 files changed, 17 insertions, 0 deletions
diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk
index 45d3f284b7..84e142c265 100644
--- a/CustomTarget_html.mk
+++ b/CustomTarget_html.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_CustomTarget_CustomTarget,helpcontent2/help3xsl))
html_TREE_MODULES := sbasic scalc schart shared simpress smath swriter
html_TEXT_MODULES := $(html_TREE_MODULES) sdatabase sdraw
html_BMARK_MODULES := swriter:WRITER scalc:CALC simpress:IMPRESS sdraw:DRAW shared/explorer/database:BASE smath:MATH schart:CHART sbasic:BASIC shared:SHARED
+ICON_FILE := $(SRCDIR)/icon-themes/colibre/links.txt
$(eval $(call gb_CustomTarget_register_targets,helpcontent2/help3xsl,\
hid2file.js \
@@ -108,6 +109,21 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/contents.js :
) > $@ \
)
+$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/links.txt.xsl :
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ICO,2)
+ $(call gb_Helper_abbreviate_dirs,\
+ ( \
+ echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
+ && echo "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">" \
+ && echo "<xsl:template name=\"linktxt\">" \
+ && echo "<xsl:param name=\"src1\"/>" \
+ && echo "<xsl:choose>" \
+ && grep -v "#" < $(ICON_FILE) | $(gb_AWK) 'NF' | $(gb_AWK) -v q=\' '{printf "<xsl:when test=\"\x24src1="q $$1 q "\"><xsl:text>" $$2 "</xsl:text></xsl:when>\n"}' \
+ && $(gb_AWK) 'BEGIN {printf "<xsl:otherwise><xsl:value-of select=\"\x24src1\"/></xsl:otherwise>\n"}' \
+ && echo "</xsl:choose>\n</xsl:template>\n</xsl:stylesheet>" \
+ ) > $@ \
+ )
+
$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/contents.part : \
$(SRCDIR)/helpcontent2/help3xsl/get_tree.xsl \
$(call gb_ExternalExecutable_get_dependencies,xsltproc)
@@ -126,6 +142,7 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/contents.part : \
define html_gen_html_dep
$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/$(1)/html.text : \
+ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/links.txt.xsl \
$(foreach module,$(html_TEXT_MODULES), \
$(if $(filter en-US,$(1)), \
$(call gb_AllLangHelp_get_helpfiles_target,$(module)), \