Skip to content

Commit 7c2862e

Browse files
juiwenchenubmarco
authored andcommitted
updated dcos
1 parent 923796c commit 7c2862e

2 files changed

Lines changed: 38 additions & 18 deletions

File tree

docs/source/components/directive.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Directive
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

docs/source/components/oneline.rst

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff 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

98109
the one-line comment shall be defined as the following
99110

@@ -117,17 +128,26 @@ when it is not given in the need definition.
117128

118129
For 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

132152
the following need definition in source code is equivalent to RST shown below:
133153

0 commit comments

Comments
 (0)