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

Copyright notice and symbol forces itself on your pages #828

Closed
KwestR opened this issue Oct 10, 2019 · 3 comments
Closed

Copyright notice and symbol forces itself on your pages #828

KwestR opened this issue Oct 10, 2019 · 3 comments

Comments

@KwestR
Copy link

KwestR commented Oct 10, 2019

Problem

The copyright notice automatically inserts the copyright symbol followed by the word "Copyright", and adds a period to the end of your notice. Our legal team prefers a different format for the copyright notice without that symbol, and if you don't want any copyright notice at all, there seems to be no non-CSS way to do that; neither removing the copyright line from the conf.py file nor setting it to an empty string eliminates the default copyright text from the footer.

Reproducible Project

If I specify the following in my conf.py (because that's exactly what I want my copyright statement to say):

copyright = u'Copyright (c) 2019 My Company. All rights reserved.'

I get the following at the bottom of every page:

© Copyright Copyright (c) 2019 My Company. All rights reserved..

So I need to use CSS to bypass the default copyright and replace the content using a pseudo-class selector on the contentinfo div.

Error Logs/Results

N/A

Expected Results

If the user specifies a string for the copyright in the conf.py file, use exactly what they provide, nothing more, nothing less; if they don't specify the copyright option, or especially if they set it to an empty string, leave it out entirely.

Environment Info

  • Python Version: 3.5.4
  • Sphinx Version: 1.7.4
  • RTD Theme Version: how do you find this information?
@davidfischer
Copy link
Contributor

This theme uses more or less the same logic for copyright as the base theme from Sphinx itself. I can definitely understand the use case for this although I'm not sure we want to handle the copyright variable differently in conf.py.

how do you find this information?

If you're building on Read the Docs, it should be in the build output. Otherwise, it is at the top of the theme.js file in more recent versions of the theme.

@KwestR
Copy link
Author

KwestR commented Oct 11, 2019

Thanks, David. If anyone else is looking for a workaround to this copyright issue, you can update your custom CSS with the following:

/* replace the copyright to eliminate the copyright symbol enforced by
   the ReadTheDocs theme but eschewed by our legal team */
div[role=contentinfo] {
	visibility: hidden;
	position: relative;
}

div[role=contentinfo]:after {
	visibility: visible;
	position: absolute;
	top: 0;
	left: 0;
	content: "Copyright (c) 2019 Our Company. All rights reserved.";
}

I do recommend adding a comment to the conf.py file to note that the copyright field specified there will be overridden by the CSS, so any changes, such as to update the date, should be made in the CSS.

@agjohnson
Copy link
Collaborator

As already noted, this theme follows the pattern used in other themes. You can override this with a custom layout file as well if you wanted, to avoid a CSS hack. We're unlikely to change this or note custom usage of the copyright config field in conf.py as this seems to be a rather custom change.

I'm glad you have a working solution however! Going to close this issue as there isn't much actionable for core dev team here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants