Skip to content

Commit ce5951c

Browse files
committed
Update CONTRIBUTING-RULES.md
1 parent bcd5562 commit ce5951c

File tree

1 file changed

+72
-27
lines changed

1 file changed

+72
-27
lines changed

CONTRIBUTING-RULES.md

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ This guide provides guidelines for contributing to IT-Wallet Technical Documenta
1515
- [Referencing RFC Documents](#referencing-rfc-documents)
1616
- [Important Syntax Notes](#important-syntax-notes)
1717
- [Figures and Images](#figures-and-images)
18-
- [Image Requirements](#image-requirements)
18+
- [Image Formats and Requirements](#image-formats-and-requirements)
19+
- [File Organization for Images](#file-organization-for-images)
20+
- [Adding Images to Documentation](#adding-images-to-documentation)
21+
- [SVG and PDF Images](#svg-and-pdf-images)
22+
- [PlantUML Diagrams](#plantuml-diagrams)
23+
- [Image Attributes](#image-attributes)
1924
- [Cross-Referencing Figures](#cross-referencing-figures)
2025
- [Tables](#tables)
2126
- [Table Requirements](#table-requirements)
@@ -131,51 +136,91 @@ These references will automatically link to the appropriate RFC document without
131136

132137
## Figures and Images
133138

134-
Use the `figure` directive for images, preferably in SVG format for diagrams:
139+
This section describes how to include figures and images in the documentation, supporting both HTML and PDF output formats.
140+
141+
### Image Formats and Requirements
142+
143+
The documentation supports two main approaches for figures:
144+
145+
1. **Static Images** (SVG and PDF)
146+
- SVG format is required for HTML output
147+
- PDF format is required for LaTeX/PDF output
148+
- Both formats must be provided for each image
149+
- A tool is available in `./docs/utils/svg2pdf.py` to automatically convert SVG to PDF
150+
151+
2. **PlantUML Diagrams**
152+
- All architecture, component, or sequence diagrams must be created using PlantUML
153+
- PlantUML's official Standard Library (stdlib) may be used if required
154+
- For technical details about available libraries, refer to [PlantUML's official Standard Library Documentation](https://plantuml.com/stdlib)
155+
156+
The approaches are mutually exclusive - use either static images OR PlantUML diagrams for a given figure.
157+
158+
### File Organization for Images
159+
160+
Images must be organized in specific directories based on their format:
161+
162+
- **SVG images**: Store in `./docs/en/images/svg/`
163+
- **PDF images**: Store in `./docs/en/images/pdf/`
164+
- **PlantUML diagrams**: Store source files in `./docs/en/plantuml/` with `.puml` extension
165+
166+
### Adding Images to Documentation
167+
168+
#### SVG and PDF Images
169+
170+
For static images, use conditional directives to include the appropriate format based on the output target:
135171

136172
```rst
137173
.. _fig_reference_name:
138-
.. figure:: ../../images/diagram-name.svg
139-
:figwidth: 90%
174+
175+
.. only:: format_html
176+
177+
.. figure:: ./images/svg/diagram-name.svg
178+
:alt: Description of the diagram
179+
:width: 100%
140180
:align: center
141-
:target: https://www.plantuml.com/plantuml/svg/ENCODED-URL
142181
143182
Caption text describing the figure.
144-
```
145183
146-
### Image Requirements
184+
.. only:: format_latex
147185
148-
- **Format**: All images must be in SVG format for optimal rendering and scalability
149-
- **Diagrams**: All architecture, component or sequence diagrams must be created using PlantUML with C4 Component modeling
150-
- **Attributes**:
151-
- `:figwidth:` - REQUIRED (usually specified as percentage, e.g., `90%`)
152-
- `:align:` - REQUIRED (typically `center`)
153-
- Caption text - REQUIRED (appears below the figure)
154-
- `:target:` - REQUIRED for PlantUML diagrams (must link to the PlantUML source)
155-
- Label (e.g., `.. _fig_reference_name:`) - Recommended for cross-referencing but optional. Use the prefix `_fig_` followed by the reference name
186+
.. figure:: ./images/pdf/diagram-name.pdf
187+
:alt: Description of the diagram
188+
:width: 100%
189+
:align: center
156190
157-
When working with figures, understand the difference between these key attributes:
191+
Caption text describing the figure.
192+
```
158193

159-
- **:figwidth:** Controls the width of the entire figure block, including the caption and any padding. It defines how much horizontal space the figure occupies in the document layout.
194+
#### PlantUML Diagrams
160195

161-
- **:width:** Controls only the width of the image itself, not the entire figure block. Use this when you need to resize just the image while allowing the caption to potentially be wider.
196+
For PlantUML diagrams, use the `plantuml` directive:
162197

163-
Example with both attributes:
164198
```rst
165-
.. figure:: ../../images/diagram-name.svg
166-
:figwidth: 90% # The entire figure block is 90% of the available width
167-
:width: 80% # The image itself is 80% of the figure block width
199+
.. _fig_reference_name:
200+
.. plantuml:: plantuml/diagram-name.puml
201+
:width: 99%
168202
:align: center
169-
:target: https://www.plantuml.com/plantuml/svg/ENCODED-URL
170-
171-
This is the caption that appears below the image.
203+
:alt: Description of the diagram
204+
:caption: `Caption text describing the figure. <https://www.plantuml.com/plantuml/svg/ENCODED-URL>`_
172205
```
173206

207+
Note that for PlantUML diagrams:
208+
- The `:caption:` attribute must include a link to the preview SVG on the PlantUML website
209+
- You do not need to use the `only::` directives as Sphinx will handle the output format automatically
210+
211+
### Image Attributes
212+
213+
When working with figures, understand the difference between these key attributes:
214+
215+
- **:figwidth:** Controls the width of the entire figure block, including the caption and any padding. It defines how much horizontal space the figure occupies in the document layout.
216+
217+
- **:width:** Controls only the width of the image itself, not the entire figure block. Use this when you need to resize just the image while allowing the caption to potentially be wider.
218+
174219
Other useful figure attributes:
175220
- **:height:** Controls the height of the image
176221
- **:scale:** Scales the image (e.g., `:scale: 50%`)
177-
- **:alt:** Provides alternative text for accessibility
178-
- **:name:** Used for internal references (can also use the separate label format shown above)
222+
- **:alt:** Provides alternative text for accessibility (REQUIRED)
223+
- **:align:** Specifies the alignment of the figure (typically `center`)
179224

180225
### Cross-Referencing Figures
181226

0 commit comments

Comments
 (0)