From ab7245732e04c86aabc5497b279c3a28fe945836 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 17 Mar 2023 17:13:37 +0100 Subject: scripts: Patch relative links for correct doc generation In doc/help/index.asciidoc, we have links like this: * link:../quickstart{outfilesuffix}[Quick start guide] That is correct in e.g. the GitHub file structure, as those files are stored in e.g. doc/quickstart.asciidoc indeed. It's *no* longer true when we view the built files via qute://help, however: There, this turns into a flat file structure, with those pages being at qute://help/index.html and qute://help/quickstart.html, respectively. It looks like QtWebEngine < 6.5 did just ignore the and pointed from qute://help/index.html to qute://help/quickstart.html anyways, weirdly. With QtWebEngine 6.5, however, this is now interpreted as a link pointing to qute://quickstart.html instead, which is clearly wrong. Until we have a less messy doc generation (probably as part of #345), let's just patch the link to be correct. See #7624 --- scripts/asciidoc2html.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index 6f3b170af..a7816e132 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -84,12 +84,15 @@ class AsciiDoc: dst = DOC_DIR / (src.stem + ".html") files.append((src, dst)) - # patch image links to use local copy replacements = [ + # patch image links to use local copy ("https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/cheatsheet-big.png", "qute://help/img/cheatsheet-big.png"), ("https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/cheatsheet-small.png", - "qute://help/img/cheatsheet-small.png") + "qute://help/img/cheatsheet-small.png"), + + # patch relative links to work with qute://help flat structure + ("link:../", "link:"), ] asciidoc_args = ['-a', 'source-highlighter=pygments'] -- cgit v1.2.3-54-g00ecf