File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33Directive
44=========
55
6- .. Note :: ``src-trace`` directive currently only supports :ref:`one-line need definition <oneline>`.
6+ .. attention :: ``src-trace`` directive currently only supports :ref:`one-line need definition <oneline>`.
77
88``CodeLinks `` provides ``src-trace `` directive and it can be used in the following ways:
99
Original file line number Diff line number Diff line change @@ -86,14 +86,25 @@ For example, with the following **needs_fields** configuration:
8686
8787.. _`fields_config` :
8888
89- .. code-block :: python
89+ .. tabs ::
90+
91+ .. code-tab :: python
92+
93+ needs_fields = [
94+ {"name": "title"},
95+ {"name": "id"},
96+ {"name": "type", "default": "impl"},
97+ {"name": "links", "type": "list[str]", "default": []},
98+ ],
99+
100+ .. code-tab :: toml
90101
91- needs_fields= [
92- { " name" : " title" },
93- { " name" : " id" },
94- { " name" : " type" , " default" : " impl" },
95- { " name" : " links" , " type" : " list[str]" , " default" : [] },
96- ],
102+ needs_fields = [
103+ { name = "title" },
104+ { name = "id" },
105+ { name = "type", default = "impl" },
106+ { name = "links", type = "list[str]", default = [] },
107+ ]
97108
98109the one-line comment shall be defined as the following
99110
@@ -117,17 +128,26 @@ when it is not given in the need definition.
117128
118129For example, with the following needs_fields definition,
119130
120- .. code-block :: python
131+ .. tabs ::
132+
133+ .. code-tab :: python
134+
135+ needs_fields = [
136+ {
137+ "name": "title"
138+ },
139+ {
140+ "name": "type",
141+ "default": "implementation"
142+ },
143+ ]
144+
145+ .. code-tab :: toml
121146
122- needs_fields = [
123- {
124- " name" : " title"
125- },
126- {
127- " name" : " type" ,
128- " default" : " implementation"
129- },
130- ]
147+ needs_fields = [
148+ { name = "title" },
149+ { name = "type", default = "implementation" }
150+ ]
131151
132152the following need definition in source code is equivalent to RST shown below:
133153
You can’t perform that action at this time.
0 commit comments