Skip to content

Commit

Permalink
Fix documentation links.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daphne Odekerken committed Sep 16, 2024
1 parent 4a5c27c commit 59349ed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/py_arg_visualisation/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,21 @@ def toggle_reference_modal(nr_of_clicks: int, is_open: bool, url_path: str):
if not nr_of_clicks:
return is_open, ''

if url_path[0] == '/':
url_path = url_path[1:]

reference_folder = pathlib.Path.cwd() / 'reference_texts'
if url_path == '/':
if url_path == '':
search_name = '90_pyarg.md'
else:
search_name = url_path[1:].replace('-', '_') + '.md'
search_name = url_path.replace('-', '_') + '.md'
search_file = reference_folder / search_name
if search_file.is_file():
with open(search_file, 'r') as file:
latex_explanation = file.read()
else:
latex_explanation = \
f'There was no information for this page ({url_path[1:]}) ' \
f'There was no information for this page ({url_path}) ' \
f'available.'

return not is_open, \
Expand Down

0 comments on commit 59349ed

Please sign in to comment.