Skip to content

Commit

Permalink
Integrate GH-related Sphinx roles via extlinks (#952)
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz authored Nov 15, 2023
1 parent 08ebbe1 commit b81a868
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
16 changes: 13 additions & 3 deletions CHANGES/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ telling the readers **what changed** in a specific version of
the library *since the previous version*. You should also use
reStructuredText syntax for highlighting code (inline or block),
linking parts of the docs or external sites.
If you wish to sign your change, feel free to add ``-- by
:user:`github-username``` at the end (replace ``github-username``
with your own!).

Finally, name your file following the convention that Towncrier
understands: it should start with the number of an issue or a
Expand Down Expand Up @@ -67,20 +70,27 @@ File :file:`CHANGES/603.removal.1.rst`:

.. code-block:: rst
Dropped Python 3.5 support; Python 3.6 is the minimal supported Python version.
Dropped Python 3.5 support; Python 3.6 is the minimal supported Python
version -- by :user:`webknjaz`.
File :file:`CHANGES/550.bugfix.rst`:

.. code-block:: rst
Started shipping Windows wheels for the x86 architecture.
Started shipping Windows wheels for the x86 architecture
-- by :user:`Dreamsorcerer`.
File :file:`CHANGES/553.feature.rst`:

.. code-block:: rst
Added support for ``GenericAliases`` (``MultiDict[str]``) under Python 3.9 and higher.
Added support for ``GenericAliases`` (``MultiDict[str]``) under Python 3.9
and higher -- by :user:`mjpieters`.
.. tip::

See :file:`pyproject.toml` for all available categories
(``tool.towncrier.type``).

.. _Towncrier philosophy:
https://towncrier.readthedocs.io/en/actual-freaking-docs/#philosophy
28 changes: 25 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
# stdlib-party extensions:
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.viewcode",
# Third-party extensions:
"alabaster",
]

Expand Down Expand Up @@ -88,9 +91,17 @@
# The master toctree document.
master_doc = "index"

# General information about the project.
project = "yarl"
copyright = "2016-2018, Andrew Svetlov and aio-libs team"
# -- Project information -----------------------------------------------------

github_url = "https://github.com"
github_repo_org = "aio-libs"
github_repo_name = "yarl"
github_repo_slug = f"{github_repo_org}/{github_repo_name}"
github_repo_url = f"{github_url}/{github_repo_slug}"
github_sponsors_url = f"{github_url}/sponsors"

project = github_repo_name
copyright = f"2016, Andrew Svetlov, {project} contributors and aio-libs team"
author = "Andrew Svetlov and aio-libs team"

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -154,6 +165,17 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# -- Extension configuration -------------------------------------------------

# -- Options for extlinks extension ---------------------------------------
extlinks = {
"issue": (f"{github_repo_url}/issues/%s", "#%s"),
"pr": (f"{github_repo_url}/pull/%s", "PR #%s"),
"commit": (f"{github_repo_url}/commit/%s", "%s"),
"gh": (f"{github_url}/%s", "GitHub: %s"),
"user": (f"{github_sponsors_url}/%s", "@%s"),
}


# -- Options for HTML output ----------------------------------------------

Expand Down

0 comments on commit b81a868

Please sign in to comment.