File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import os .path
7
7
import sys
8
+ from sphinx .writers .html5 import HTML5Translator
9
+ from docutils .nodes import Element
8
10
9
11
sys .path .insert (0 , os .path .abspath ('.' ))
10
12
26
28
27
29
intersphinx_mapping = {'py' : ('https://docs.python.org/3.12' , None )}
28
30
31
+ add_module_names = False
29
32
30
33
# -- Options for HTML output -------------------------------------------------
31
34
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
32
35
33
36
html_theme = 'alabaster'
34
- html_static_path = ['_static' ]
37
+
38
+
39
+ class MyTranslator (HTML5Translator ):
40
+ """Adds a link target to name without `typing_extensions.` prefix."""
41
+ def visit_desc_signature (self , node : Element ) -> None :
42
+ desc_name = node .get ("fullname" )
43
+ if desc_name :
44
+ self .body .append (f'<span id="{ desc_name } "></span>' )
45
+ super ().visit_desc_signature (node )
46
+
47
+
48
+ def setup (app ):
49
+ app .set_translator ('html' , MyTranslator )
Original file line number Diff line number Diff line change
1
+ .. module :: typing_extensions
1
2
2
3
Welcome to typing_extensions's documentation!
3
4
=============================================
You can’t perform that action at this time.
0 commit comments