Skip to content

Commit

Permalink
chore: fix broken links for other than h2o_wave package #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 1cd7df5 commit 744f5b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion py/docs/templates/config.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions py/docs/templates/text.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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'<a title="{dobj.refname}" href={{useBaseUrl("docs/api/{url.replace(".", "_")}")}}>{name}</a>'
return f'<a title="{dobj.refname}" href={{useBaseUrl("{url.replace("h2o_wave/", "").replace(".", "_")}")}}>{name}</a>'
def to_html(text):
Expand Down

0 comments on commit 744f5b3

Please sign in to comment.