%(body_suffix)s
diff --git a/docs/_static/anymail-theme.css b/docs/_static/anymail-theme.css
index 40c27d6..2c12c9a 100644
--- a/docs/_static/anymail-theme.css
+++ b/docs/_static/anymail-theme.css
@@ -1,31 +1,9 @@
/* Anymail modifications to sphinx-rtd-theme styles */
-/* List item spacing: https://github.com/rtfd/sphinx_rtd_theme/issues/590 */
-/* Regression: https://github.com/rtfd/sphinx_rtd_theme/issues/705 */
-.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;
-}
-
/* Sticky table first column (used for ESP feature matrix) */
table.sticky-left td:first-of-type,
table.sticky-left th:first-of-type {
- position: -webkit-sticky; /* Safari */
position: sticky;
left: 0;
background-color: #fcfcfc; /* override transparent from .wy-table td */
@@ -36,7 +14,6 @@ table.sticky-left th:first-of-type[colspan] > p {
since those always wrap a rubric
(in the specific table that uses this),
just make the
sticky within the
. */
display: inline-block;
- position: -webkit-sticky; /* Safari */
position: sticky;
left: 17px; /* (.wy-table $table-padding-size) + (docutils border="1" in html) */
}
@@ -57,12 +34,12 @@ table.sticky-left th:first-of-type[colspan] > p {
https://github.com/rtfd/sphinx_rtd_theme/issues/92
*/
.rst-content a code.xref {
- color: #2980B9;
- font-weight: inherit;
+ color: inherit;
+ /*font-weight: inherit;*/
}
.rst-content a:hover code.xref {
- color: #3091d1;
+ color: inherit;
}
.rst-content a:visited code.xref {
- color: #9B59B6;
+ color: inherit;
}
diff --git a/docs/_static/version-alert.js b/docs/_static/version-alert.js
index 6183307..0c98bc1 100644
--- a/docs/_static/version-alert.js
+++ b/docs/_static/version-alert.js
@@ -27,4 +27,8 @@ function warnOnLatestVersion() {
parent.insertBefore(warning, parent.firstChild);
}
-document.addEventListener('DOMContentLoaded', warnOnLatestVersion);
+if (document.readyState === 'loading') {
+ document.addEventListener('DOMContentLoaded', warnOnLatestVersion);
+} else {
+ warnOnLatestVersion();
+}
diff --git a/docs/conf.py b/docs/conf.py
index 19f2d80..9304c37 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -11,20 +11,25 @@
import os
import sys
-on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+from pathlib import Path
+
+ON_READTHEDOCS = os.environ.get('READTHEDOCS', None) == 'True'
+DOCS_PATH = Path(__file__).parent
+PROJECT_ROOT_PATH = DOCS_PATH.parent
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('..'))
+sys.path.insert(0, PROJECT_ROOT_PATH.resolve())
# define __version__ and __minor_version__ from ../anymail/_version.py,
# but without importing from anymail (which would make docs dependent on Django, etc.)
__version__ = "UNSET"
__minor_version__ = "UNSET"
-with open("../anymail/_version.py") as f:
- code = compile(f.read(), "../anymail/_version.py", 'exec')
- exec(code)
+version_path = PROJECT_ROOT_PATH / "anymail/_version.py"
+code = compile(version_path.read_text(), version_path, 'exec')
+exec(code)
+
# -- General configuration -----------------------------------------------------
@@ -50,7 +55,7 @@ master_doc = 'index'
# General information about the project.
project = 'Anymail'
# noinspection PyShadowingBuiltins
-copyright = 'Anymail contributors (see AUTHORS.txt)'
+copyright = 'Anymail contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -100,11 +105,11 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-if not on_rtd: # only import and set the theme if we're building docs locally
+if not ON_READTHEDOCS: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme # this seems to come with sphinx; if not, pip install it
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
-# if on_rtd, readthedocs.org uses their theme by default (and specifying it here breaks them)
+# else readthedocs.org uses their theme by default (and specifying it here breaks them)
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -202,7 +207,7 @@ latex_elements = {
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Anymail.tex', 'Anymail Documentation',
- 'Anymail contributors (see AUTHORS.txt)', 'manual'),
+ 'Anymail contributors', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -232,7 +237,7 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'anymail', 'Anymail Documentation',
- ['Anymail contributors (see AUTHORS.txt)'], 1)
+ ['Anymail contributors'], 1)
]
# If true, show URL addresses after external links.
@@ -246,7 +251,7 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Anymail', 'Anymail Documentation',
- 'Anymail contributors (see AUTHORS.txt)', 'Anymail', 'Multi-ESP transactional email for Django.',
+ 'Anymail contributors', 'Anymail', 'Multi-ESP transactional email for Django.',
'Miscellaneous'),
]
@@ -275,10 +280,13 @@ intersphinx_mapping = {
def setup(app):
- app.add_stylesheet("anymail-theme.css")
- app.add_javascript("anymail-config.js")
- app.add_javascript("version-alert.js")
- app.add_javascript("https://unpkg.com/rate-the-docs")
+ app.add_css_file("anymail-theme.css")
+ # Inline