diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2020-05-04 10:33:44 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2020-05-11 17:43:42 +0200 |
commit | ee180ade07e36dd1fb8c7bdca6ecbab44ded9eb8 (patch) | |
tree | 5e5f78e114533b036e02c3b2e0d97ba618a97c93 /make_icon_link.txt.py | |
parent | 5bead0438b7fe977d8d2288c0397b34a3623d68f (diff) |
tdf#128519 Automate icon repl't table for Help bld
The solution here is to create links.txt.xsl in the
helpcontent2/helpers/ folder at build time because the <include>
directive in XSLT of online_transform.xsl must be hardcoded
(compile time) and core/workdir/ is not.
Change-Id: I8c4c8d0b8aed58c10a95c5d42bbd1b8acdb39614
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/93436
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'make_icon_link.txt.py')
-rwxr-xr-x | make_icon_link.txt.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/make_icon_link.txt.py b/make_icon_link.txt.py deleted file mode 100755 index 8fee7e8aa4..0000000000 --- a/make_icon_link.txt.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/python - -# -# 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/. -# -# -# Generate XSL equivalent for Colibre icon images from link.txt -# - -import sys - -try: - # open file stream - file_icon = open("../icon-themes/colibre/links.txt", "r") -except IOError: - print "There was an error reading", file_icon - sys.exit() -try: - # open file stream - file_xsl = open("help3xsl/links.txt.xsl", "w+") -except IOError: - print "There was an error writing", file_xsl - sys.exit() - -file_xsl.write('<?xml version="1.0" encoding="UTF-8"?>\n'); -file_xsl.write('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n'); -file_xsl.write('<xsl:template name="linktxt">\n'); -file_xsl.write('<xsl:param name="src1"/>\n'); -file_xsl.write('<xsl:choose>\n') - -for line in file_icon: - if line[0] != "#" : - if line.find('png',0, len(line)) <> -1 : - a = "\'" + line.split()[0] + "\'"; - b = line.split()[1].replace(".png",".svg"); - file_xsl.write('<xsl:when test="$src1=' + a + '"><xsl:text>'+ b + '</xsl:text></xsl:when>\n'); - -file_xsl.write('<xsl:otherwise><xsl:value-of select="$src1"/></xsl:otherwise>\n'); -file_xsl.write('</xsl:choose>\n'); -file_xsl.write('</xsl:template>\n'); -file_xsl.write('</xsl:stylesheet>\n'); - -file_xsl.close() -file_icon.close() -sys.exit() |