diff options
author | Antonio Rojas <arojas@archlinux.org> | 2021-05-17 14:31:50 +0000 |
---|---|---|
committer | Christophe Giboudeaux <christophe@krop.fr> | 2021-05-17 14:31:50 +0000 |
commit | 001f901ee297bb5346729a02e8920b7528e20717 (patch) | |
tree | e1778fc4e7626c162dfbf34ecc67c9a5311886b4 /docs | |
parent | 63479ef093c7dc0e23281ecb957d526943565eaf (diff) | |
download | extra-cmake-modules-001f901ee297bb5346729a02e8920b7528e20717.tar.gz extra-cmake-modules-001f901ee297bb5346729a02e8920b7528e20717.tar.bz2 |
Fix doc build with Sphinx 4
Diffstat (limited to 'docs')
-rw-r--r-- | docs/CMakeLists.txt | 1 | ||||
-rw-r--r-- | docs/sphinx/ext/ecm.py | 13 |
2 files changed, 9 insertions, 5 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 84cca9ea..ca15c002 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -84,6 +84,7 @@ foreach(format ${doc_formats}) OUTPUT ${doc_format_output} COMMAND Sphinx::Build + -D man_make_section_directory=0 -c ${CMAKE_CURRENT_BINARY_DIR} -d ${CMAKE_CURRENT_BINARY_DIR}/doctrees -b ${format} diff --git a/docs/sphinx/ext/ecm.py b/docs/sphinx/ext/ecm.py index 8667b367..a09e4890 100644 --- a/docs/sphinx/ext/ecm.py +++ b/docs/sphinx/ext/ecm.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: BSD-3-Clause +import html import os import re @@ -19,8 +20,11 @@ CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)', # Monkey patch for sphinx generating invalid content for qcollectiongenerator # https://bitbucket.org/birkenfeld/sphinx/issue/1435/qthelp-builder-should-htmlescape-keywords -from sphinx.util.pycompat import htmlescape -from sphinx.builders.qthelp import QtHelpBuilder +try: + from sphinxcontrib.qthelp import QtHelpBuilder +except ImportError: + # sphinx < 4.0 + from sphinx.builders.qthelp import QtHelpBuilder old_build_keywords = QtHelpBuilder.build_keywords def new_build_keywords(self, title, refs, subitems): old_items = old_build_keywords(self, title, refs, subitems) @@ -29,13 +33,12 @@ def new_build_keywords(self, title, refs, subitems): before, rest = item.split("ref=\"", 1) ref, after = rest.split("\"") if ("<" in ref and ">" in ref): - new_items.append(before + "ref=\"" + htmlescape(ref) + "\"" + after) + new_items.append(before + "ref=\"" + html.escape(ref) + "\"" + after) else: new_items.append(item) return new_items QtHelpBuilder.build_keywords = new_build_keywords - from docutils.parsers.rst import Directive, directives from docutils.transforms import Transform try: @@ -127,7 +130,7 @@ class _ecm_index_entry: self.desc = desc def __call__(self, title, targetid): - return ('pair', u'%s ; %s' % (self.desc, title), targetid, 'main') + return ('pair', u'%s ; %s' % (self.desc, title), targetid, 'main', None) _ecm_index_objs = { 'manual': _ecm_index_entry('manual'), |