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- ``CodeLinks `` provides the ``src-trace `` directive and it can be used in the following ways:
6+ .. attention :: ``src-trace`` directive currently only supports :ref:`one-line need definition <oneline>`.
7+
8+ ``CodeLinks `` provides ``src-trace `` directive and it can be used in the following ways:
79
810.. code-block :: rst
911
Original file line number Diff line number Diff line change @@ -91,14 +91,25 @@ For example, with the following **needs_fields** configuration:
9191
9292.. _`fields_config` :
9393
94- .. code-block :: python
94+ .. tabs ::
95+
96+ .. code-tab :: python
97+
98+ needs_fields = [
99+ {"name": "title"},
100+ {"name": "id"},
101+ {"name": "type", "default": "impl"},
102+ {"name": "links", "type": "list[str]", "default": []},
103+ ],
104+
105+ .. code-tab :: toml
95106
96- needs_fields= [
97- { " name" : " title" },
98- { " name" : " id" },
99- { " name" : " type" , " default" : " impl" },
100- { " name" : " links" , " type" : " list[str]" , " default" : [] },
101- ],
107+ needs_fields = [
108+ { name = "title" },
109+ { name = "id" },
110+ { name = "type", default = "impl" },
111+ { name = "links", type = "list[str]", default = [] },
112+ ]
102113
103114the one-line comment shall be defined as follows:
104115
@@ -122,17 +133,26 @@ when it is not given in the need definition.
122133
123134For example, with the following needs_fields definition,
124135
125- .. code-block :: python
136+ .. tabs ::
137+
138+ .. code-tab :: python
139+
140+ needs_fields = [
141+ {
142+ "name": "title"
143+ },
144+ {
145+ "name": "type",
146+ "default": "implementation"
147+ },
148+ ]
149+
150+ .. code-tab :: toml
126151
127- needs_fields = [
128- {
129- " name" : " title"
130- },
131- {
132- " name" : " type" ,
133- " default" : " implementation"
134- },
135- ]
152+ needs_fields = [
153+ { name = "title" },
154+ { name = "type", default = "implementation" }
155+ ]
136156
137157the following need definition in source code is equivalent to RST shown below:
138158
You can’t perform that action at this time.
0 commit comments