forked from fastai/fastai
/
gen_doc.nbdoc.html
277 lines (186 loc) · 9.29 KB
/
gen_doc.nbdoc.html
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
---
title: gen_doc.nbdoc
keywords: fastai
sidebar: home_sidebar
summary: "Helper function to build the documentation"
---
<div class="container" id="notebook-container">
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="Documentation-notebook-functions">Documentation notebook functions<a class="anchor-link" href="#Documentation-notebook-functions">¶</a></h1>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p><a href="/gen_doc.nbdoc.html#gen_doc.nbdoc"><code>nbdoc</code></a> contains the functions for documentation notebooks. The most important is <a href="/gen_doc.nbdoc.html#show_doc"><code>show_doc</code></a>:</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Show-the-documentation-of-a-function">Show the documentation of a function<a class="anchor-link" href="#Show-the-documentation-of-a-function">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="show_doc"><code>show_doc</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L90" class="source_link">[source]</a></h4><blockquote><p><code>show_doc</code>(<code>elt</code>, <code>doc_string</code>:<code>bool</code>=<code>True</code>, <code>full_name</code>:<code>str</code>=<code>None</code>, <code>arg_comments</code>:<code>dict</code>=<code>None</code>, <code>title_level</code>=<code>None</code>, <code>alt_doc_string</code>:<code>str</code>=<code>''</code>, <code>ignore_warn</code>:<code>bool</code>=<code>False</code>, <code>markdown</code>=<code>True</code>)</p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Show the documentation of an <code>elt</code> (function, class or enum). <code>doc_string</code> decices if we show the doc string of the element or not, <code>full_name</code> will override the name shown, <code>arg_comments</code> is a dictionary that will then show list the arguments with comments. <code>title_level</code> is the level of the corresponding cell in the TOC, <code>alt_doc_string</code> is a text that can replace the <code>doc_string</code>. <code>ignore_warn</code> will ignore warnings if you pass arguments in <code>arg_comments</code> that don't appear to belong to this function and <code>markdown</code> decides if the return is a Markdown cell or plain text.</p>
<p>Plenty of examples of uses of this cell can been seen through the documentation, and you will want to <em>hide input</em> those cells for a clean final result.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Convenience-functions">Convenience functions<a class="anchor-link" href="#Convenience-functions">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="get_source_link"><code>get_source_link</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L322" class="source_link">[source]</a></h4><blockquote><p><code>get_source_link</code>(<code>mod</code>, <code>lineno</code>, <code>display_text</code>=<code>'[source]'</code>) → <code>str</code></p>
</blockquote>
<p>Returns link to <code>lineno</code> in source code of <code>mod</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="show_video"><code>show_video</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L266" class="source_link">[source]</a></h4><blockquote><p><code>show_video</code>(<code>url</code>)</p>
</blockquote>
<p>Display video in <code>url</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="show_video_from_youtube"><code>show_video_from_youtube</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L271" class="source_link">[source]</a></h4><blockquote><p><code>show_video_from_youtube</code>(<code>code</code>, <code>start</code>=<code>0</code>)</p>
</blockquote>
<p>Display video from Youtube with a <code>code</code> and a <code>start</code> time.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Functions-for-internal-fastai-library-use">Functions for internal fastai library use<a class="anchor-link" href="#Functions-for-internal-fastai-library-use">¶</a></h2>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="get_exports"><code>get_exports</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L198" class="source_link">[source]</a></h4><blockquote><p><code>get_exports</code>(<code>mod</code>)</p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Get the exports of <code>mod</code>.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="get_fn_link"><code>get_fn_link</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L288" class="source_link">[source]</a></h4><blockquote><p><code>get_fn_link</code>(<code>ft</code>) → <code>str</code></p>
</blockquote>
<p>Return function link to notebook documentation of <code>ft</code>. Private functions link to source code</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="get_ft_names"><code>get_ft_names</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L203" class="source_link">[source]</a></h4><blockquote><p><code>get_ft_names</code>(<code>mod</code>, <code>include_inner</code>=<code>False</code>) → <code>List</code>[<code>str</code>]</p>
</blockquote>
<p>Return all the functions of module <code>mod</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="is_enum"><code>is_enum</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L24" class="source_link">[source]</a></h4><blockquote><p><code>is_enum</code>()</p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing text_cell rendered"><div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Check if something is an enumerator.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="import_mod"><code>import_mod</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L177" class="source_link">[source]</a></h4><blockquote><p><code>import_mod</code>(<code>mod_name</code>:<code>str</code>, <code>ignore_errors</code>=<code>False</code>)</p>
</blockquote>
<p>Return module from <code>mod_name</code>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea ">
<h4 id="link_docstring"><code>link_docstring</code><a href="https://github.com/fastai/fastai/blob/master/fastai/gen_doc/nbdoc.py#L153" class="source_link">[source]</a></h4><blockquote><p><code>link_docstring</code>(<code>modules</code>, <code>docstring</code>:<code>str</code>, <code>overwrite</code>:<code>bool</code>=<code>False</code>) → <code>str</code></p>
</blockquote>
<p>Search <code>docstring</code> for backticks and attempt to link those functions to respective documentation.</p>
</div>
</div>
</div>
</div>
</div>
</div>