1
- How to Create Symfony Diagrams
2
- ==============================
1
+ How to Create Symfony Images
2
+ ============================
3
3
4
- Creating the Diagram
5
- --------------------
4
+ Creating Diagrams
5
+ -----------------
6
6
7
7
* Use [ Dia] [ 1 ] as the diagramming application;
8
8
* Use [ PT Sans Narrow] [ 2 ] as the only font in all diagrams (if possible, use
@@ -21,8 +21,7 @@ Creating the Diagram
21
21
In case of doubt, check the existing diagrams or ask to the
22
22
[ Symfony Documentation Team] [ 3 ] .
23
23
24
- Saving and Exporting the Diagram
25
- --------------------------------
24
+ ### Saving and Exporting the Diagram
26
25
27
26
* Save the original diagram in ` *.dia ` format in ` _images/sources/<folder-name> ` ;
28
27
* Export the diagram to SVG format and save it in ` _images/<folder-name> ` .
@@ -33,8 +32,7 @@ that transforms text into vector shapes (resulting file is larger in size, but
33
32
it's truly portable because text is displayed the same even if you don't have
34
33
some fonts installed).
35
34
36
- Including the Diagram in the Symfony Docs
37
- -----------------------------------------
35
+ ### Including the Diagram in the Symfony Docs
38
36
39
37
Use the following snippet to embed the diagram in the docs:
40
38
@@ -44,21 +42,57 @@ Use the following snippet to embed the diagram in the docs:
44
42
<object data="../_images/<folder-name>/<diagram-file-name>.svg" type="image/svg+xml"></object>
45
43
```
46
44
47
- Reasoning
48
- ---------
45
+ ### Reasoning
49
46
50
47
* Dia was chosen because it's one of the few applications which are free, open
51
48
source and compatible with Linux, macOS and Windows.
52
49
* Font, colors and line widths were chosen to be similar to the diagrams used
53
50
in the best tech books.
54
51
55
- Troubleshooting
56
- ---------------
52
+ ### Troubleshooting
57
53
58
54
* On some macOS systems, Dia cannot be executed as a regular application and
59
55
you must run the following console command instead:
60
56
` export DISPLAY=:0 && /Applications/Dia.app/Contents/Resources/bin/dia `
61
57
58
+ Creating Console Screenshots
59
+ ----------------------------
60
+
61
+ * Use [ Asciinema] [ 4 ] to record the console session locally:
62
+
63
+ ```
64
+ $ asciinema rec -c bash recording.cast
65
+ ```
66
+ * Use ` $ ` as the prompt in recordings. E.g. if you're using Bash, add the
67
+ following lines to your `` .bashrc `` :
68
+
69
+ ```
70
+ if [ "$ASCIINEMA_REC" = "1" ]; then
71
+ PS1="\e[37m$ \e[0m"
72
+ fi
73
+ ```
74
+ * Save the generated asciicast in ` _images/sources/<folder-name> ` .
75
+
76
+ ### Rendering the Recording
77
+
78
+ Rendering the recording can be a difficult task. The [ documentation team] [ 3 ]
79
+ is always ready to help you with this task (e.g. you can open a PR with
80
+ only the asciicast file).
81
+
82
+ * Use [ agg] [ 5 ] to generated a GIF file from the recording;
83
+ * Use the `` _images/sources/ascii-render.sh `` file to call agg:
84
+
85
+ ```
86
+ AGG_PATH=/path/to/agg ./_images/sources/ascii-render.sh recording.cast --cols 45 --rows 20
87
+ ```
88
+
89
+ This utility configures a predefined theme;
90
+ * Always configure `--cols`` (width) and `` --rows`` (height), try to use as
91
+ low as possible numbers. Do not exceed 70 columns;
92
+ * Save the generated GIF file in ` _images/<folder-name> ` .
93
+
62
94
[ 1 ] : http://dia-installer.de/
63
95
[ 2 ] : https://fonts.google.com/specimen/PT+Sans+Narrow
64
96
[ 3 ] : https://symfony.com/doc/current/contributing/code/core_team.html
97
+ [ 4 ] : https://github.com/asciinema/asciinema
98
+ [ 5 ] : https://github.com/asciinema/agg
0 commit comments