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

Projects
None yet
4 participants
@humitos
Member

humitos commented Aug 20, 2018

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

Related: #4544

Docs for hidding "On ..." section from versions menu
This is not a real solution, but currently is the only way of doing this.

@humitos humitos requested a review from rtfd/core Aug 20, 2018

@ericholscher

This comment has been minimized.

Show comment
Hide comment
@ericholscher

ericholscher Aug 21, 2018

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@humitos

humitos Aug 21, 2018

Member

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:

{% if github_edit_url %}
<dl>
<dt>On GitHub</dt>
<dd>
<a href="{{ github_view_url }}">View</a>
</dd>
<dd>
<a href="{{ github_edit_url }}">Edit</a>
</dd>
</dl>

Member

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:

{% if github_edit_url %}
<dl>
<dt>On GitHub</dt>
<dd>
<a href="{{ github_view_url }}">View</a>
</dd>
<dd>
<a href="{{ github_edit_url }}">Edit</a>
</dd>
</dl>

@ericholscher

This comment has been minimized.

Show comment
Hide comment
@ericholscher

ericholscher Aug 21, 2018

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@agjohnson

agjohnson Sep 5, 2018

Contributor

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

Contributor

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

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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