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
merged 4 commits into from Mar 21, 2019

Conversation

@stsewd
Copy link
Member

@stsewd stsewd commented Mar 20, 2019

Currently we depend on
https://github.com/mkdocs/mkdocs/blob/d101522aa197aaa212f1424180d693dd5d497875/mkdocs/themes/readthedocs/base.html#L35-L40
which is only available in the rtd theme.

For non-rtd themes we are generating a link like https://github.com/mkdocs/mkdocs/blob/master/docs/.md

I'm proposing the solution of just linking to the docsdir https://github.com/mkdocs/mkdocs/blob/master/docs/

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

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Mar 20, 2019

I'm proposing the solution of just linking to the docsdir https://github.com/mkdocs/mkdocs/blob/master/docs/

Seems reasonable 👍

readthedocs/restapi/views/footer_views.py Outdated Show resolved Hide resolved
readthedocs/builds/models.py Show resolved Hide resolved
stsewd and others added 2 commits Mar 20, 2019
Co-Authored-By: stsewd <santos_g@outlook.com>
@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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants