Skip to content

Commit

Permalink
Merge branch 'master' into sphinx-build-man-add-color-no-color
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Jul 20, 2023
2 parents 22553d1 + cc78e2a commit e3bfe1a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
10 changes: 6 additions & 4 deletions doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ How do I...
For many more extensions and other contributed stuff, see the sphinx-contrib_
repository.

.. _sphinx-contrib: https://bitbucket.org/birkenfeld/sphinx-contrib/
.. _sphinx-contrib: https://github.com/sphinx-contrib/

.. _usingwith:

Expand All @@ -63,7 +63,8 @@ Doxygen

SCons
Glenn Hutchings has written a SCons build script to build Sphinx
documentation; it is hosted here: https://bitbucket.org/zondo/sphinx-scons
documentation; it is hosted here:
https://bitbucket-archive.softwareheritage.org/projects/zo/zondo/sphinx-scons.html

PyPI
Jannis Leidel wrote a `setuptools command
Expand All @@ -77,8 +78,9 @@ GitHub Pages
GitHub Pages on building HTML document automatically.

MediaWiki
See https://bitbucket.org/kevindunn/sphinx-wiki/wiki/Home, a project by
Kevin Dunn.
See `sphinx-wiki`_, a project by Kevin Dunn.

.. _sphinx-wiki: https://bitbucket-archive.softwareheritage.org/projects/ke/kevindunn/sphinx-wiki.html

Google Analytics
You can use a custom ``layout.html`` template, like this:
Expand Down
2 changes: 1 addition & 1 deletion doc/usage/restructuredtext/domains.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2179,5 +2179,5 @@ Jinja_, Operation_, and Scala_.
.. _MATLAB: https://pypi.org/project/sphinxcontrib-matlabdomain/
.. _Operation: https://pypi.org/project/sphinxcontrib-operationdomain/
.. _PHP: https://pypi.org/project/sphinxcontrib-phpdomain/
.. _Ruby: https://bitbucket.org/birkenfeld/sphinx-contrib/src/default/rubydomain
.. _Ruby: https://github.com/sphinx-contrib/rubydomain
.. _Scala: https://pypi.org/project/sphinxcontrib-scaladomain/
6 changes: 3 additions & 3 deletions sphinx/builders/_epub_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
'.svg': 'image/svg+xml',
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.otf': 'application/x-font-otf',
'.ttf': 'application/x-font-ttf',
'.woff': 'application/font-woff',
'.otf': 'font/otf',
'.ttf': 'font/ttf',
'.woff': 'font/woff',
}

VECTOR_GRAPHICS_EXTENSIONS = ('.svg',)
Expand Down
8 changes: 5 additions & 3 deletions sphinx/builders/gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from codecs import open
from collections import defaultdict
from datetime import datetime, timedelta, tzinfo
from datetime import datetime, timedelta, timezone, tzinfo
from os import getenv, path, walk
from time import time
from typing import Any, Generator, Iterable
Expand Down Expand Up @@ -163,8 +163,10 @@ def write_doc(self, docname: str, doctree: nodes.document) -> None:

# determine tzoffset once to remain unaffected by DST change during build
timestamp = time()
tzdelta = datetime.fromtimestamp(timestamp) - \
datetime.utcfromtimestamp(timestamp)
local_time = datetime.fromtimestamp(timestamp)
utc_time = datetime.fromtimestamp(timestamp, tz=timezone.utc)
tzdelta = local_time - utc_time.replace(tzinfo=None)

# set timestamp from SOURCE_DATE_EPOCH if set
# see https://reproducible-builds.org/specs/source-date-epoch/
source_date_epoch = getenv('SOURCE_DATE_EPOCH')
Expand Down
4 changes: 2 additions & 2 deletions sphinx/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def create_publisher(app: Sphinx, filetype: str) -> Publisher:
defaults = {"traceback": True, **app.env.settings}
# Set default settings
if docutils.__version_info__[:2] >= (0, 19):
pub.get_settings(**defaults) # type: ignore[arg-type]
pub.get_settings(**defaults)
else:
pub.settings = pub.setup_option_parser(**defaults).get_default_values() # type: ignore
pub.settings = pub.setup_option_parser(**defaults).get_default_values()
return pub
9 changes: 9 additions & 0 deletions sphinx/writers/html5.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,3 +887,12 @@ def depart_math_block(self, node: Element, math_env: str = '') -> None:
_, depart = self.builder.app.registry.html_block_math_renderers[name]
if depart: # type: ignore[truthy-function]
depart(self, node)

# See Docutils r9413
# Re-instate the footnote-reference class
def visit_footnote_reference(self, node):
href = '#' + node['refid']
classes = ['footnote-reference', self.settings.footnote_references]
self.body.append(self.starttag(node, 'a', suffix='', classes=classes,
role='doc-noteref', href=href))
self.body.append('<span class="fn-bracket">[</span>')

0 comments on commit e3bfe1a

Please sign in to comment.