From c89541257f88828bc0ca6c296c79f8dc7bd04da2 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 19 Nov 2022 19:35:35 -0700 Subject: [PATCH 1/5] Allow multiline copyright. --- sphinx/themes/basic/layout.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html index 6f5a7f82362..aca57d6ad27 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -198,6 +198,11 @@

{{ _('Navigation') }}

{%- if show_copyright %} {%- if hasdoc('copyright') %} {% trans path=pathto('copyright'), copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} + {%- elif copyright is iterable and copyright is not string %} + {% for copyright_ in copyright %} + {% trans copyright=copyright_|e %}© Copyright {{ copyright_ }}.{% endtrans %} + {%- if not loop.last %}
{%- endif %} + {% endfor %} {%- else %} {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} {%- endif %} From 42c2f0745d394e613a4aabf6decdf5ca2c65969b Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Thu, 20 Apr 2023 21:43:11 -0700 Subject: [PATCH 2/5] Update CHANGES --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index da414f1e2fe..db7440a0812 100644 --- a/CHANGES +++ b/CHANGES @@ -67,6 +67,8 @@ Features added condensed rendering of ``Literal`` types. * #11165: Support the `officially recommended`_ ``.jinja`` suffix for template files. Patch by James Addison +* #10983: Support for multiline copyright statements in the footer block. Patch + by Stefanie Molin .. _officially recommended: https://jinja.palletsprojects.com/en/latest/templates/#template-file-extension From 8ac2ae5a39dc81a6275ad0097d3815aba0fa07d0 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 11 May 2023 14:54:12 +0100 Subject: [PATCH 3/5] Multi-line copyright --- sphinx/config.py | 4 ++-- sphinx/themes/basic/layout.html | 21 ++++++++++++------- tests/roots/test-copyright-multiline/conf.py | 7 +++++++ .../roots/test-copyright-multiline/index.rst | 3 +++ tests/test_config.py | 9 ++++++++ 5 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 tests/roots/test-copyright-multiline/conf.py create mode 100644 tests/roots/test-copyright-multiline/index.rst diff --git a/sphinx/config.py b/sphinx/config.py index ad7c3b56898..c412f240ced 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -89,8 +89,8 @@ class Config: # general options 'project': ('Python', 'env', []), 'author': ('unknown', 'env', []), - 'project_copyright': ('', 'html', [str]), - 'copyright': (lambda c: c.project_copyright, 'html', [str]), + 'project_copyright': ('', 'html', [str, tuple, list]), + 'copyright': (lambda c: c.project_copyright, 'html', [str, tuple, list]), 'version': ('', 'env', []), 'release': ('', 'env', []), 'today': ('', 'env', []), diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html index 5dbd2100e69..f1450eb9963 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -197,14 +197,21 @@

{{ _('Navigation') }}