Skip to content

Commit d30637f

Browse files
authored
Use shortened links for issues in docs (#56)
We can now link to issues in the docs by writing :issue:`#<issue_number>`, which is very nice and convenient for release notes. Courtesy of Simon Willison finding and writing this up at: https://til.simonwillison.net/sphinx/sphinx-ext-extlinks
1 parent f391dc2 commit d30637f

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

docs/source/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
extensions = [
4141
'sphinx.ext.autodoc',
4242
'sphinx.ext.autosummary',
43+
'sphinx.ext.extlinks',
4344
'sphinx.ext.githubpages',
4445
'sphinx.ext.intersphinx',
4546
'sphinx.ext.mathjax',
@@ -63,6 +64,11 @@
6364
# This pattern also affects html_static_path and html_extra_path.
6465
exclude_patterns = []
6566

67+
# Set up link shortcuts
68+
extlinks = {
69+
'issue': ('https://github.com/edgi-govdata-archiving/web-monitoring-diff/issues/%s', '#'),
70+
}
71+
6672
# Example configuration for intersphinx: refer to the Python standard library.
6773
intersphinx_mapping = {
6874
'python': ('https://docs.python.org/3/', None),

docs/source/release-history.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ Release History
55
Version 0.1.2rc1 (2021-01-01)
66
-----------------------------
77

8-
- The server uses a pool of child processes to run diffs. If the pool breaks while running a diff, it will be re-created once, and, if it fails again, the server will now crash with an exit code of ``10``. (An external process manager like Supervisor, Kubernetes, etc. can then decide how to handle the situation.) Previously, the diff would fail at this point, but server would try to re-create the process pool again the next time a diff was requested. You can opt-in to the old behavior by setting the ``RESTART_BROKEN_DIFFER`` environment variable to ``true``. (`#49 <https://github.com/edgi-govdata-archiving/web-monitoring-diff/issues/49>`_)
8+
- The server uses a pool of child processes to run diffs. If the pool breaks while running a diff, it will be re-created once, and, if it fails again, the server will now crash with an exit code of ``10``. (An external process manager like Supervisor, Kubernetes, etc. can then decide how to handle the situation.) Previously, the diff would fail at this point, but server would try to re-create the process pool again the next time a diff was requested. You can opt-in to the old behavior by setting the ``RESTART_BROKEN_DIFFER`` environment variable to ``true``. (:issue:`49`)
99

1010

1111
Version 0.1.1 (2020-11-24)
1212
--------------------------
1313

1414
This is a bugfix release that focuses on :func:`web_monitoring_diff.html_diff_render` and the server.
1515

16-
- Fix an issue where the diffing server could reset the process pool that manages the actual diffs multiple times unnecessarily, leading to wasted memory and CPU. If you are tracking logs and errors, this will also make error messages about the diffing server clearer — you’ll see “BrokenProcessPool” instead of “'NoneType' object does not support item assignment.” (`#38 <https://github.com/edgi-govdata-archiving/web-monitoring-diff/issues/38>`_)
16+
- Fix an issue where the diffing server could reset the process pool that manages the actual diffs multiple times unnecessarily, leading to wasted memory and CPU. If you are tracking logs and errors, this will also make error messages about the diffing server clearer — you’ll see “BrokenProcessPool” instead of “'NoneType' object does not support item assignment.” (:issue:`38`)
1717

18-
- Ensure the server shuts down gracefully when pressing ctrl+c or sending a SIGINT signal. (`#44 <https://github.com/edgi-govdata-archiving/web-monitoring-diff/issues/44>`_)
18+
- Ensure the server shuts down gracefully when pressing ctrl+c or sending a SIGINT signal. (:issue:`44`)
1919

20-
- Fix :func:`web_monitoring_diff.html_diff_render` to make sure the spacing of text and tags in the HTML source code of the diff matches the original. This resolves display issues on pages where CSS is used to treat spacing as significant. (`#40 <https://github.com/edgi-govdata-archiving/web-monitoring-diff/issues/40>`_)
20+
- Fix :func:`web_monitoring_diff.html_diff_render` to make sure the spacing of text and tags in the HTML source code of the diff matches the original. This resolves display issues on pages where CSS is used to treat spacing as significant. (:issue:`40`)
2121

22-
- Improve handling of lazy-loaded images in :func:`web_monitoring_diff.html_diff_render`. When images are lazy-loaded via JS, they usually use the ``data-src`` or ``data-srcset`` attributes, and we now check those, too. Additionally, if two images have no detectable URLs, we now treat them as the same, rather than different. (`#39 <https://github.com/edgi-govdata-archiving/web-monitoring-diff/issues/39>`_)
22+
- Improve handling of lazy-loaded images in :func:`web_monitoring_diff.html_diff_render`. When images are lazy-loaded via JS, they usually use the ``data-src`` or ``data-srcset`` attributes, and we now check those, too. Additionally, if two images have no detectable URLs, we now treat them as the same, rather than different. (:issue:`39`)
2323

24-
- Stop showing inline scripts and styles in :func:`web_monitoring_diff.html_diff_render`. These still get wrapped with ``<del>`` or ``<ins>`` elements, but they don’t show up visually since they aren’t elements that should be visually rendered. (`#43 <https://github.com/edgi-govdata-archiving/web-monitoring-diff/issues/43>`_)
24+
- Stop showing inline scripts and styles in :func:`web_monitoring_diff.html_diff_render`. These still get wrapped with ``<del>`` or ``<ins>`` elements, but they don’t show up visually since they aren’t elements that should be visually rendered. (:issue:`43`)
2525

2626

2727
Version 0.1.0

0 commit comments

Comments
 (0)