1- How to Create Symfony Diagrams
2- ==============================
1+ How to Create Symfony Images
2+ ============================
33
4- Creating the Diagram
5- --------------------
4+ Creating Diagrams
5+ -----------------
66
77* Use [ Dia] [ 1 ] as the diagramming application;
88* Use [ PT Sans Narrow] [ 2 ] as the only font in all diagrams (if possible, use
@@ -21,8 +21,7 @@ Creating the Diagram
2121In case of doubt, check the existing diagrams or ask to the
2222[ Symfony Documentation Team] [ 3 ] .
2323
24- Saving and Exporting the Diagram
25- --------------------------------
24+ ### Saving and Exporting the Diagram
2625
2726* Save the original diagram in ` *.dia ` format in ` _images/sources/<folder-name> ` ;
2827* 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
3332it's truly portable because text is displayed the same even if you don't have
3433some fonts installed).
3534
36- Including the Diagram in the Symfony Docs
37- -----------------------------------------
35+ ### Including the Diagram in the Symfony Docs
3836
3937Use the following snippet to embed the diagram in the docs:
4038
@@ -44,21 +42,59 @@ Use the following snippet to embed the diagram in the docs:
4442 <object data="../_images/<folder-name>/<diagram-file-name>.svg" type="image/svg+xml"></object>
4543```
4644
47- Reasoning
48- ---------
45+ ### Reasoning
4946
5047* Dia was chosen because it's one of the few applications which are free, open
5148 source and compatible with Linux, macOS and Windows.
5249* Font, colors and line widths were chosen to be similar to the diagrams used
5350 in the best tech books.
5451
55- Troubleshooting
56- ---------------
52+ ### Troubleshooting
5753
5854* On some macOS systems, Dia cannot be executed as a regular application and
5955 you must run the following console command instead:
6056 ` export DISPLAY=:0 && /Applications/Dia.app/Contents/Resources/bin/dia `
6157
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+ * Install the [ JetBrains Mono] [ 6 ] font;
84+ * Use the `` _images/sources/ascii-render.sh `` file to call agg:
85+
86+ ```
87+ AGG_PATH=/path/to/agg ./_images/sources/ascii-render.sh recording.cast --cols 45 --rows 20
88+ ```
89+
90+ This utility configures a predefined theme;
91+ * Always configure `--cols`` (width) and `` --rows`` (height), try to use as
92+ low as possible numbers. Do not exceed 70 columns;
93+ * Save the generated GIF file in ` _images/<folder-name> ` .
94+
6295[ 1 ] : http://dia-installer.de/
6396[ 2 ] : https://fonts.google.com/specimen/PT+Sans+Narrow
6497[ 3 ] : https://symfony.com/doc/current/contributing/code/core_team.html
98+ [ 4 ] : https://github.com/asciinema/asciinema
99+ [ 5 ] : https://github.com/asciinema/agg
100+ [ 6 ] : https://www.jetbrains.com/lp/mono/
0 commit comments