1
+ :navigation-title: Images
2
+
1
3
.. include :: /Includes.rst.txt
2
4
.. index :: pair: reST; Images
3
5
.. _how-to-document-images :
4
- .. _rest-images :
5
6
.. _images :
6
7
7
- ======
8
- Images
9
- ======
10
-
11
- .. index :: automatic screenshot generation
12
- .. _automatic-screenshots :
13
-
14
- Automatic screenshot generation
15
- ===============================
8
+ ==================================
9
+ Using images in ReST documentation
10
+ ==================================
16
11
17
- See the `README in the t3docs-screenshots <https://github.com/TYPO3-Documentation/t3docs-screenshots/blob/main/README.rst >`__
18
- for more information on automating screenshot generation.
12
+ You can use the `The example screenshot project <https://docs.typo3.org/permalink/h2document:screenshot-project >`_.
13
+ It already follows most of the rules stated below. There has been no automatic
14
+ screenshot tool since TYPO3 v11 as it proved to be to complicated to maintain.
19
15
20
- .. index :: reST directives; image
16
+ .. attention ::
21
17
22
- How to use images
23
- =================
18
+ For official and Core manuals please follow the
19
+ ` Guidelines for creating images < https://docs.typo3.org/permalink/h2document:guidelines-for-images >`_.
24
20
25
- Use the `.. image:: ` directive with additional parameters.
26
-
27
- Use `.. figure:: ` if you want to add a caption to your image.
28
- You can use the same parameters in figure that are defined for image.
29
-
30
- The
31
- additional parameters must be indented one level (add 4 spaces to indent).
21
+ .. _rest-images :
32
22
33
- Recommended parameters for images:
23
+ Images and figures in Rest
24
+ ==========================
34
25
35
- * `:class: with-shadow `
26
+ We recommend to use the `.. figure:: ` directive. It works just like
27
+ `.. image:: ` save that you can add a descriptive text as content.
36
28
37
- Alternatively, a border can be defined:
29
+ Always use the parameter `:alt: ` to add a descriptive text for visually impaired
30
+ and search engine / artificial intelligence bots scanning our docs.
38
31
39
- * ` :class: with-border `
32
+ Example:
40
33
34
+ .. literalinclude :: /_CodeSnippets/_Figure.rts.txt
41
35
42
- Optional parameters for images:
36
+ Optional parameters for images and figures :
43
37
44
- * `:alt: ` : alt text
45
38
* `:target: ` link target
46
39
* `:width: ` : width of image, use for example px (for example `:width: 100px `
47
40
* `:scale: ` : scale images, for example `:scale: 65 `
48
41
49
42
Additional parameters can be found on the docutils page `reStructuredText Directives
50
43
<http://docutils.sourceforge.net/0.4/docs/ref/rst/directives.html#image> `__
51
44
52
- Examples
53
- ========
54
-
55
- .. index :: reST; Image scaling
45
+ .. _image-scaled :
56
46
57
47
Example 1: Scaled image with shadow and link target
58
- ---------------------------------------------------
48
+ ===================================================
59
49
60
50
.. image :: /_Images/a4.jpg
61
51
:alt: Left floating image
@@ -66,37 +56,20 @@ Example 1: Scaled image with shadow and link target
66
56
.. code-block :: rst
67
57
:linenos:
68
58
69
- .. image :: /_Images/a4.jpg
59
+ .. figure :: /_Images/a4.jpg
70
60
:alt: some image
71
61
:target: https://typo3.org
72
62
:class: with-shadow
73
63
:scale: 50
74
64
65
+ .. _image-caption :
75
66
76
- **line 1: **
77
- image directive with path
78
-
79
- **line 2: **
80
- alt-Text
81
-
82
- **line 3: **
83
- link target
84
-
85
- **line 4: **
86
- use a shadow on the image
87
-
88
-
89
- .. index ::
90
- reST directives; figure
91
- reST; Image caption
92
-
93
- Example 2: Image with caption
94
- -----------------------------
67
+ Example 2: Image with caption and fixed width
68
+ =============================================
95
69
96
70
.. figure :: /_Images/a4.jpg
97
71
:alt: Left floating image
98
72
:target: https://typo3.org
99
- :class: with-shadow
100
73
:width: 100px
101
74
102
75
This is the image caption
@@ -107,75 +80,6 @@ Example 2: Image with caption
107
80
.. figure:: /_Images/a4.jpg
108
81
:alt: some image
109
82
:target: https://typo3.org
110
- :class: with-shadow
111
83
:width: 100px
112
84
113
85
This is the image caption
114
-
115
- **line 5: **
116
- width of image
117
-
118
-
119
- Example 3: Image with fixed width
120
- ---------------------------------
121
-
122
- .. image :: /_Images/a4.jpg
123
- :alt: Left floating image
124
- :target: https://typo3.org
125
- :class: with-shadow
126
- :width: 100px
127
-
128
-
129
- .. code-block :: rst
130
- :linenos:
131
-
132
- .. image:: /_Images/a4.jpg
133
- :alt: some image
134
- :target: https://typo3.org
135
- :class: with-shadow
136
- :width: 100px
137
-
138
- **line 5: **
139
- width of image
140
-
141
-
142
- .. index :: reST; Image floating
143
-
144
-
145
- Example 4: Image with float-left
146
- --------------------------------
147
-
148
- .. image :: /_Images/a4.jpg
149
- :alt: Left floating image
150
- :target: https://typo3.org
151
- :class: with-shadow float-left
152
-
153
- Some text ... (will be displayed on the right of the image).
154
-
155
- .. rst-class :: clear-both
156
-
157
-
158
- .. code-block :: rst
159
-
160
- .. image:: /_Images/a4.jpg
161
- :alt: Left floating image
162
- :target: https://typo3.org
163
- :class: with-shadow float-left
164
-
165
- Some text ... (will be displayed on the right of the image)
166
-
167
- .. rst-class:: clear-both
168
-
169
-
170
- .. hint ::
171
-
172
- When using float-left, make sure the text is suitable for
173
- wrapping around images. Here, we use `.. rst-class:: clear-both `
174
- to reset the floating and start on the left again.
175
-
176
-
177
- Example 5: Image with border
178
- ----------------------------
179
-
180
- .. image :: /_Images/a4.jpg
181
- :class: with-border
0 commit comments