Skip to content

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

Merged
agjohnson merged 1 commit into
masterfrom
humitos/docs/hide-on-link-with-css
Sep 5, 2018
Merged

Docs for hidding "On ..." section from versions menu#4547
agjohnson merged 1 commit into
masterfrom
humitos/docs/hide-on-link-with-css

Conversation

@humitos

@humitos humitos commented Aug 20, 2018

Copy link
Copy Markdown
Member

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 a team August 20, 2018 20:51
@ericholscher

Copy link
Copy Markdown
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.

@humitos

humitos commented Aug 21, 2018

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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.

@RichardLitt RichardLitt added the Needed: documentation Documentation is required label Aug 27, 2018
@agjohnson

Copy link
Copy Markdown
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

@agjohnson agjohnson merged commit 15ded29 into master Sep 5, 2018
@agjohnson agjohnson deleted the humitos/docs/hide-on-link-with-css branch September 5, 2018 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needed: documentation Documentation is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants