From c6c5943f37ef118978d450217e212ac167881969 Mon Sep 17 00:00:00 2001 From: Marek Mihok Date: Fri, 21 Jul 2023 16:01:29 +0200 Subject: [PATCH] chore: fix broken links for other than h2o_wave package #2078 --- py/docs/templates/config.mako | 2 +- py/docs/templates/text.mako | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/py/docs/templates/config.mako b/py/docs/templates/config.mako index c7fa88da81..34eafd8ba9 100644 --- a/py/docs/templates/config.mako +++ b/py/docs/templates/config.mako @@ -28,7 +28,7 @@ # A prefix to use for every HTML hyperlink in the generated documentation. # No prefix results in all links being relative. - link_prefix = '' + link_prefix = 'docs/api/' # Enable syntax highlighting for code/source blocks by including Highlight.js syntax_highlighting = False diff --git a/py/docs/templates/text.mako b/py/docs/templates/text.mako index 40d25163be..a0025cfee4 100644 --- a/py/docs/templates/text.mako +++ b/py/docs/templates/text.mako @@ -9,10 +9,9 @@ name = name or dobj.qualname + ('()' if isinstance(dobj, pdoc.Function) else '') if isinstance(dobj, pdoc.External) and not external_links: return name - url = dobj.url(relative_to=module, link_prefix=link_prefix, - top_ancestor=not show_inherited_members).replace('.html','') + url = dobj.url(link_prefix=link_prefix, top_ancestor=not show_inherited_members).replace('.html','') ## Replace "." with "_" because Docusarus doesn't seem to like "." in custom heading ids. - return f'{name}' + return f'{name}' def to_html(text):