diff options
author | Gerald Combs <gerald@wireshark.org> | 2019-11-08 05:23:32 -0800 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2019-11-08 20:27:15 +0000 |
commit | 71996e8d93b82ad25105f691d001188b5972d922 (patch) | |
tree | 120932a72bd395a036bb1b3ed406302b1153a2b1 | |
parent | bf5d699cf07f7dfd0ff42bec13c66199b48cffed (diff) |
CMake+docbook: Fixup our .chm titles.
Some parts of HTML Help have issues displaying curly quotes. Add a
title argument to the XML2HHP macro so that we can set one with a
straight quote. Set the title using the htmlhelp.title XSL parameter
instead of relying on HTML Help to derive it for us. This seems to keep
"???TITLE???" from being mysteriously appended to the title.
Try setting htmlhelp.window.geometry while we're here.
Bug: 16183
Change-Id: I0bf2dbeeb811dc65010ab5223725d6b5cdc96966
Reviewed-on: https://code.wireshark.org/review/35031
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
-rw-r--r-- | cmake/modules/FindXSLTPROC.cmake | 14 | ||||
-rw-r--r-- | docbook/CMakeLists.txt | 4 | ||||
-rw-r--r-- | docbook/custom_layer_chm.xsl | 6 |
3 files changed, 10 insertions, 14 deletions
diff --git a/cmake/modules/FindXSLTPROC.cmake b/cmake/modules/FindXSLTPROC.cmake index e2a5d3fd8d..adf9a6a713 100644 --- a/cmake/modules/FindXSLTPROC.cmake +++ b/cmake/modules/FindXSLTPROC.cmake @@ -151,7 +151,7 @@ ENDMACRO(XML2HTML) # wsug or wsdg # user-guide.xml or developer-guide.xml #) -MACRO(XML2HHP _target_dep _guide _dbk_source) +MACRO(XML2HHP _target_dep _guide _title _dbk_source) # We depend on the docbook target to avoid parallel builds. SET(_dbk_dep ${_target_dep}_docbook) GET_FILENAME_COMPONENT( _source_base_name ${_dbk_source} NAME_WE ) @@ -174,16 +174,16 @@ MACRO(XML2HHP _target_dep _guide _dbk_source) # Dumb down our title. HTML Help can render most of our content # correctly because we tell it to use the IE9 rendering engine in # custom_layer_chm.xsl. However, this doesn't apply to the window - # title. Neither "’", "'", nor "’" will render correctly, so - # just remove everything between "Developer", "User", and their - # respective trailing "s"es. + # title or TOC. Neither "’" nor "’" will render correctly, + # so just add a _title argument and set it in CMakeLists.txt. COMMAND ${PERL_EXECUTABLE} -p - -e "s|er.*s Guide</title>|ers Guide</title>|" - < ${_dbk_source} - > ${_docbook_plain_title} + -e "s|<title>Wireshark.*s Guide</title>|<title>${_title}</title>|" + < ${_dbk_source} + > ${_docbook_plain_title} COMMAND ${XSLTPROC_EXECUTABLE} --path "${_xsltproc_path}" --stringparam base.dir ${_basedir}/ + --stringparam htmlhelp.title ${_title} --stringparam htmlhelp.chm ${_output_chm} --stringparam htmlhelp.hhp ${_output_hhp} --stringparam htmlhelp.hhc ${_output_toc_hhc} diff --git a/docbook/CMakeLists.txt b/docbook/CMakeLists.txt index 2742ce5b2b..d93fad6750 100644 --- a/docbook/CMakeLists.txt +++ b/docbook/CMakeLists.txt @@ -427,7 +427,7 @@ if(ASCIIDOCTOR_FOUND AND ASCIIDOCTOR_PDF_EXECUTABLE) endif() if(WIN32 AND ASCIIDOCTOR_FOUND) - XML2HHP(user_guide wsug user-guide.xml) + XML2HHP(user_guide wsug "Wireshark User's Guide" user-guide.xml) HHP2CHM(user-guide.hhp) add_custom_target( user_guide_chm @@ -479,7 +479,7 @@ if(ASCIIDOCTOR_FOUND AND ASCIIDOCTOR_PDF_EXECUTABLE) endif() if(WIN32 AND ASCIIDOCTOR_FOUND) - XML2HHP(developer_guide wsdg developer-guide.xml) + XML2HHP(developer_guide wsdg "Wireshark Developer's Guide" developer-guide.xml) HHP2CHM(developer-guide.hhp) add_custom_target( developer_guide_chm diff --git a/docbook/custom_layer_chm.xsl b/docbook/custom_layer_chm.xsl index 47029d3d6e..74c053eb37 100644 --- a/docbook/custom_layer_chm.xsl +++ b/docbook/custom_layer_chm.xsl @@ -7,11 +7,7 @@ <!-- import the main stylesheet --> <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl"/> -<!-- use graphics for admons (note, tip, ...) -<xsl:param name="admon.graphics" select="1"/> -<xsl:param name="admon.graphics.path">common_graphics/</xsl:param> -<xsl:param name="admon.graphics.extension" select="'.svg'"/> ---> +<xsl:param name="htmlhelp.window.geometry">[160,100,950,750]</xsl:param> <!-- Tell the WebBrowser control to use the IE9 rendering engine if present so |