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

Support sequence of copyright statements #224

Open
momostein opened this issue Oct 25, 2024 · 3 comments
Open

Support sequence of copyright statements #224

momostein opened this issue Oct 25, 2024 · 3 comments
Labels

Comments

@momostein
Copy link

According to the Sphinx documentation, Sphinx supports a sequence of strings for the copyright or project_copyright configuration values.

Right now, if you use a sequence of multiple copyright values:

copyright = [
    "2022, Jane Doe",
    "2024, Alice Bobson",
]

Expected

This should result in two different copyright notices on two lines:

© Copyright 2022, Jane Doe
© Copyright 2024, Alice Bobson

Actual

Instead, the list is converted to a string and displayed as a single copyright notice:

© Copyright ['2022, Jane Doe', '2024, Alice Bobson']

The classic sphinx theme still does this correctly.

@AA-Turner
Copy link
Member

Please provide a reproducible example, per the request in the bug report template. Importantly, which theme are you using?

A

@AA-Turner AA-Turner added the bug label Oct 25, 2024
@momostein
Copy link
Author

I was using the alabaster template.
To reproduce this bug, you can simply use this repository's documentation but change one thing in the docs/conf.py file:

# Theme used
html_theme = "alabaster"

# Change:
# copyright = f"{datetime.now().year}, the Sphinx developers"
# to
copyright = [
    f"{datetime.now().year}, the Sphinx developers",
    f"{datetime.now().year}, Jane Doe",
]

This will result in the following copyright notice in the footer:

© Copyright ['2024, the Sphinx developers', '2024, Jane Doe']

but if you use the the default classic theme:

# Theme used
html_theme = "classic"

copyright = [
    f"{datetime.now().year}, the Sphinx developers",
    f"{datetime.now().year}, Jane Doe",
]

# Disable html sidebars and theme options
# html_sidebars = {
#     "**": [
#         "about.html",
#         "searchfield.html",
#         "navigation.html",
#         "relations.html",
#         "donate.html",
#     ]
# }
# html_theme_options = {
#     "description": "A light, configurable Sphinx theme",
#     "github_user": "sphinx-doc",
#     "github_repo": "alabaster",
#     "fixed_sidebar": True,
#     "tidelift_url": "https://tidelift.com/subscription/pkg/pypi-alabaster?utm_source=pypi-alabaster&utm_medium=referral&utm_campaign=docs",  # noqa
#     "github_banner": True,
# }

that theme properly separates them.

This is because the classic inherits its footer from the basic theme which uses the copyright_block() macro.

Note that this will still look pretty wonky in my opinion because they use line breaks as separators between the copyright notices. Then the rest of the footer just goes on the same line as the last copyright notice:

© Copyright 2024, the Sphinx developers.
© Copyright 2024, Jane Doe. Created using [Sphinx](https://www.sphinx-doc.org/) 8.1.3.

@momostein
Copy link
Author

Might I suggest a fix where we separate the copyright notice with pipes "|" instead? The result would look something like this:

© Copyright 2024, the Sphinx developers. | © Copyright 2024, Jane Doe. | Created using [Sphinx](https://www.sphinx-doc.org/) 8.1.3.

I have made a pull request #225 that implements this solution:

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

No branches or pull requests

2 participants