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 016e08e966..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 '{}'.format(dobj.refname, url.replace('.', '_'), name) + return f'{name}' def to_html(text): @@ -84,6 +83,7 @@ title: ${'Namespace' if module.is_namespace else \ 'Package' if module.is_package and not module.supermodule else \ 'Module'} ${module.name} --- +import useBaseUrl from '@docusaurus/useBaseUrl'; ${module.docstring | to_html}