Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add hoverxref & codeautolink support. Various fixes #2968

Merged
merged 11 commits into from
May 14, 2024
2 changes: 2 additions & 0 deletions docs/source/contributing.rst
Expand Up @@ -203,6 +203,8 @@ it being merely hard to fix). For example:

.. code:: python

if ...:
...
else: # pragma: no cover
raise AssertionError("this can't happen!")

Expand Down
8 changes: 4 additions & 4 deletions docs/source/design.rst
Expand Up @@ -382,11 +382,11 @@ Specific style guidelines

.. code:: python

def call_the_thing(fn, *args, kwonly1, kwonly2, ...):
def call_the_thing(fn, *args, kwonly1, kwonly2):
...

where ``fn(*args)`` is the thing to be called, and ``kwonly1``,
``kwonly2``, ... are keyword-only arguments that belong to
``kwonly2``, are keyword-only arguments that belong to
``call_the_thing``. This applies even if ``call_the_thing`` doesn't
take any arguments of its own, i.e. in this case its signature looks
like:
Expand Down Expand Up @@ -420,10 +420,10 @@ Specific style guidelines

.. code:: python

async def OPERATION(...):
async def OPERATION(arg1, arg2):
...

def OPERATION_nowait(...):
def OPERATION_nowait(arg1, arg2):
...

and the ``nowait`` version raises :exc:`trio.WouldBlock` if it would block.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference-io.rst
Expand Up @@ -378,7 +378,7 @@ broken features:

.. code:: python

_, service_name = await getnameinfo((127.0.0.1, port), NI_NUMERICHOST))
_, service_name = await getnameinfo(('127.0.0.1', port), NI_NUMERICHOST)

* :func:`~socket.getservbyname`: obsolete and `buggy
<https://bugs.python.org/issue30482>`__; instead, do:
Expand Down
3 changes: 2 additions & 1 deletion docs/source/reference-lowlevel.rst
Expand Up @@ -711,7 +711,8 @@ can use as a model:

.. code:: python

import asyncio, trio
import asyncio
import trio
Comment on lines -704 to +715
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know why this raised errors, or by what, but it gave

/home/h/Git/trio/docs/source/reference-lowlevel.rst: WARNING: Could not match transformation of `asyncio` on source lines 1-1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's open an upstream issue for that? (I assume we can get a reproducer for codeautolink)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't able to quickly reproduce it, but might give that another try. felix-hilden/sphinx-codeautolink#142


# A tiny Trio program
async def trio_main():
Expand Down