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

Docs for hidding "On ..." section from versions menu #4547

Merged
merged 1 commit into from Sep 5, 2018

Conversation

@humitos
Copy link
Member

@humitos humitos commented Aug 20, 2018

This is not a real solution, but currently this is the only way of doing this.

Related: #4544

This is not a real solution, but currently is the only way of doing this.
@humitos humitos requested a review from Aug 20, 2018
@ericholscher
Copy link
Member

@ericholscher ericholscher commented Aug 21, 2018

Hmm. What exactly is the use case for hiding this? Is it broken, or people just don't want to promote the fact that their docs are on GitHub? Feels like the theme could include this CSS optionally based on the pre-existing GH edit link settings, as a somewhat similarly hacky solution, but more maintainable going forward.

@humitos
Copy link
Member Author

@humitos humitos commented Aug 21, 2018

Hmm. What exactly is the use case for hiding this?

This is something more useful for the corporate site. The use case is when the documentation is public but the repository is private. In this case, these links are useless and may confuse the readers.

Is it broken, or people just don't want to promote the fact that their docs are on GitHub?

People just don't want them to show because the repo is private.

Feels like the theme could include this CSS optionally based on the pre-existing GH edit link settings, as a somewhat similarly hacky solution, but more maintainable going forward.

I didn't find any setting for hiding this links using a theme config (https://github.com/rtfd/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/theme.conf). Also, we do have a guide to overwrite the template and hide the top-right links also in a hacky way: https://docs.readthedocs.io/en/latest/guides/remove-edit-buttons.html

If we are going to add a theme config we should manage both things with the same setting.

On the other hand, I'm not sure I like to add this in the theme itself since this is more a Read the Docs thing because the theme doesn't generate/add the "On GitHub" link in the versions menu. It only adds "On Read the Docs": https://github.com/rtfd/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/versions.html#L23. The section "On GitHub" comes from the footer API call: https://github.com/rtfd/readthedocs.org/blob/07f024a9ea8af830c330ff96f40e634722a7b136/readthedocs/restapi/templates/restapi/footer.html#L79-L88

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Aug 21, 2018

We have a setting for it, but I guess it isn't documented: https://github.com/rtfd/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/breadcrumbs.html#L40

The idea would be to have a conf.py option that says display_github that takes into account both places where we use it. It would need to either add CSS to the docs pages, or add a variable to the footer_api call.

@agjohnson
Copy link
Contributor

@agjohnson agjohnson commented Sep 5, 2018

I think this looks okay for now, it probably helps to just have something available. I agree we should have a better answer for this though.

Merging for now, we can revisit with some better ideas later

@agjohnson agjohnson merged commit 15ded29 into master Sep 5, 2018
1 check passed
@agjohnson agjohnson deleted the humitos/docs/hide-on-link-with-css branch Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants