@@ -11,6 +11,10 @@ entire contents of the file with the following (edit the text to your taste)::
11
11
12
12
Write a few paragraphs introducing yourself.
13
13
14
+
15
+ Basic formatting examples
16
+ -------------------------
17
+
14
18
Basic formatting in reStructuredText includes:
15
19
16
20
* *emphasis*
@@ -20,8 +24,39 @@ entire contents of the file with the following (edit the text to your taste)::
20
24
Good things to include in your introduction would be a note about what you
21
25
do and where you live.
22
26
27
+
28
+ Some examples of Sphinx elements
29
+ --------------------------------
30
+
31
+ .. epigraph::
32
+
33
+ I'd like to be remembered by my friends and enemies as honest and
34
+ stylish but slightly sinister. But mostly I'd just like to be
35
+ remembered.
36
+
37
+ -- Me
38
+
39
+
40
+ .. note:: Take note!
41
+
42
+ Include a ``note`` element, like this one, in order to demonstrate
43
+ how this is handled.
44
+
45
+ .. admonition:: An admonition
46
+
47
+ An ``admonition`` is a generic kind of note, amongst several other
48
+ kinds that Sphinx has to offer.
49
+
50
+ .. toctree::
51
+ :hidden:
52
+
53
+ plans
54
+ skills
55
+
56
+
23
57
Add a new file, ``plans.rst ``, containing::
24
58
59
+
25
60
My plans
26
61
========
27
62
@@ -32,11 +67,83 @@ Add a new file, ``plans.rst``, containing::
32
67
33
68
Perhaps you have some things that you intend to do in the near future.
34
69
70
+ For example, to write some Python code::
71
+
72
+ def plot_file(self, filename="", wait=None, resolution=None, bounds=None):
73
+ """Plots and image encoded as JSON lines in ``filename``. Passes the
74
+ lines in the supplied JSON file to ``plot_lines()``.
75
+ """
76
+
77
+ bounds = bounds or self.bounds
78
+
79
+ with open(filename, "r") as line_file:
80
+ lines = json.load(line_file)
81
+
82
+ self.plot_lines(
83
+ lines=lines,
84
+ wait=wait,
85
+ resolution=resolution,
86
+ bounds=bounds,
87
+ flip=True
88
+ )
89
+
90
+ And to quote a great mind:
91
+
92
+ A good will is not good because of what it effects or accomplishes,
93
+ because of its fitness to attain some proposed end, but only because of
94
+ its volition, that is, it is good in itself and, regarded for itself,
95
+ is to be valued incomparably higher than all that could merely be
96
+ brought about by it in favor of some inclination and indeed, if you
97
+ will, of the sum of all inclinations.
98
+
35
99
Long-term plans
36
100
---------------
37
101
38
102
And perhaps you have some that will come later on.
39
103
104
+ Include an image. If you want a suitable image file, use `Dürer's
105
+ rhinoceros from Wikipedia
106
+ <https://en.wikipedia.org/wiki/Dürer's_Rhinoceros#/media/File:The_Rhinocero
107
+ s_(N GA_1964.8.697)_enhanced.png>`_. Rename it to ``rhino.png`` and place
108
+ it in the root of your Sphinx project.
109
+
110
+ .. figure:: /rhino.png
111
+ :figclass: wider
112
+ :alt:
113
+
114
+ Not to be mistaken with rinoh: a rhino.
115
+
116
+ And another, ``skills.rst ``::
117
+
118
+ Skills
119
+ ======
120
+
121
+ I enjoy learing new skills.
122
+
123
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus
124
+ fringilla quis metus id porta. Nullam nibh ligula, mattis at molestie non,
125
+ interdum eu massa. Curabitur id sapien ut purus interdum lacinia.
126
+
127
+ Sed congue ligula sit amet porta pulvinar. Etiam magna risus, porttitor
128
+ viverra accumsan vel, rutrum quis eros. Curabitur at nibh lacus. Fusce ex
129
+ massa, pellentesque sed est eu, lacinia sodales nibh. Curabitur volutpat
130
+ justo a tortor bibendum, sed rutrum purus vestibulum.
131
+
132
+ Aliquam aliquet neque id erat cursus, vestibulum condimentum erat
133
+ convallis. In tristique, quam lacinia semper pretium, ante arcu blandit
134
+ turpis, non mollis sem magna ac risus.
135
+
136
+ Suspendisse pharetra tellus libero, ac aliquet est mattis non. Nunc
137
+ pretium scelerisque erat sit amet rutrum. Aliquam sit amet ornare mi.
138
+
139
+ Morbi lacus purus, elementum et leo nec, dictum dictum nulla. Sed
140
+ fringilla at elit venenatis molestie. Cras rhoncus enim sed interdum
141
+ sodales. Proin at sodales quam. Duis auctor libero mattis metus venenatis
142
+ pretium. Etiam bibendum bibendum nisi, quis vulputate nisi commodo ut.
143
+
144
+ Duis semper metus id quam venenatis euismod.
145
+
146
+
40
147
The last thing to do is to add a table of contents to the ``index.rst `` file,
41
148
so it knows how to organise the content you have created. At the end of the
42
149
file, add::
@@ -45,11 +152,9 @@ file, add::
45
152
:hidden:
46
153
47
154
plans
155
+ skills
48
156
49
- You can add additional pages if you wish. For example, if you added
50
- ``my-family.rst ``, you would need to add ``my-family `` below ``plans `` in the
51
- ``toctree `` (or indeed above it, if you wanted those sections in a different
52
- order).
157
+ Add additional pages if you wish.
53
158
54
159
This isn't the place for a primer on Sphinx and rST, so you should look for
55
160
other resources if you need guidance on more ambitious formatting at this
0 commit comments