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
This commit is contained in:
Florian Bruhin 2023-03-17 17:13:37 +01:00
parent e3d5367493
commit ab7245732e
1 changed files with 5 additions and 2 deletions

View File

@ -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']