-
Notifications
You must be signed in to change notification settings - Fork 135
/
Copy pathindex.md
240 lines (136 loc) · 3.56 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# {py:mod}`example`
:::{py:module} example
:::
:::{autoapi-nested-parse}
Example module
This is a description
:::
## Module Contents
### Classes
:::{autoapisummary}
example.Foo
example.Bar
example.ClassWithNoInit
example.One
example.MultilineOne
example.Two
:::
### Functions
:::{autoapisummary}
example.decorator_okay
example.fn_with_long_sig
:::
### Attributes
:::{autoapisummary}
example.A_TUPLE
example.A_LIST
:::
:::{py:data} A_TUPLE
:value: "('a', 'b')"
A tuple to be rendered as a tuple.
:::
:::{py:data} A_LIST
:value: "['c', 'd']"
A list to be rendered as a list.
:::
:::{py:class} Foo(attr)
Bases: :py:obj:`object`
Can we parse arguments from the class docstring?
:param attr: Set an attribute.
:type attr: str
Constructor docstring
:::{py:class} Meta
Bases: :py:obj:`object`
A nested class just to test things out
:::{py:method} foo()
:classmethod:
The foo class method
:::
:::
:::{py:property} property_simple
:type: int
This property should parse okay.
:::
:::{py:attribute} class_var
:value: '42'
:::
:::{py:attribute} another_class_var
:value: '42'
Another class var docstring
:::
:::{py:attribute} attr2
This is the docstring of an instance attribute.
:type: str
:::
:::{py:method} method_okay(foo=None, bar=None)
This method should parse okay
:::
:::{py:method} method_multiline(foo=None, bar=None, baz=None)
This is on multiple lines, but should parse okay too
pydocstyle gives us lines of source. Test if this means that multiline
definitions are covered in the way we're anticipating here
:::
:::{py:method} method_tricky(foo=None, bar=dict(foo=1, bar=2))
This will likely fail our argument testing
We parse naively on commas, so the nested dictionary will throw this off
:::
:::{py:method} method_sphinx_docs(foo, bar=0)
This method is documented with sphinx style docstrings.
:param foo: The first argument.
:type foo: int
:param int bar: The second argument.
:returns: The sum of foo and bar.
:rtype: int
:::
:::{py:method} method_google_docs(foo, bar=0)
This method is documented with google style docstrings.
Args:
foo (int): The first argument.
bar (int): The second argument.
Returns:
int: The sum of foo and bar.
:::
:::{py:method} method_sphinx_unicode()
This docstring uses unicodé.
:returns: A string.
:rtype: str
:::
:::{py:method} method_google_unicode()
This docstring uses unicodé.
Returns:
str: A string.
:::
:::
:::{py:function} decorator_okay(func)
This decorator should parse okay.
:::
:::{py:class} Bar(attr)
Bases: :py:obj:`Foo`
Can we parse arguments from the class docstring?
:param attr: Set an attribute.
:type attr: str
Constructor docstring
:::{py:method} method_okay(foo=None, bar=None)
This method should parse okay
:::
:::
:::{py:class} ClassWithNoInit
:::
:::{py:class} One
One.
One __init__.
:::
:::{py:class} MultilineOne
Bases: :py:obj:`One`
This is a naughty summary line
that exists on two lines.
One __init__.
:::
:::{py:class} Two
Bases: :py:obj:`One`
Two.
One __init__.
:::
:::{py:function} fn_with_long_sig(this, *, function=None, has=True, quite=True, a, long, signature, many, keyword, arguments)
A function with a long signature.
:::