From 33355d16cce4e8a650bc34656aa45937289ba153 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Sun, 14 Jan 2024 17:57:39 +0100 Subject: [PATCH 01/10] docbook xsl: customization layer for xsl stylesheets - Rename the customised DocBook XSL stylesheet layer to make it clear that they are used for the GnuCash project. - Add separate layer for customizing HTML Based on an idea by TANIGUCHI Yasuaki aka usamimikamen-sk. --- CMakeLists.txt | 8 ++++---- ...neral-chm-customization.xsl => gnc-custom-chm.xsl} | 0 ...eneral-customization.xsl => gnc-custom-common.xsl} | 0 ...ral-epub-customization.xsl => gnc-custom-epub.xsl} | 0 xsl/gnc-custom-html.xsl | 11 +++++++++++ ...eneral-fo-customization.xsl => gnc-custom-pdf.xsl} | 0 zh/xsl/lang-stylesheet-html.xsl | 3 +-- 7 files changed, 16 insertions(+), 6 deletions(-) rename xsl/{general-chm-customization.xsl => gnc-custom-chm.xsl} (100%) rename xsl/{general-customization.xsl => gnc-custom-common.xsl} (100%) rename xsl/{general-epub-customization.xsl => gnc-custom-epub.xsl} (100%) create mode 100644 xsl/gnc-custom-html.xsl rename xsl/{general-fo-customization.xsl => gnc-custom-pdf.xsl} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4140aaa3..27c8e3296 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,10 +76,10 @@ set(JAPANESE_GOTHIC_TTF "ume-tmo3.ttf" CACHE STRING "Gothic TrueType font used f set(japanese_fontdir "${CMAKE_SOURCE_DIR}/fonts/truetype" CACHE STRING "Directory to search for Japanese fonts") # Set the default XSL file path -set(BASE_XSLT_HTML "${CMAKE_SOURCE_DIR}/xsl/general-customization.xsl") -set(BASE_XSLT_PDF "${CMAKE_SOURCE_DIR}/xsl/general-fo-customization.xsl") -set(BASE_XSLT_EPUB "${CMAKE_SOURCE_DIR}/xsl/general-epub-customization.xsl") -set(BASE_XSLT_CHM "${CMAKE_SOURCE_DIR}/xsl/general-chm-customization.xsl") +set(BASE_XSLT_HTML "${CMAKE_SOURCE_DIR}/xsl/gnc-custom-html.xsl") +set(BASE_XSLT_PDF "${CMAKE_SOURCE_DIR}/xsl/gnc-custom-pdf.xsl") +set(BASE_XSLT_EPUB "${CMAKE_SOURCE_DIR}/xsl/gnc-custom-epub.xsl") +set(BASE_XSLT_CHM "${CMAKE_SOURCE_DIR}/xsl/gnc-custom-chm.xsl") # Buildtime destination directories for our generated documentation set(DATADIR_BUILD "${CMAKE_BINARY_DIR}/share") diff --git a/xsl/general-chm-customization.xsl b/xsl/gnc-custom-chm.xsl similarity index 100% rename from xsl/general-chm-customization.xsl rename to xsl/gnc-custom-chm.xsl diff --git a/xsl/general-customization.xsl b/xsl/gnc-custom-common.xsl similarity index 100% rename from xsl/general-customization.xsl rename to xsl/gnc-custom-common.xsl diff --git a/xsl/general-epub-customization.xsl b/xsl/gnc-custom-epub.xsl similarity index 100% rename from xsl/general-epub-customization.xsl rename to xsl/gnc-custom-epub.xsl diff --git a/xsl/gnc-custom-html.xsl b/xsl/gnc-custom-html.xsl new file mode 100644 index 000000000..2f5470aa1 --- /dev/null +++ b/xsl/gnc-custom-html.xsl @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/xsl/general-fo-customization.xsl b/xsl/gnc-custom-pdf.xsl similarity index 100% rename from xsl/general-fo-customization.xsl rename to xsl/gnc-custom-pdf.xsl diff --git a/zh/xsl/lang-stylesheet-html.xsl b/zh/xsl/lang-stylesheet-html.xsl index 818cf9073..3f0ac297e 100644 --- a/zh/xsl/lang-stylesheet-html.xsl +++ b/zh/xsl/lang-stylesheet-html.xsl @@ -9,8 +9,7 @@ version='1.0'> - - + From f62c6b5ac0d6d0f15a0b4ac6fb404c23abeecfd9 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Fri, 19 Jan 2024 20:46:37 +0100 Subject: [PATCH 02/10] docbook xsl: prepare target-depend layer and clean up --- xsl/gnc-custom-chm.xsl | 16 +++++--- xsl/gnc-custom-common.xsl | 80 +++++---------------------------------- xsl/gnc-custom-epub.xsl | 16 +++++--- xsl/gnc-custom-html.xsl | 10 +++++ xsl/gnc-custom-pdf.xsl | 16 +++++--- 5 files changed, 52 insertions(+), 86 deletions(-) diff --git a/xsl/gnc-custom-chm.xsl b/xsl/gnc-custom-chm.xsl index 5c7a90921..675af6e00 100644 --- a/xsl/gnc-custom-chm.xsl +++ b/xsl/gnc-custom-chm.xsl @@ -1,13 +1,19 @@ - - + version='1.0'> + + + + + + + + + + diff --git a/xsl/gnc-custom-common.xsl b/xsl/gnc-custom-common.xsl index a6eeebdf1..5dfc4ef00 100644 --- a/xsl/gnc-custom-common.xsl +++ b/xsl/gnc-custom-common.xsl @@ -1,87 +1,25 @@ + version='1.0'> - + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + + - - - - - - - - - - - + + diff --git a/xsl/gnc-custom-epub.xsl b/xsl/gnc-custom-epub.xsl index 3505dc2dd..4c04569db 100644 --- a/xsl/gnc-custom-epub.xsl +++ b/xsl/gnc-custom-epub.xsl @@ -1,13 +1,19 @@ - - + version='1.0'> + + + + + + + + + + diff --git a/xsl/gnc-custom-html.xsl b/xsl/gnc-custom-html.xsl index 2f5470aa1..31ff82109 100644 --- a/xsl/gnc-custom-html.xsl +++ b/xsl/gnc-custom-html.xsl @@ -8,4 +8,14 @@ + + + + + + + + + + diff --git a/xsl/gnc-custom-pdf.xsl b/xsl/gnc-custom-pdf.xsl index a50c91a22..f5c11a1e2 100644 --- a/xsl/gnc-custom-pdf.xsl +++ b/xsl/gnc-custom-pdf.xsl @@ -1,13 +1,19 @@ - - + version='1.0'> + + + + + + + + + + From 6baca80379d656a37e97bedade967f13af42b097 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Sun, 28 Jan 2024 17:51:55 +0100 Subject: [PATCH 03/10] docbook xsl: html specific customizing --- cmake/AddHtmlTarget.cmake | 1 - xsl/gnc-custom-html.xsl | 58 ++++++++++++++++++++++++++++++++++++++- zh/xsl/zh-chm.xsl | 2 +- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/cmake/AddHtmlTarget.cmake b/cmake/AddHtmlTarget.cmake index cd4abe204..3e8ffa159 100644 --- a/cmake/AddHtmlTarget.cmake +++ b/cmake/AddHtmlTarget.cmake @@ -28,7 +28,6 @@ function (add_html_target targetbase lang entities figures xslt_file) COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}/stylesheet" COMMAND ${XSLTPROC} ${XSLTPROCFLAGS} ${XSLTPROCFLAGS_HTML} -o "${BUILD_DIR}/" - --param use.id.as.filename "1" --stringparam chunker.output.encoding UTF-8 "${xslt_file}" "${CMAKE_CURRENT_SOURCE_DIR}/index.docbook" diff --git a/xsl/gnc-custom-html.xsl b/xsl/gnc-custom-html.xsl index 31ff82109..867298d41 100644 --- a/xsl/gnc-custom-html.xsl +++ b/xsl/gnc-custom-html.xsl @@ -10,10 +10,66 @@ - + +UTF-8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/zh/xsl/zh-chm.xsl b/zh/xsl/zh-chm.xsl index 2da381051..00ff3cf94 100644 --- a/zh/xsl/zh-chm.xsl +++ b/zh/xsl/zh-chm.xsl @@ -5,7 +5,7 @@ exclude-result-prefixes="#default"> - + gbk From 9e62c2e23043190ed5bd8ec7faaaefb1520bbc21 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Fri, 9 Feb 2024 21:06:43 +0100 Subject: [PATCH 04/10] docbook xsl: rename html stylesheets --- xsl/gnc-custom-html.xsl | 30 +++++++++---------- xsl/{admonitions.xsl => html-admonitions.xsl} | 0 xsl/{author.xsl => html-author.xsl} | 0 ...unk-common2.xsl => html-chunk-common2.xsl} | 0 xsl/{copyright.xsl => html-copyright.xsl} | 0 xsl/{glossary.xsl => html-glossary.xsl} | 0 xsl/{keycombo.xsl => html-keycombo.xsl} | 0 xsl/{legalnotice.xsl => html-legalnotice.xsl} | 0 xsl/{othercredit.xsl => html-othercredit.xsl} | 0 xsl/{procedure.xsl => html-procedure.xsl} | 0 xsl/{publisher.xsl => html-publisher.xsl} | 0 xsl/{releaseinfo.xsl => html-releaseinfo.xsl} | 0 xsl/{revhistory.xsl => html-revhistory.xsl} | 0 xsl/{titlepage2.xsl => html-titlepage2.xsl} | 0 xsl/{toc.xsl => html-toc.xsl} | 0 ...variablelist.xsl => html-variablelist.xsl} | 0 16 files changed, 15 insertions(+), 15 deletions(-) rename xsl/{admonitions.xsl => html-admonitions.xsl} (100%) rename xsl/{author.xsl => html-author.xsl} (100%) rename xsl/{chunk-common2.xsl => html-chunk-common2.xsl} (100%) rename xsl/{copyright.xsl => html-copyright.xsl} (100%) rename xsl/{glossary.xsl => html-glossary.xsl} (100%) rename xsl/{keycombo.xsl => html-keycombo.xsl} (100%) rename xsl/{legalnotice.xsl => html-legalnotice.xsl} (100%) rename xsl/{othercredit.xsl => html-othercredit.xsl} (100%) rename xsl/{procedure.xsl => html-procedure.xsl} (100%) rename xsl/{publisher.xsl => html-publisher.xsl} (100%) rename xsl/{releaseinfo.xsl => html-releaseinfo.xsl} (100%) rename xsl/{revhistory.xsl => html-revhistory.xsl} (100%) rename xsl/{titlepage2.xsl => html-titlepage2.xsl} (100%) rename xsl/{toc.xsl => html-toc.xsl} (100%) rename xsl/{variablelist.xsl => html-variablelist.xsl} (100%) diff --git a/xsl/gnc-custom-html.xsl b/xsl/gnc-custom-html.xsl index 867298d41..2ee51c9ef 100644 --- a/xsl/gnc-custom-html.xsl +++ b/xsl/gnc-custom-html.xsl @@ -22,52 +22,52 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/xsl/admonitions.xsl b/xsl/html-admonitions.xsl similarity index 100% rename from xsl/admonitions.xsl rename to xsl/html-admonitions.xsl diff --git a/xsl/author.xsl b/xsl/html-author.xsl similarity index 100% rename from xsl/author.xsl rename to xsl/html-author.xsl diff --git a/xsl/chunk-common2.xsl b/xsl/html-chunk-common2.xsl similarity index 100% rename from xsl/chunk-common2.xsl rename to xsl/html-chunk-common2.xsl diff --git a/xsl/copyright.xsl b/xsl/html-copyright.xsl similarity index 100% rename from xsl/copyright.xsl rename to xsl/html-copyright.xsl diff --git a/xsl/glossary.xsl b/xsl/html-glossary.xsl similarity index 100% rename from xsl/glossary.xsl rename to xsl/html-glossary.xsl diff --git a/xsl/keycombo.xsl b/xsl/html-keycombo.xsl similarity index 100% rename from xsl/keycombo.xsl rename to xsl/html-keycombo.xsl diff --git a/xsl/legalnotice.xsl b/xsl/html-legalnotice.xsl similarity index 100% rename from xsl/legalnotice.xsl rename to xsl/html-legalnotice.xsl diff --git a/xsl/othercredit.xsl b/xsl/html-othercredit.xsl similarity index 100% rename from xsl/othercredit.xsl rename to xsl/html-othercredit.xsl diff --git a/xsl/procedure.xsl b/xsl/html-procedure.xsl similarity index 100% rename from xsl/procedure.xsl rename to xsl/html-procedure.xsl diff --git a/xsl/publisher.xsl b/xsl/html-publisher.xsl similarity index 100% rename from xsl/publisher.xsl rename to xsl/html-publisher.xsl diff --git a/xsl/releaseinfo.xsl b/xsl/html-releaseinfo.xsl similarity index 100% rename from xsl/releaseinfo.xsl rename to xsl/html-releaseinfo.xsl diff --git a/xsl/revhistory.xsl b/xsl/html-revhistory.xsl similarity index 100% rename from xsl/revhistory.xsl rename to xsl/html-revhistory.xsl diff --git a/xsl/titlepage2.xsl b/xsl/html-titlepage2.xsl similarity index 100% rename from xsl/titlepage2.xsl rename to xsl/html-titlepage2.xsl diff --git a/xsl/toc.xsl b/xsl/html-toc.xsl similarity index 100% rename from xsl/toc.xsl rename to xsl/html-toc.xsl diff --git a/xsl/variablelist.xsl b/xsl/html-variablelist.xsl similarity index 100% rename from xsl/variablelist.xsl rename to xsl/html-variablelist.xsl From de881ba8a9937c3a2a3ba552f8660da57707834f Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Wed, 14 Feb 2024 17:37:29 +0100 Subject: [PATCH 05/10] docbook xsl: i18n, Convert TAB to space --- xsl/l10n.xml | 86 ++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/xsl/l10n.xml b/xsl/l10n.xml index ad9834c2f..81077b5f3 100644 --- a/xsl/l10n.xml +++ b/xsl/l10n.xml @@ -29,27 +29,27 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -72,34 +72,34 @@ - - - - - - - - + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + From 07e17cd28510f814abb00fc7a38924a240b1efb1 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Wed, 14 Feb 2024 17:44:20 +0100 Subject: [PATCH 06/10] docbook xsl: i18n, customize cross reference text (xref)... so the section number is not part of the reference text in HTML. --- xsl/gnc-custom-html.xsl | 5 +++-- xsl/l10n.xml | 29 ++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/xsl/gnc-custom-html.xsl b/xsl/gnc-custom-html.xsl index 2ee51c9ef..7f92134df 100644 --- a/xsl/gnc-custom-html.xsl +++ b/xsl/gnc-custom-html.xsl @@ -10,8 +10,9 @@ - +1 UTF-8 +0 @@ -25,7 +26,7 @@ - +1 diff --git a/xsl/l10n.xml b/xsl/l10n.xml index 81077b5f3..563e40c35 100644 --- a/xsl/l10n.xml +++ b/xsl/l10n.xml @@ -29,7 +29,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -82,9 +82,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + From 19420f5a61bf9b40dbf01fdd6b3ceba1ffeaa9c7 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Sat, 20 Jan 2024 20:30:35 +0100 Subject: [PATCH 07/10] docbook xsl: fo/pdf specific customizing add XSLT stylesheet layer for - listelements - titelpage - choose the paperformat --- cmake/AddPdfTarget.cmake | 17 +--------- xsl/fo-lists.xsl | 54 +++++++++++++++++++++++++++++++ xsl/fo-titlepage.xsl | 69 ++++++++++++++++++++++++++++++++++++++++ xsl/gnc-custom-pdf.xsl | 19 +++++++++++ zh/xsl/zh-fo.xsl | 2 +- 5 files changed, 144 insertions(+), 17 deletions(-) create mode 100644 xsl/fo-lists.xsl create mode 100644 xsl/fo-titlepage.xsl diff --git a/cmake/AddPdfTarget.cmake b/cmake/AddPdfTarget.cmake index 5025cca9c..10edcb873 100644 --- a/cmake/AddPdfTarget.cmake +++ b/cmake/AddPdfTarget.cmake @@ -6,19 +6,6 @@ function (add_pdf_target targetbase lang entities figures xslt_file) set(BUILD_DIR "${DOCDIR_BUILD}/${lang}") - # Determine paper format depending on language (which maps to the document's directory name) - # * for language "C" (fallback language) determine paper format based on current locale - # * all others use A4. - set (XSLTFLAGS_FO "--stringparam paper.type A4") - if (lang STREQUAL "C") - # For the fallback language determine paper format depending on locale - # Only US or C will be set to letter. All others use A4. - set (ENV_LANG $ENV{LANG}) - if (ENV_LANG AND ENV_LANG MATCHES ".*_us.*|C") # Replacing ENV_LANG here with if ($ENV{LANG}) won't work. - set (XSLTFLAGS_FO "--stringparam paper.type letter") - endif() - endif() - if (NOT IS_ABSOLUTE ${xslt_file}) set(xslt_file "${CMAKE_CURRENT_SOURCE_DIR}/${xslt_file}") endif() @@ -28,9 +15,7 @@ function (add_pdf_target targetbase lang entities figures xslt_file) COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}" COMMAND ${XSLTPROC} ${XSLTPROCFLAGS} ${XSLTPROCFLAGS_FO} -o "${CMAKE_CURRENT_BINARY_DIR}/${fofile}" - --stringparam fop1.extensions 1 - --stringparam variablelist.as.blocks 1 - --stringparam glosslist.as.blocks 1 + --stringparam gnc.lang ${lang} "${xslt_file}" "${CMAKE_CURRENT_SOURCE_DIR}/index.docbook" DEPENDS ${entities} "index.docbook" "${CMAKE_SOURCE_DIR}/docbook/gnc-docbookx.dtd") diff --git a/xsl/fo-lists.xsl b/xsl/fo-lists.xsl new file mode 100644 index 000000000..418594acb --- /dev/null +++ b/xsl/fo-lists.xsl @@ -0,0 +1,54 @@ + + + + + + + +1 +1 + + +1.6em + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0em + 0.0em + 0.2em + + + 0.0em + 0.0em + 0.2em + + + diff --git a/xsl/fo-titlepage.xsl b/xsl/fo-titlepage.xsl new file mode 100644 index 000000000..4fe87aa58 --- /dev/null +++ b/xsl/fo-titlepage.xsl @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + bold + 24pt + center + + + + + + + + + + + + + + 20pt + center + + + + + : + + + + + + + + 20pt + center + + + + + : + + + + + + + diff --git a/xsl/gnc-custom-pdf.xsl b/xsl/gnc-custom-pdf.xsl index f5c11a1e2..ca0859bbb 100644 --- a/xsl/gnc-custom-pdf.xsl +++ b/xsl/gnc-custom-pdf.xsl @@ -8,10 +8,29 @@ +1 +1 4 1 + +book toc,title,figure,table,example,equation + + + + + + USletter + A4 + + + + + + + + diff --git a/zh/xsl/zh-fo.xsl b/zh/xsl/zh-fo.xsl index 6b2c84d3b..fbcb5d8dd 100644 --- a/zh/xsl/zh-fo.xsl +++ b/zh/xsl/zh-fo.xsl @@ -9,7 +9,7 @@ version='1.0'> - + .5em From 617a8bdd883a04ac15c01fb4acab5efd4e9565f8 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Sat, 3 Feb 2024 14:51:36 +0100 Subject: [PATCH 08/10] docbook xsl: fo/pdf optimize admonitions - icons - spacing - font-size --- xsl/gnc-custom-pdf.xsl | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/xsl/gnc-custom-pdf.xsl b/xsl/gnc-custom-pdf.xsl index ca0859bbb..8935bca08 100644 --- a/xsl/gnc-custom-pdf.xsl +++ b/xsl/gnc-custom-pdf.xsl @@ -23,6 +23,44 @@ book toc,title,figure,table,example,equation + + + + + +../../stylesheet/ + + + + + 24pt + + + + + pt + + 0.2em + 0.0em + 0.2em + + + 0.0em + 0.0em + 0.0em + 0.4em + 0.2em + 0.4em + + + 0.6em + 0.4em + 0.8em + 0.6em + 0.4em + 0.8em + + From 848a2c6f6af20a14903206deba378d3bb0b29b74 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Sun, 21 Jan 2024 19:26:55 +0100 Subject: [PATCH 09/10] Bug 796854, Internal document links are not recognizable in PDF insert formatting in fo/pdf docbool xls stylesheet --- xsl/gnc-custom-pdf.xsl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xsl/gnc-custom-pdf.xsl b/xsl/gnc-custom-pdf.xsl index 8935bca08..72b9375b4 100644 --- a/xsl/gnc-custom-pdf.xsl +++ b/xsl/gnc-custom-pdf.xsl @@ -11,6 +11,11 @@ 1 1 4 1 + + + underline + + book toc,title,figure,table,example,equation From 003fb51f53ccbe74264c89f0b19508fb85d7d2b8 Mon Sep 17 00:00:00 2001 From: Christian Wehling Date: Wed, 31 Jan 2024 21:35:47 +0100 Subject: [PATCH 10/10] Bug 798618, Modify Docbook XSL stylesheets to control... ... the behavior of elements for FO output --- xsl/gnc-custom-pdf.xsl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xsl/gnc-custom-pdf.xsl b/xsl/gnc-custom-pdf.xsl index 72b9375b4..d7ee579e2 100644 --- a/xsl/gnc-custom-pdf.xsl +++ b/xsl/gnc-custom-pdf.xsl @@ -16,6 +16,12 @@ underline + + + 9 + +0.30em + book toc,title,figure,table,example,equation