diff --git a/CHANGES b/CHANGES index 07bc8157ef1..bbea8709bcf 100644 --- a/CHANGES +++ b/CHANGES @@ -33,6 +33,8 @@ Features added This behaviour may also be controlled by options on object description directives, for example :rst:dir:`py:function:single-line-parameter-list`. Patch by Thomas Louf, Adam Turner, and Jean-François Burnol. +* #10983: Support for multiline copyright statements in the footer block. + Patch by Stefanie Molin Bugs fixed ---------- diff --git a/doc/_themes/sphinx13/layout.html b/doc/_themes/sphinx13/layout.html index 8010517a69a..86a794306b9 100644 --- a/doc/_themes/sphinx13/layout.html +++ b/doc/_themes/sphinx13/layout.html @@ -54,7 +54,7 @@

{{ _('Site navigation') }}

{%- block footer %} {%- endblock %} diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst index 1fc4c674b4c..133e2099df9 100644 --- a/doc/usage/configuration.rst +++ b/doc/usage/configuration.rst @@ -73,6 +73,10 @@ Project information A copyright statement in the style ``'2008, Author Name'``. + .. versionchanged:: 7.1 + The value may now be a sequence of copyright statements in the above form, + which will be displayed each to their own line. + .. confval:: project_copyright An alias of :confval:`copyright`. diff --git a/sphinx/config.py b/sphinx/config.py index a4e66193493..b8cf1eda2ca 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 f3088f79a95..79eb02de8ec 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -183,14 +183,30 @@

{{ _('Navigation') }}

{%- block relbar2 %}{{ relbar() }}{% endblock %} +{%- macro copyright_block() %} + {%- if hasdoc('copyright') %} + {%- set copyright_prefix = '' + _('Copyright') + '' -%} + {%- else %} + {%- set copyright_prefix = _('Copyright') %} + {%- endif %} + {%- if copyright is iterable and copyright is not string %} + {% for copyright_line in copyright %} + {% trans trimmed copyright_prefix=copyright_prefix, copyright=copyright_line|e %} + © {{ copyright_prefix }} {{ copyright }}. + {% endtrans %} + {%- if not loop.last %}
{%- endif %} + {% endfor %} + {%- else %} + {% trans trimmed copyright_prefix=copyright_prefix, copyright=copyright|e %} + © {{ copyright_prefix }} {{ copyright }}. + {% endtrans %} + {%- endif %} +{%- endmacro %} + {%- block footer %}