File tree Expand file tree Collapse file tree 6 files changed +49
-5
lines changed Expand file tree Collapse file tree 6 files changed +49
-5
lines changed 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 38
38
'sphinx.ext.coverage' ,
39
39
'sphinx.ext.doctest' ,
40
40
'sphinx.ext.extlinks' ,
41
+ 'sphinx_codeautolink' ,
41
42
]
42
43
43
44
# Skip if downstream redistributors haven't installed them
404
405
# Additional static files.
405
406
html_static_path = ['_static' , 'tools/static' ]
406
407
408
+ # Additional CSS files.
409
+ html_css_files = ["custom.css" ]
410
+
407
411
# Output file base name for HTML help builder.
408
412
htmlhelp_basename = 'python' + release .replace ('.' , '' )
409
413
413
417
# Split pot files one per reST file
414
418
gettext_compact = False
415
419
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
+
416
430
# Options for LaTeX output
417
431
# ------------------------
418
432
Original file line number Diff line number Diff line change 19
19
with the :mod: `re ` module. It provides a gentler introduction than the
20
20
corresponding section in the Library Reference.
21
21
22
+ .. highlight :: pycon
22
23
23
24
Introduction
24
25
============
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::
538
538
asyncio.run(print_http_headers(url))
539
539
540
540
541
- Usage::
541
+ Usage:
542
542
543
- python example.py http://example.com/path/page.html
543
+ .. code-block :: shell
544
544
545
- or with HTTPS::
545
+ python example.py http://example.com/path/page.html
546
546
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
548
552
549
553
550
554
.. _asyncio_example_create_connection-streams :
Original file line number Diff line number Diff line change 52
52
# ... later
53
53
async with lock:
54
54
# access shared state
55
+ ...
55
56
56
57
which is equivalent to::
57
58
61
62
await lock.acquire()
62
63
try:
63
64
# access shared state
65
+ ...
64
66
finally:
65
67
lock.release()
66
68
@@ -305,6 +307,7 @@ Semaphore
305
307
# ... later
306
308
async with sem:
307
309
# work with shared resource
310
+ ...
308
311
309
312
which is equivalent to::
310
313
@@ -314,6 +317,7 @@ Semaphore
314
317
await sem.acquire()
315
318
try:
316
319
# work with shared resource
320
+ ...
317
321
finally:
318
322
sem.release()
319
323
@@ -397,7 +401,9 @@ Barrier
397
401
398
402
asyncio.run(example_barrier())
399
403
400
- Result of this example is::
404
+ Result of this example is:
405
+
406
+ .. code-block :: none
401
407
402
408
<asyncio.locks.Barrier object at 0x... [filling, waiters:2/3]>
403
409
<asyncio.locks.Barrier object at 0x... [draining, waiters:0/3]>
Original file line number Diff line number Diff line change 13
13
14
14
sphinxext-opengraph ~= 0.10.0
15
15
sphinx-notfound-page ~= 1.0.0
16
+ sphinx-codeautolink ~= 0.16.0
16
17
17
18
# The theme used by the documentation is stored separately, so we need
18
19
# to install that as well.
You can’t perform that action at this time.
0 commit comments