Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to the docdir of the remote repo in non-rtd themes for mkdocs #5513

merged 4 commits into from Mar 21, 2019


Copy link

@stsewd stsewd commented Mar 20, 2019

Currently we depend on
which is only available in the rtd theme.

For non-rtd themes we are generating a link like

I'm proposing the solution of just linking to the docsdir

Another option is just to link to the repo, and only show the view on link :)

What do you think?

Also, looks like we can refactor this code, let me know if you feel like something that can be done here or we can create an issue later.

@@ -360,6 +358,10 @@ def get_github_url(
return ''
repo = repo.rstrip('/')

if not filename:
filename = ''
Copy link
Member Author

@stsewd stsewd Mar 20, 2019

We can receive filename as None or empty string, I can search for all the calls and make sure we always receive a string.

Copy link
Member Author

@stsewd stsewd Mar 20, 2019

I'm going to do that actually, we only use this in the footer api I think

Copy link

@ericholscher ericholscher commented Mar 20, 2019

I'm proposing the solution of just linking to the docsdir

Seems reasonable 👍

readthedocs/restapi/views/ Outdated Show resolved Hide resolved
readthedocs/builds/ Show resolved Hide resolved
stsewd and others added 2 commits Mar 20, 2019
Co-Authored-By: stsewd <>
@stsewd stsewd merged commit 50cb9a2 into readthedocs:master Mar 21, 2019
1 check passed
@stsewd stsewd deleted the fix-mkdocs-view-links branch Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants