diff --git a/docs/_static/anymail-theme.css b/docs/_static/anymail-theme.css new file mode 100644 index 0000000..215cf2a --- /dev/null +++ b/docs/_static/anymail-theme.css @@ -0,0 +1,21 @@ +/* Anymail modifications to sphinx-rtd-theme styles */ + +/* List item spacing: https://github.com/rtfd/sphinx_rtd_theme/issues/590 */ +.rst-content .section ol li p:last-child, +.rst-content .section ul li p:last-child { + margin-bottom: 24px; +} + + +/* Pygments shell/console prompt: */ +.highlight .gp { + /* The RTD theme shows prompts the same color as other code. + We want to distinguish them (like most Pygments themes do). */ + color: #d14; + + /* Exclude prompt characters when copying from highlighted code. */ + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; +} diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html deleted file mode 100644 index f2fec7e..0000000 --- a/docs/_templates/layout.html +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "!layout.html" %} - -{% set script_files = script_files + ["_static/version-alert.js"] %} diff --git a/docs/conf.py b/docs/conf.py index 1809aa8..72e3052 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -145,6 +145,11 @@ html_static_path = ['_static'] # typographically correct entities. # html_use_smartypants = True +# If true, a list all whose items consist of a single paragraph and/or a +# sub-list all whose items etc… (recursive definition) will not use the

+# element for any of its items. This is standard docutils behavior. +# html_compact_lists = True + # Custom sidebar templates, maps document names to template names. # html_sidebars = {} @@ -272,6 +277,9 @@ intersphinx_mapping = { def setup(app): + app.add_stylesheet("anymail-theme.css") + app.add_javascript("version-alert.js") + # Django-specific roles, from https://github.com/django/django/blob/master/docs/_ext/djangodocs.py: app.add_crossref_type( directivename="setting", diff --git a/docs/sending/templates.rst b/docs/sending/templates.rst index bc2e771..389021a 100644 --- a/docs/sending/templates.rst +++ b/docs/sending/templates.rst @@ -118,23 +118,21 @@ To use batch sending with Anymail (for ESPs that support it): or with some ESPs you can use merge fields directly in your :class:`~django.core.mail.EmailMessage` (meaning the message itself is treated as an on-the-fly template). - * Set the message's :attr:`~AnymailMessage.merge_data` attribute to define merge field substitutions for each recipient, and optionally set :attr:`~AnymailMessage.merge_global_data` to defaults or values to use for all recipients. - * Specify all of the recipients for the batch in the message's `to` list. - .. caution:: +.. caution:: - It's critical to set the :attr:`~AnymailMessage.merge_data` attribute: - this is how Anymail recognizes the message as a batch send. + It's critical to set the :attr:`~AnymailMessage.merge_data` attribute: + this is how Anymail recognizes the message as a batch send. - When you provide merge_data, Anymail will tell the ESP to send an individual customized - message to each "to" address. Without it, you may get a single message to everyone, - exposing all of the email addresses to all recipients. - (If you don't have any per-recipient customizations, but still want individual messages, - just set merge_data to an empty dict.) + When you provide merge_data, Anymail will tell the ESP to send an individual customized + message to each "to" address. Without it, you may get a single message to everyone, + exposing all of the email addresses to all recipients. + (If you don't have any per-recipient customizations, but still want individual messages, + just set merge_data to an empty dict.) The exact syntax for merge fields varies by ESP. It might be something like `*|NAME|*` or `-name-` or `<%name%>`. (Check the notes for