summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-03-17 17:13:37 +0100
committerFlorian Bruhin <me@the-compiler.org>2023-03-17 17:44:38 +0100
commitab7245732e04c86aabc5497b279c3a28fe945836 (patch)
tree35642e55c64d3ba54fd398bf4137ff556f7804d7
parente3d5367493a2b98795ebf22b450bf25dab721b00 (diff)
downloadqutebrowser-ab7245732e04c86aabc5497b279c3a28fe945836.tar.gz
qutebrowser-ab7245732e04c86aabc5497b279c3a28fe945836.zip
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 <a href="../quicktart.html"> 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
-rwxr-xr-xscripts/asciidoc2html.py7
1 files 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']