File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ Style autolinks to reference documentation
3+ (https://sphinx-codeautolink.readthedocs.io/en/latest/examples.html#custom-link-styles)
4+ */
5+ /*
6+ .sphinx-codeautolink-a {
7+ text-decoration: none !important;
8+ }
9+ */
10+
11+ /* better for debugging */
12+ .sphinx-codeautolink-a {
13+ text-decoration-style : solid !important ;
14+ text-decoration-color : # aaa ;
15+ }
16+ .sphinx-codeautolink-a : hover {
17+ text-decoration-color : black;
18+ }
Original file line number Diff line number Diff line change 3838 'sphinx.ext.coverage' ,
3939 'sphinx.ext.doctest' ,
4040 'sphinx.ext.extlinks' ,
41+ 'sphinx_codeautolink' ,
4142]
4243
4344# Skip if downstream redistributors haven't installed them
404405# Additional static files.
405406html_static_path = ['_static' , 'tools/static' ]
406407
408+ # Additional CSS files.
409+ html_css_files = ["custom.css" ]
410+
407411# Output file base name for HTML help builder.
408412htmlhelp_basename = 'python' + release .replace ('.' , '' )
409413
413417# Split pot files one per reST file
414418gettext_compact = False
415419
420+ # Options for automatic links from code examples to reference docs
421+ # (https://sphinx-codeautolink.readthedocs.io/)
422+ codeautolink_warn_on_missing_inventory = False
423+ codeautolink_warn_on_failed_resolve = False
424+ codeautolink_custom_blocks = {
425+ # https://sphinx-codeautolink.readthedocs.io/en/latest/examples.html#doctest-code-blocks
426+ "pycon3" : "sphinx_codeautolink.clean_pycon" ,
427+ }
428+ # suppress_warnings = ["codeautolink"]
429+
416430# Options for LaTeX output
417431# ------------------------
418432
Original file line number Diff line number Diff line change 1919 with the :mod: `re ` module. It provides a gentler introduction than the
2020 corresponding section in the Library Reference.
2121
22+ .. highlight :: pycon
2223
2324Introduction
2425============
Original file line number Diff line number Diff line change @@ -538,13 +538,17 @@ Simple example querying HTTP headers of the URL passed on the command line::
538538 asyncio.run(print_http_headers(url))
539539
540540
541- Usage::
541+ Usage:
542542
543- python example.py http://example.com/path/page.html
543+ .. code-block :: shell
544544
545- or with HTTPS::
545+ python example.py http://example.com/path/page.html
546546
547- python example.py https://example.com/path/page.html
547+ or with HTTPS:
548+
549+ .. code-block :: shell
550+
551+ python example.py https://example.com/path/page.html
548552
549553
550554 .. _asyncio_example_create_connection-streams :
Original file line number Diff line number Diff line change 5252 # ... later
5353 async with lock:
5454 # access shared state
55+ ...
5556
5657 which is equivalent to::
5758
6162 await lock.acquire()
6263 try:
6364 # access shared state
65+ ...
6466 finally:
6567 lock.release()
6668
@@ -305,6 +307,7 @@ Semaphore
305307 # ... later
306308 async with sem:
307309 # work with shared resource
310+ ...
308311
309312 which is equivalent to::
310313
@@ -314,6 +317,7 @@ Semaphore
314317 await sem.acquire()
315318 try:
316319 # work with shared resource
320+ ...
317321 finally:
318322 sem.release()
319323
@@ -397,7 +401,9 @@ Barrier
397401
398402 asyncio.run(example_barrier())
399403
400- Result of this example is::
404+ Result of this example is:
405+
406+ .. code-block :: none
401407
402408 <asyncio.locks.Barrier object at 0x... [filling, waiters:2/3]>
403409 <asyncio.locks.Barrier object at 0x... [draining, waiters:0/3]>
Original file line number Diff line number Diff line change 1313
1414sphinxext-opengraph ~= 0.10.0
1515sphinx-notfound-page ~= 1.0.0
16+ sphinx-codeautolink ~= 0.16.0
1617
1718# The theme used by the documentation is stored separately, so we need
1819# to install that as well.
You can’t perform that action at this time.
0 commit comments