Skip to content

Commit 904bce3

Browse files
authored
[TASK] Improve docs on creating images (#491)
* [TASK] Advertise the Screenshot project * [TASK] Improve docs on creating images
1 parent dd8e799 commit 904bce3

File tree

6 files changed

+80
-152
lines changed

6 files changed

+80
-152
lines changed

Documentation/Advanced/GuidelinesForImages.rst

+28-16
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1-
.. include:: /Includes.rst.txt
2-
.. index::
3-
! Images
4-
Screenshots
5-
see: Screenshots; Images
6-
.. _guidelines-for-images:
1+
.. include:: /Includes.rst.txt
2+
.. index::
3+
! Images
4+
Screenshots
5+
see: Screenshots; Images
6+
.. _guidelines-for-images:
77

88
==============================
99
Guidelines for creating images
1010
==============================
1111

12-
Read here how to embed an image into ReST: :ref:`Images <h2document:images>`.
12+
For accessibility reasons **always** provide an alt text:
1313

14-
For accessibility reasons always provide an alt text.
14+
.. literalinclude:: /_CodeSnippets/_Figure.rts.txt
1515

16-
.. _guidelines-for-images-formats:
16+
More option for embedding images into ReST: :ref:`Images <h2document:images>`.
17+
18+
.. _guidelines-for-images-formats:
1719

1820
Image formats
19-
-------------
21+
=============
2022

2123
* It is recommended to use PNG for bitmaps (for example screenshots, photographs)
2224
and SVG for vector graphics images. In any case, you can use .png.
2325

24-
25-
.. _guidelines-for-images-screenshot:
26+
.. _guidelines-for-images-screenshot:
27+
.. _automatic-screenshots:
2628

2729
Guidelines for screenshots
2830
==========================
2931

3032
.. note::
31-
We do not have an automatic screenshot tool working with current TYPO3
32-
versions at the moment. The automatic screenshot tool we were working on
33-
never worked beyond TYPO3 11 LTS.
33+
You can use the `The example screenshot project <https://docs.typo3.org/permalink/h2document:screenshot-project>`_.
34+
It already follows most of the rules stated below. There has been no automatic
35+
screenshot tool since TYPO3 v11 as it proved to be to complicated to maintain.
3436

3537
* Before adding a screenshot consider if one is necessary. Each new screenshot
3638
requires maintenance.
@@ -53,7 +55,17 @@ Guidelines for screenshots
5355
* When reviewing screenshots take into consideration that taking screenshots
5456
is a lot of effort.
5557

56-
.. _guidelines-for-images-screenshot-with-grafics:
58+
.. _screenshot-project:
59+
60+
The example screenshot project
61+
==============================
62+
63+
We have a ready to use TYPO3 project that you can run in GitHub Codespaces
64+
or locally on DDEV to make screenshots:
65+
66+
`Ready to use Project for screenshots <https://github.com/TYPO3-Documentation/site-introduction/blob/main/Readme.md>`_
67+
68+
.. _guidelines-for-images-screenshot-with-grafics:
5769

5870
Guidelines for screenshots with graphics elements
5971
=================================================

Documentation/Basics/RstCheatSheet.rst

+1-6
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,7 @@ confval menues: :ref:`rest-confval`.
142142
Figures and Images
143143
==================
144144

145-
.. code-block:: rst
146-
147-
.. figure:: /_Images/a4.jpg
148-
:alt: some image
149-
150-
The caption of the image
145+
.. literalinclude:: /_CodeSnippets/_Figure.rts.txt
151146

152147
* :ref:`Images in reST <h2document:images>`
153148
* :ref:`Guidelines for creating images <h2document:guidelines-for-images>`

Documentation/Reference/ReStructuredText/Graphics/Diagrams.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ PlantUML diagrams
1111
In order to render diagrams in the TYPO3 documentation,
1212
`PlantUML <https://plantuml.com/>`_ is integrated into the rendering process.
1313

14-
Embedded UML diagrams
15-
=====================
16-
17-
Simple diagrams can be embedded directly into the reStructuredText markup:
14+
Basic diagrams can be embedded directly into the reStructuredText markup:
1815

1916
.. code-block:: rst
2017
:caption: Documentation/SomeFile.rst
@@ -31,6 +28,8 @@ This will be rendered as:
3128

3229
class -> otherClass : message
3330

31+
.. _PlantUML-diagrams-included:
32+
3433
Include a PlantUML file
3534
=======================
3635

Original file line numberDiff line numberDiff line change
@@ -1,61 +1,51 @@
1+
:navigation-title: Images
2+
13
.. include:: /Includes.rst.txt
24
.. index:: pair: reST; Images
35
.. _how-to-document-images:
4-
.. _rest-images:
56
.. _images:
67

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+
==================================
1611

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.
1915

20-
.. index:: reST directives; image
16+
.. attention::
2117

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>`_.
2420

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:
3222

33-
Recommended parameters for images:
23+
Images and figures in Rest
24+
==========================
3425

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.
3628

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.
3831

39-
* `:class: with-border`
32+
Example:
4033

34+
.. literalinclude:: /_CodeSnippets/_Figure.rts.txt
4135

42-
Optional parameters for images:
36+
Optional parameters for images and figures:
4337

44-
* `:alt:` : alt text
4538
* `:target:` link target
4639
* `:width:` : width of image, use for example px (for example `:width: 100px`
4740
* `:scale:` : scale images, for example `:scale: 65`
4841

4942
Additional parameters can be found on the docutils page `reStructuredText Directives
5043
<http://docutils.sourceforge.net/0.4/docs/ref/rst/directives.html#image>`__
5144

52-
Examples
53-
========
54-
55-
.. index:: reST; Image scaling
45+
.. _image-scaled:
5646

5747
Example 1: Scaled image with shadow and link target
58-
---------------------------------------------------
48+
===================================================
5949

6050
.. image:: /_Images/a4.jpg
6151
:alt: Left floating image
@@ -66,37 +56,20 @@ Example 1: Scaled image with shadow and link target
6656
.. code-block:: rst
6757
:linenos:
6858
69-
.. image:: /_Images/a4.jpg
59+
.. figure:: /_Images/a4.jpg
7060
:alt: some image
7161
:target: https://typo3.org
7262
:class: with-shadow
7363
:scale: 50
7464
65+
.. _image-caption:
7566

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+
=============================================
9569

9670
.. figure:: /_Images/a4.jpg
9771
:alt: Left floating image
9872
:target: https://typo3.org
99-
:class: with-shadow
10073
:width: 100px
10174

10275
This is the image caption
@@ -107,75 +80,6 @@ Example 2: Image with caption
10780
.. figure:: /_Images/a4.jpg
10881
:alt: some image
10982
:target: https://typo3.org
110-
:class: with-shadow
11183
:width: 100px
11284
11385
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
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
.. include:: /Includes.rst.txt
22
.. _rest-images-diagrams:
33

4-
===========================
5-
Graphs, images and diagrams
6-
===========================
4+
====================
5+
Figures and diagrams
6+
====================
7+
8+
You can upload images in any folder below `Documentation` and use it like that:
9+
10+
.. literalinclude:: /_CodeSnippets/_Figure.rts.txt
11+
12+
For details see `Using images in ReST documentation <https://docs.typo3.org/permalink/h2document:images>`_.
13+
14+
You can also use `Embedded PlantUML diagrams <https://docs.typo3.org/permalink/h2document:plantuml-diagrams>`_.
15+
16+
.. attention::
17+
18+
For official and Core manuals please follow the
19+
`Guidelines for creating images <https://docs.typo3.org/permalink/h2document:guidelines-for-images>`_.
720

821
.. toctree::
922
:titlesonly:
1023
:glob:
1124

25+
Images
1226
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. figure:: /_Images/a4.jpg
2+
:alt: some image
3+
4+
This is the image caption

0 commit comments

Comments
 (0)