Skip to content

Fix edit link for autogenerated docs#443

Merged
pawamoy merged 6 commits intomkdocstrings:masterfrom
davfsa:patch-1
Jun 26, 2022
Merged

Fix edit link for autogenerated docs#443
pawamoy merged 6 commits intomkdocstrings:masterfrom
davfsa:patch-1

Conversation

@davfsa
Copy link
Copy Markdown
Contributor

@davfsa davfsa commented Jun 14, 2022

Been going crazy about this for the last couple of hours and unable to figure out for my personal docs and saw that this behaviour was also reproducible in the repo. Eventually found it and it is caused by the use of urllib.parse.urljoin in the gen_files plugin, which misinterprets the links if they are not ended in / (@oprypin would you rather this gets fixed there instead?)

Additionally, I noticed that the edit_uri makes the edit links for the now correct links have docs/ as a base, which makes it link incorrectly, so I added a bit of a hacky fix to avoid that

An example of the now broken page links can be seen here, where clicking on edit page leads to a 404.

- https://github.com/mkdocstrings/blob/master/docs/src/mkdocstrings/extension.py
+ https://github.com/mkdocstrings/mkdocstrings/blob/master/docs/src/mkdocstrings/extension.py

EDIT: Would also like to add that both these issues can be seen across all other repositories for extensions for mkdocstrings

@davfsa davfsa requested a review from oprypin June 15, 2022 12:47
Copy link
Copy Markdown
Member

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pawamoy
Copy link
Copy Markdown
Member

pawamoy commented Jun 18, 2022

Sorry for the troublesome hours 😅 And thank you so much for investigating and fixing this!

@davfsa
Copy link
Copy Markdown
Contributor Author

davfsa commented Jun 18, 2022

Sorry for the troublesome hours 😅 And thank you so much for investigating and fixing this!

Dont worry, different timezone, so I just woke up :)

Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
Copy link
Copy Markdown
Member

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, LGTM, thanks a lot!

@pawamoy pawamoy merged commit 252b9c6 into mkdocstrings:master Jun 26, 2022
@Hnasar
Copy link
Copy Markdown

Hnasar commented Aug 24, 2022

I had to rediscover this and i was about to open a similar merge request! Can you deploy the updated docs @pawamoy ? The live site still has the old version https://mkdocstrings.github.io/recipes/

Hnasar pushed a commit to Hnasar/mkdocstrings-python that referenced this pull request Aug 24, 2022
We need to provide a relative path to go up out of the docs dir.

See
mkdocstrings/mkdocstrings#443
@pawamoy
Copy link
Copy Markdown
Member

pawamoy commented Sep 12, 2022

Thanks for the reminder, I'll deploy the new docs 🙂

pawamoy pushed a commit to mkdocstrings/python that referenced this pull request Sep 23, 2022
We need to provide a relative path to go up out of the docs dir.

See mkdocstrings/mkdocstrings#443.

Co-authored-by: Hashem Nasarat <hnasarat@beta.team>
viktorlashchuk added a commit to viktorlashchuk/mkdocstrings-python that referenced this pull request Feb 24, 2025
We need to provide a relative path to go up out of the docs dir.

See mkdocstrings/mkdocstrings#443.

Co-authored-by: Hashem Nasarat <hnasarat@beta.team>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants