-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
608 lines (508 loc) · 33.4 KB
/
test.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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>reStructuredText Primer — dokumentasi Kalarau 1.0.0</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="dokumentasi Kalarau 1.0.0" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Kalarau
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="simple">
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Kalarau</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>reStructuredText Primer</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/test.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="restructuredtext-primer">
<span id="rst-primer"></span><h1>reStructuredText Primer<a class="headerlink" href="#restructuredtext-primer" title="Link permanen untuk headline ini">¶</a></h1>
<p>This section is a brief introduction to reStructuredText (reST) concepts and
syntax, intended to provide authors with enough information to author documents
productively. Since reST was designed to be a simple, unobtrusive markup
language, this will not take too long.</p>
<div class="admonition seealso">
<p class="first admonition-title">lihat juga</p>
<p class="last">The authoritative <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText User Documentation</a>. The “ref” links in this
document link to the description of the individual constructs in the reST
reference.</p>
</div>
<div class="section" id="paragraphs">
<h2>Paragraphs<a class="headerlink" href="#paragraphs" title="Link permanen untuk headline ini">¶</a></h2>
<p>The paragraph (<a href="#id1"><span class="problematic" id="id2">:duref:`ref <paragraphs>`</span></a>) is the most basic block in a reST
document. Paragraphs are simply chunks of text separated by one or more blank
lines. As in Python, indentation is significant in reST, so all lines of the
same paragraph must be left-aligned to the same level of indentation.</p>
</div>
<div class="section" id="inline-markup">
<span id="inlinemarkup"></span><h2>Inline markup<a class="headerlink" href="#inline-markup" title="Link permanen untuk headline ini">¶</a></h2>
<p>The standard reST inline markup is quite simple: use</p>
<ul class="simple">
<li>one asterisk: <code class="docutils literal"><span class="pre">*text*</span></code> for emphasis (italics),</li>
<li>two asterisks: <code class="docutils literal"><span class="pre">**text**</span></code> for strong emphasis (boldface), and</li>
<li>backquotes: <code class="docutils literal"><span class="pre">``text``</span></code> for code samples.</li>
</ul>
<p>If asterisks or backquotes appear in running text and could be confused with
inline markup delimiters, they have to be escaped with a backslash.</p>
<p>Be aware of some restrictions of this markup:</p>
<ul class="simple">
<li>it may not be nested,</li>
<li>content may not start or end with whitespace: <code class="docutils literal"><span class="pre">*</span> <span class="pre">text*</span></code> is wrong,</li>
<li>it must be separated from surrounding text by non-word characters. Use a
backslash escaped space to work around that: <code class="docutils literal"><span class="pre">thisis\</span> <span class="pre">*one*\</span> <span class="pre">word</span></code>.</li>
</ul>
<p>These restrictions may be lifted in future versions of the docutils.</p>
<p>reST also allows for custom “interpreted text roles”, which signify that the
enclosed text should be interpreted in a specific way. Sphinx uses this to
provide semantic markup and cross-referencing of identifiers, as described in
the appropriate section. The general syntax is <code class="docutils literal"><span class="pre">:rolename:`content`</span></code>.</p>
<p>Standard reST provides the following roles:</p>
<ul class="simple">
<li><a href="#id3"><span class="problematic" id="id4">:durole:`emphasis`</span></a> – alternate spelling for <code class="docutils literal"><span class="pre">*emphasis*</span></code></li>
<li><a href="#id5"><span class="problematic" id="id6">:durole:`strong`</span></a> – alternate spelling for <code class="docutils literal"><span class="pre">**strong**</span></code></li>
<li><a href="#id7"><span class="problematic" id="id8">:durole:`literal`</span></a> – alternate spelling for <code class="docutils literal"><span class="pre">``literal``</span></code></li>
<li><a href="#id9"><span class="problematic" id="id10">:durole:`subscript`</span></a> – subscript text</li>
<li><a href="#id11"><span class="problematic" id="id12">:durole:`superscript`</span></a> – superscript text</li>
<li><a href="#id13"><span class="problematic" id="id14">:durole:`title-reference`</span></a> – for titles of books, periodicals, and other
materials</li>
</ul>
<p>See <span class="xref std std-ref">inline-markup</span> for roles added by Sphinx.</p>
</div>
<div class="section" id="lists-and-quote-like-blocks">
<h2>Lists and Quote-like blocks<a class="headerlink" href="#lists-and-quote-like-blocks" title="Link permanen untuk headline ini">¶</a></h2>
<p>List markup (<a href="#id15"><span class="problematic" id="id16">:duref:`ref <bullet-lists>`</span></a>) is natural: just place an asterisk at
the start of a paragraph and indent properly. The same goes for numbered lists;
they can also be autonumbered using a <code class="docutils literal"><span class="pre">#</span></code> sign:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="m">*</span> This is a bulleted list.
<span class="m">*</span> It has two items, the second
item uses two lines.
<span class="m">1.</span> This is a numbered list.
<span class="m">2.</span> It has two items too.
<span class="m">#.</span> This is a numbered list.
<span class="m">#.</span> It has two items too.
</pre></div>
</div>
<p>Nested lists are possible, but be aware that they must be separated from the
parent list items by blank lines:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="m">*</span> this is
<span class="m">*</span> a list
<span class="m">*</span> with a nested list
<span class="m">*</span> and some subitems
<span class="m">*</span> and here the parent list continues
</pre></div>
</div>
<p>Definition lists (<a href="#id17"><span class="problematic" id="id18">:duref:`ref <definition-lists>`</span></a>) are created as follows:</p>
<div class="highlight-rest"><div class="highlight"><pre>term (up to a line of text)
Definition of the term, which must be indented
and can even consist of multiple paragraphs
next term
Description.
</pre></div>
</div>
<p>Note that the term cannot have more than one line of text.</p>
<p>Quoted paragraphs (<a href="#id19"><span class="problematic" id="id20">:duref:`ref <block-quotes>`</span></a>) are created by just indenting
them more than the surrounding paragraphs.</p>
<p>Line blocks (<a href="#id21"><span class="problematic" id="id22">:duref:`ref <line-blocks>`</span></a>) are a way of preserving line breaks:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="o">|</span> These lines are
<span class="o">|</span> broken exactly like in
<span class="o">|</span> the source file.
</pre></div>
</div>
<p>There are also several more special blocks available:</p>
<ul class="simple">
<li>field lists (<a href="#id23"><span class="problematic" id="id24">:duref:`ref <field-lists>`</span></a>)</li>
<li>option lists (<a href="#id25"><span class="problematic" id="id26">:duref:`ref <option-lists>`</span></a>)</li>
<li>quoted literal blocks (<a href="#id27"><span class="problematic" id="id28">:duref:`ref <quoted-literal-blocks>`</span></a>)</li>
<li>doctest blocks (<a href="#id29"><span class="problematic" id="id30">:duref:`ref <doctest-blocks>`</span></a>)</li>
</ul>
</div>
<div class="section" id="source-code">
<h2>Source Code<a class="headerlink" href="#source-code" title="Link permanen untuk headline ini">¶</a></h2>
<p>Literal code blocks (<a href="#id31"><span class="problematic" id="id32">:duref:`ref <literal-blocks>`</span></a>) are introduced by ending a
paragraph with the special marker <code class="docutils literal"><span class="pre">::</span></code>. The literal block must be indented
(and, like all paragraphs, separated from the surrounding ones by blank lines):</p>
<div class="highlight-rest"><div class="highlight"><pre>This is a normal text paragraph. The next paragraph is a code sample<span class="se">::</span>
<span class="s"> It is not processed in any way, except</span>
<span class="s"> that the indentation is removed.</span>
<span class="s"> It can span multiple lines.</span>
This is a normal text paragraph again.
</pre></div>
</div>
<p>The handling of the <code class="docutils literal"><span class="pre">::</span></code> marker is smart:</p>
<ul class="simple">
<li>If it occurs as a paragraph of its own, that paragraph is completely left
out of the document.</li>
<li>If it is preceded by whitespace, the marker is removed.</li>
<li>If it is preceded by non-whitespace, the marker is replaced by a single
colon.</li>
</ul>
<p>That way, the second sentence in the above example’s first paragraph would be
rendered as “The next paragraph is a code sample:”.</p>
</div>
<div class="section" id="tables">
<span id="rst-tables"></span><h2>Tables<a class="headerlink" href="#tables" title="Link permanen untuk headline ini">¶</a></h2>
<p>Two forms of tables are supported. For <em>grid tables</em> (<a href="#id33"><span class="problematic" id="id34">:duref:`ref
<grid-tables>`</span></a>), you have to “paint” the cell grid yourself. They look like
this:</p>
<div class="highlight-rest"><div class="highlight"><pre>+------------------------+------------+----------+----------+
<span class="o">|</span> Header row, column 1 | Header 2 | Header 3 | Header 4 |
<span class="o">|</span> (header rows optional) | | | |
+========================+============+==========+==========+
<span class="o">|</span> body row 1, column 1 | column 2 | column 3 | column 4 |
+------------------------+------------+----------+----------+
<span class="o">|</span> body row 2 | ... | ... | |
+------------------------+------------+----------+----------+
</pre></div>
</div>
<p><em>Simple tables</em> (<a href="#id35"><span class="problematic" id="id36">:duref:`ref <simple-tables>`</span></a>) are easier to write, but
limited: they must contain more than one row, and the first column cannot
contain multiple lines. They look like this:</p>
<div class="highlight-rest"><div class="highlight"><pre>===== ===== =======
A B A and B
===== ===== =======
False False False
True False False
False True False
True True True
===== ===== =======
</pre></div>
</div>
</div>
<div class="section" id="hyperlinks">
<h2>Hyperlinks<a class="headerlink" href="#hyperlinks" title="Link permanen untuk headline ini">¶</a></h2>
<div class="section" id="external-links">
<h3>External links<a class="headerlink" href="#external-links" title="Link permanen untuk headline ini">¶</a></h3>
<p>Use <code class="docutils literal"><span class="pre">`Link</span> <span class="pre">text</span> <span class="pre"><http://example.com/>`_</span></code> for inline web links. If the link
text should be the web address, you don’t need special markup at all, the parser
finds links and mail addresses in ordinary text.</p>
<p>You can also separate the link and the target definition (<a href="#id37"><span class="problematic" id="id38">:duref:`ref
<hyperlink-targets>`</span></a>), like this:</p>
<div class="highlight-rest"><div class="highlight"><pre>This is a paragraph that contains <span class="s">`a link`_</span>.
<span class="p">..</span> <span class="nt">_a link:</span> http://example.com/
</pre></div>
</div>
</div>
<div class="section" id="internal-links">
<h3>Internal links<a class="headerlink" href="#internal-links" title="Link permanen untuk headline ini">¶</a></h3>
<p>Internal linking is done via a special reST role provided by Sphinx, see the
section on specific markup, <span class="xref std std-ref">ref-role</span>.</p>
</div>
</div>
<div class="section" id="sections">
<h2>Sections<a class="headerlink" href="#sections" title="Link permanen untuk headline ini">¶</a></h2>
<p>Section headers (<a href="#id39"><span class="problematic" id="id40">:duref:`ref <sections>`</span></a>) are created by underlining (and
optionally overlining) the section title with a punctuation character, at least
as long as the text:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="gh">=================</span>
<span class="gh">This is a heading</span>
<span class="gh">=================</span>
</pre></div>
</div>
<p>Normally, there are no heading levels assigned to certain characters as the
structure is determined from the succession of headings. However, for the
Python documentation, this convention is used which you may follow:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">#</span></code> with overline, for parts</li>
<li><code class="docutils literal"><span class="pre">*</span></code> with overline, for chapters</li>
<li><code class="docutils literal"><span class="pre">=</span></code>, for sections</li>
<li><code class="docutils literal"><span class="pre">-</span></code>, for subsections</li>
<li><code class="docutils literal"><span class="pre">^</span></code>, for subsubsections</li>
<li><code class="docutils literal"><span class="pre">"</span></code>, for paragraphs</li>
</ul>
<p>Of course, you are free to use your own marker characters (see the reST
documentation), and use a deeper nesting level, but keep in mind that most
target formats (HTML, LaTeX) have a limited supported nesting depth.</p>
</div>
<div class="section" id="explicit-markup">
<h2>Explicit Markup<a class="headerlink" href="#explicit-markup" title="Link permanen untuk headline ini">¶</a></h2>
<p>“Explicit markup” (<a href="#id41"><span class="problematic" id="id42">:duref:`ref <explicit-markup-blocks>`</span></a>) is used in reST for
most constructs that need special handling, such as footnotes,
specially-highlighted paragraphs, comments, and generic directives.</p>
<p>An explicit markup block begins with a line starting with <code class="docutils literal"><span class="pre">..</span></code> followed by
whitespace and is terminated by the next paragraph at the same level of
indentation. (There needs to be a blank line between explicit markup and normal
paragraphs. This may all sound a bit complicated, but it is intuitive enough
when you write it.)</p>
</div>
<div class="section" id="directives">
<span id="id43"></span><h2>Directives<a class="headerlink" href="#directives" title="Link permanen untuk headline ini">¶</a></h2>
<p>A directive (<a href="#id44"><span class="problematic" id="id45">:duref:`ref <directives>`</span></a>) is a generic block of explicit markup.
Besides roles, it is one of the extension mechanisms of reST, and Sphinx makes
heavy use of it.</p>
<p>Docutils supports the following directives:</p>
<ul>
<li><p class="first">Admonitions: <a href="#id46"><span class="problematic" id="id47">:dudir:`attention`</span></a>, <a href="#id48"><span class="problematic" id="id49">:dudir:`caution`</span></a>, <a href="#id50"><span class="problematic" id="id51">:dudir:`danger`</span></a>,
<a href="#id52"><span class="problematic" id="id53">:dudir:`error`</span></a>, <a href="#id54"><span class="problematic" id="id55">:dudir:`hint`</span></a>, <a href="#id56"><span class="problematic" id="id57">:dudir:`important`</span></a>, <a href="#id58"><span class="problematic" id="id59">:dudir:`note`</span></a>,
<a href="#id60"><span class="problematic" id="id61">:dudir:`tip`</span></a>, <a href="#id62"><span class="problematic" id="id63">:dudir:`warning`</span></a> and the generic
<a href="#id64"><span class="problematic" id="id65">:dudir:`admonition <admonitions>`</span></a>. (Most themes style only “note” and
“warning” specially.)</p>
</li>
<li><p class="first">Images:</p>
<ul class="simple">
<li><a href="#id66"><span class="problematic" id="id67">:dudir:`image`</span></a> (see also <a class="reference internal" href="#images">Images</a> below)</li>
<li><a href="#id68"><span class="problematic" id="id69">:dudir:`figure`</span></a> (an image with caption and optional legend)</li>
</ul>
</li>
<li><p class="first">Additional body elements:</p>
<ul class="simple">
<li><a href="#id70"><span class="problematic" id="id71">:dudir:`contents <table-of-contents>`</span></a> (a local, i.e. for the current file
only, table of contents)</li>
<li><a href="#id72"><span class="problematic" id="id73">:dudir:`container`</span></a> (a container with a custom class, useful to generate an
outer <code class="docutils literal"><span class="pre"><div></span></code> in HTML)</li>
<li><a href="#id74"><span class="problematic" id="id75">:dudir:`rubric`</span></a> (a heading without relation to the document sectioning)</li>
<li><a href="#id76"><span class="problematic" id="id77">:dudir:`topic`</span></a>, <a href="#id78"><span class="problematic" id="id79">:dudir:`sidebar`</span></a> (special highlighted body elements)</li>
<li><a href="#id80"><span class="problematic" id="id81">:dudir:`parsed-literal`</span></a> (literal block that supports inline markup)</li>
<li><a href="#id82"><span class="problematic" id="id83">:dudir:`epigraph`</span></a> (a block quote with optional attribution line)</li>
<li><a href="#id84"><span class="problematic" id="id85">:dudir:`highlights`</span></a>, <a href="#id86"><span class="problematic" id="id87">:dudir:`pull-quote`</span></a> (block quotes with their own
class attribute)</li>
<li><a href="#id88"><span class="problematic" id="id89">:dudir:`compound <compound-paragraph>`</span></a> (a compound paragraph)</li>
</ul>
</li>
<li><p class="first">Special tables:</p>
<ul class="simple">
<li><a href="#id90"><span class="problematic" id="id91">:dudir:`table`</span></a> (a table with title)</li>
<li><a href="#id92"><span class="problematic" id="id93">:dudir:`csv-table`</span></a> (a table generated from comma-separated values)</li>
<li><a href="#id94"><span class="problematic" id="id95">:dudir:`list-table`</span></a> (a table generated from a list of lists)</li>
</ul>
</li>
<li><p class="first">Special directives:</p>
<ul class="simple">
<li><a href="#id96"><span class="problematic" id="id97">:dudir:`raw <raw-data-pass-through>`</span></a> (include raw target-format markup)</li>
<li><a href="#id98"><span class="problematic" id="id99">:dudir:`include`</span></a> (include reStructuredText from another file)
– in Sphinx, when given an absolute include file path, this directive takes
it as relative to the source directory</li>
<li><a href="#id100"><span class="problematic" id="id101">:dudir:`class`</span></a> (assign a class attribute to the next element) <a class="footnote-reference" href="#id137" id="id102">[1]</a></li>
</ul>
</li>
<li><p class="first">HTML specifics:</p>
<ul class="simple">
<li><a href="#id103"><span class="problematic" id="id104">:dudir:`meta`</span></a> (generation of HTML <code class="docutils literal"><span class="pre"><meta></span></code> tags)</li>
<li><a href="#id105"><span class="problematic" id="id106">:dudir:`title <metadata-document-title>`</span></a> (override document title)</li>
</ul>
</li>
<li><p class="first">Influencing markup:</p>
<ul class="simple">
<li><a href="#id107"><span class="problematic" id="id108">:dudir:`default-role`</span></a> (set a new default role)</li>
<li><a href="#id109"><span class="problematic" id="id110">:dudir:`role`</span></a> (create a new role)</li>
</ul>
<p>Since these are only per-file, better use Sphinx’s facilities for setting the
<a href="#id111"><span class="problematic" id="id112">:confval:`default_role`</span></a>.</p>
</li>
</ul>
<p>Do <em>not</em> use the directives <a href="#id113"><span class="problematic" id="id114">:dudir:`sectnum`</span></a>, <a href="#id115"><span class="problematic" id="id116">:dudir:`header`</span></a> and
<a href="#id117"><span class="problematic" id="id118">:dudir:`footer`</span></a>.</p>
<p>Directives added by Sphinx are described in <span class="xref std std-ref">sphinxmarkup</span>.</p>
<p>Basically, a directive consists of a name, arguments, options and content. (Keep
this terminology in mind, it is used in the next chapter describing custom
directives.) Looking at this example,</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="p">..</span> <span class="ow">function</span><span class="p">::</span> foo(x)
foo(y, z)
<span class="nc">:module:</span> <span class="nf">some.module.name</span>
Return a line of text input from the user.
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">function</span></code> is the directive name. It is given two arguments here, the
remainder of the first line and the second line, as well as one option
<code class="docutils literal"><span class="pre">module</span></code> (as you can see, options are given in the lines immediately following
the arguments and indicated by the colons). Options must be indented to the
same level as the directive content.</p>
<p>The directive content follows after a blank line and is indented relative to the
directive start.</p>
</div>
<div class="section" id="images">
<h2>Images<a class="headerlink" href="#images" title="Link permanen untuk headline ini">¶</a></h2>
<p>reST supports an image directive (<a href="#id119"><span class="problematic" id="id120">:dudir:`ref <image>`</span></a>), used like so:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="p">..</span> <span class="ow">image</span><span class="p">::</span> gnu.png
(options)
</pre></div>
</div>
<p>When used within Sphinx, the file name given (here <code class="docutils literal"><span class="pre">gnu.png</span></code>) must either be
relative to the source file, or absolute which means that they are relative to
the top source directory. For example, the file <code class="docutils literal"><span class="pre">sketch/spam.rst</span></code> could refer
to the image <code class="docutils literal"><span class="pre">images/spam.png</span></code> as <code class="docutils literal"><span class="pre">../images/spam.png</span></code> or
<code class="docutils literal"><span class="pre">/images/spam.png</span></code>.</p>
<p>Sphinx will automatically copy image files over to a subdirectory of the output
directory on building (e.g. the <code class="docutils literal"><span class="pre">_static</span></code> directory for HTML output.)</p>
<p>Interpretation of image size options (<code class="docutils literal"><span class="pre">width</span></code> and <code class="docutils literal"><span class="pre">height</span></code>) is as follows:
if the size has no unit or the unit is pixels, the given size will only be
respected for output channels that support pixels (i.e. not in LaTeX output).
Other units (like <code class="docutils literal"><span class="pre">pt</span></code> for points) will be used for HTML and LaTeX output.</p>
<p>Sphinx extends the standard docutils behavior by allowing an asterisk for the
extension:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="p">..</span> <span class="ow">image</span><span class="p">::</span> gnu.*
</pre></div>
</div>
<p>Sphinx then searches for all images matching the provided pattern and determines
their type. Each builder then chooses the best image out of these candidates.
For instance, if the file name <code class="docutils literal"><span class="pre">gnu.*</span></code> was given and two files <code class="file docutils literal"><span class="pre">gnu.pdf</span></code>
and <code class="file docutils literal"><span class="pre">gnu.png</span></code> existed in the source tree, the LaTeX builder would choose
the former, while the HTML builder would prefer the latter.
Supported image types and choosing priority are defined at <span class="xref std std-ref">builders</span>.</p>
<p>Note that image file names should not contain spaces.</p>
<div class="versionchanged">
<p><span class="versionmodified">Berubah pada versi 0.4: </span>Added the support for file names ending in an asterisk.</p>
</div>
<div class="versionchanged">
<p><span class="versionmodified">Berubah pada versi 0.6: </span>Image paths can now be absolute.</p>
</div>
</div>
<div class="section" id="footnotes">
<h2>Footnotes<a class="headerlink" href="#footnotes" title="Link permanen untuk headline ini">¶</a></h2>
<p>For footnotes (<a href="#id121"><span class="problematic" id="id122">:duref:`ref <footnotes>`</span></a>), use <code class="docutils literal"><span class="pre">[#name]_</span></code> to mark the footnote
location, and add the footnote body at the bottom of the document after a
“Footnotes” rubric heading, like so:</p>
<div class="highlight-rest"><div class="highlight"><pre>Lorem ipsum <span class="s">[#f1]_</span> dolor sit amet ... <span class="s">[#f2]_</span>
<span class="p">..</span> <span class="ow">rubric</span><span class="p">::</span> Footnotes
<span class="p">..</span> <span class="nt">[#f1]</span> Text of the first footnote.
<span class="p">..</span> <span class="nt">[#f2]</span> Text of the second footnote.
</pre></div>
</div>
<p>You can also explicitly number the footnotes (<code class="docutils literal"><span class="pre">[1]_</span></code>) or use auto-numbered
footnotes without names (<code class="docutils literal"><span class="pre">[#]_</span></code>).</p>
</div>
<div class="section" id="citations">
<h2>Citations<a class="headerlink" href="#citations" title="Link permanen untuk headline ini">¶</a></h2>
<p>Standard reST citations (<a href="#id123"><span class="problematic" id="id124">:duref:`ref <citations>`</span></a>) are supported, with the
additional feature that they are “global”, i.e. all citations can be referenced
from all files. Use them like so:</p>
<div class="highlight-rest"><div class="highlight"><pre>Lorem ipsum <span class="s">[Ref]_</span> dolor sit amet.
<span class="p">..</span> <span class="nt">[Ref]</span> Book or article reference, URL or whatever.
</pre></div>
</div>
<p>Citation usage is similar to footnote usage, but with a label that is not
numeric or begins with <code class="docutils literal"><span class="pre">#</span></code>.</p>
</div>
<div class="section" id="substitutions">
<h2>Substitutions<a class="headerlink" href="#substitutions" title="Link permanen untuk headline ini">¶</a></h2>
<p>reST supports “substitutions” (<a href="#id125"><span class="problematic" id="id126">:duref:`ref <substitution-definitions>`</span></a>), which
are pieces of text and/or markup referred to in the text by <code class="docutils literal"><span class="pre">|name|</span></code>. They
are defined like footnotes with explicit markup blocks, like this:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="p">..</span> <span class="nt">|name|</span> <span class="ow">replace</span><span class="p">::</span> replacement <span class="ge">*text*</span>
</pre></div>
</div>
<p>or this:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="p">..</span> <span class="nt">|caution|</span> <span class="ow">image</span><span class="p">::</span> warning.png
<span class="nc">:alt:</span> <span class="nf">Warning!</span>
</pre></div>
</div>
<p>See the <a href="#id127"><span class="problematic" id="id128">:duref:`reST reference for substitutions <substitution-definitions>`</span></a>
for details.</p>
<p>If you want to use some substitutions for all documents, put them into
<a href="#id129"><span class="problematic" id="id130">:confval:`rst_prolog`</span></a> or put them into a separate file and include it into all
documents you want to use them in, using the <code class="xref rst rst-dir docutils literal"><span class="pre">include</span></code> directive. (Be
sure to give the include file a file name extension differing from that of other
source files, to avoid Sphinx finding it as a standalone document.)</p>
<p>Sphinx defines some default substitutions, see <span class="xref std std-ref">default-substitutions</span>.</p>
</div>
<div class="section" id="comments">
<h2>Comments<a class="headerlink" href="#comments" title="Link permanen untuk headline ini">¶</a></h2>
<p>Every explicit markup block which isn’t a valid markup construct (like the
footnotes above) is regarded as a comment (<a href="#id131"><span class="problematic" id="id132">:duref:`ref <comments>`</span></a>). For
example:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="cp">.. This is a comment.</span>
</pre></div>
</div>
<p>You can indent text after a comment start to form multiline comments:</p>
<div class="highlight-rest"><div class="highlight"><pre><span class="cp">..</span>
<span class="cp"> This whole indented block</span>
<span class="cp"> is a comment.</span>
<span class="cp"> Still in the comment.</span>
</pre></div>
</div>
</div>
<div class="section" id="source-encoding">
<h2>Source encoding<a class="headerlink" href="#source-encoding" title="Link permanen untuk headline ini">¶</a></h2>
<p>Since the easiest way to include special characters like em dashes or copyright
signs in reST is to directly write them as Unicode characters, one has to
specify an encoding. Sphinx assumes source files to be encoded in UTF-8 by
default; you can change this with the <a href="#id133"><span class="problematic" id="id134">:confval:`source_encoding`</span></a> config value.</p>
</div>
<div class="section" id="gotchas">
<h2>Gotchas<a class="headerlink" href="#gotchas" title="Link permanen untuk headline ini">¶</a></h2>
<p>There are some problems one commonly runs into while authoring reST documents:</p>
<ul class="simple">
<li><strong>Separation of inline markup:</strong> As said above, inline markup spans must be
separated from the surrounding text by non-word characters, you have to use a
backslash-escaped space to get around that. See
<a href="#id135"><span class="problematic" id="id136">:duref:`the reference <substitution-definitions>`</span></a> for the details.</li>
<li><strong>No nested inline markup:</strong> Something like <code class="docutils literal"><span class="pre">*see</span> <span class="pre">:func:`foo`*</span></code> is not
possible.</li>
</ul>
<p class="rubric">Footnotes</p>
<table class="docutils footnote" frame="void" id="id137" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id102">[1]</a></td><td>When the default domain contains a <code class="xref rst rst-dir docutils literal"><span class="pre">class</span></code> directive, this
directive will be shadowed. Therefore, Sphinx re-exports it as
<code class="xref rst rst-dir docutils literal"><span class="pre">rst-class</span></code>.</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2015, Widnyana Putra.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.0.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/translations.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>