Skip to content

Commit

Permalink
fix: use absolute urls for api docs #2078
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-mihok authored and mturoci committed Jul 31, 2023
1 parent 98d450a commit 1cd7df5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion py/docs/templates/text.mako
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
url = dobj.url(relative_to=module, 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 '<a title="{}" href="{}">{}</a>'.format(dobj.refname, url.replace('.', '_'), name)
return f'<a title="{dobj.refname}" href={{useBaseUrl("docs/api/{url.replace(".", "_")}")}}>{name}</a>'
def to_html(text):
Expand Down Expand Up @@ -84,6 +84,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}
Expand Down

0 comments on commit 1cd7df5

Please sign in to comment.