Skip to content

Commit 8129797

Browse files
committed
Fixed issues in docs
1 parent ba9e435 commit 8129797

10 files changed

+87
-60
lines changed

docs/class_diagrams.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ type of relationship generated in the class diagrams.
9090

9191

9292
By default, a member from which a relationship has been added to the diagram
93-
between 2 classes will also be rendered inside the class. This behaviour can be
94-
however disabled by adding the following option to the diagram definition:
93+
between 2 classes will also be rendered inside as a property inside the class
94+
box. This behaviour can be however disabled by adding the following option to
95+
the diagram definition:
96+
9597
```yaml
9698
include_relations_also_as_members: false
9799
```
@@ -158,7 +160,7 @@ which results in the following diagram:
158160
![t00036_class](test_cases/t00036_class.svg)
159161

160162
### Directory packages
161-
In case the code base is structured based on subdirectory instead of namespaces
163+
In case the code base is structured based on subdirectories instead of namespaces
162164
(or this is a C project, where namespaces are not available), packages can be
163165
generated based on the location of a given declaration in the filesystem tree,
164166
by adding also the following option:
@@ -175,8 +177,10 @@ which results in the following diagram:
175177
> properly configured for your project, if necessary add `relative_to` option to
176178
> denote the root path against which all relative paths in the config file are
177179
> calculated.
180+
178181

179182
### Module packages
183+
180184
Finally, to generate UML packages in the diagram based on C++20 modules, use
181185
the following option:
182186

@@ -213,7 +217,7 @@ this can be easily achieved using `context` inclusion filter:
213217
```
214218

215219
By default, the diagram will include only elements in direct relationship to
216-
`ns1::MyClass`, but an addition option called `radius` can be added to this
220+
`ns1::MyClass`, but an additional option called `radius` can be added to this
217221
filter, which will extend the context to elements related to `ns1::MyClass`
218222
through at most N relationships, e.g:
219223

docs/common_options.md

+32-23
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,34 @@
1515
<!-- tocstop -->
1616

1717
## Overall configuration file structure
18-
By default, `clang-uml` will look for file `.clang-uml` in the project's directory and read all diagrams definitions
19-
configuration from it. The file must be specified in YAML and it's overall structure is as follows:
18+
By default, `clang-uml` will look for file `.clang-uml` in the project's
19+
directory and read all diagram definitions configuration from it. The file must
20+
be specified in YAML and it's overall structure is as follows:
2021

2122
```yaml
22-
# common options for all diagrams
23-
...
23+
# Common options for all diagrams
24+
# ...
25+
# Diagram definitions
2426
diagrams:
2527
first_diagram_name:
2628
type: class|sequence|package|include
27-
# diagram specific options
28-
...
29+
# Diagram specific options
30+
# ...
2931
second_diagram_name:
3032
type: class|sequence|package|include
31-
# diagram specific options
32-
...
33-
...
33+
# Diagram specific options
34+
# ...
35+
# More diagrams
36+
# ...
3437
```
3538

36-
The top level common options are inherited by specific diagrams, if the option is applicable to them and they themselves
37-
do not override this option.
39+
The top level common options are inherited by specific diagrams, if the option
40+
is applicable to them and they themselves do not override this option.
3841

3942
For detailed reference of all configuration options see [here](./configuration_file.md).
4043

41-
Effective configuration, including default values can be printed out in YAML format using the following option:
44+
Effective configuration, including default values can be printed out in YAML
45+
format using the following option:
4246

4347
```bash
4448
clang-uml --dump-config
@@ -56,24 +60,29 @@ diagrams:
5660
```
5761
5862
## Translation unit glob patterns
59-
One of the key options of the diagram configuration is the list of translation units, which should be parsed to
60-
get all necessary information for a diagram.
63+
One of the key options of the diagram configuration is the list of translation
64+
units, which should be parsed to get all necessary information for a diagram.
6165
62-
The syntax is simple and based on glob patterns, which can be added to the configuration file as follows:
66+
The syntax is simple and based on glob patterns, which can be added to the
67+
configuration file as follows:
6368
6469
```yaml
6570
glob:
6671
- src/dir1/*.cc
6772
- src/dir3/*.cc
6873
```
6974
70-
The glob patterns only need to match the translation units, which are also in the `compile_commands.json` file, i.e.
71-
any files that match the glob patterns, but are not in `compile_commands.json` will be ignored. In case the `glob`
72-
pattern set does not match any translation units an error will be printed on the standard output.
75+
The glob patterns only need to match the translation units, which are also in
76+
the `compile_commands.json` file, i.e. any files that match the glob patterns,
77+
but are not in `compile_commands.json` will be ignored. In case the `glob`
78+
pattern set does not match any translation units an error will be printed on
79+
the standard output.
7380

74-
For small projects, the `glob` property can be omitted, which will result in `clang-uml` parsing all translation units
75-
from `compile_commands.json` for the diagram. However, for large projects, constraining the number of translation units
76-
for each diagram to absolute minimum will significantly decrease the diagram generation times.
81+
For small projects, the `glob` property can be omitted, which will result in
82+
`clang-uml` parsing all translation units from `compile_commands.json` for
83+
the diagram. However, for large projects, constraining the number of translation
84+
units for each diagram to minimum necessary to discover all necessary diagram
85+
elements will significantly decrease the diagram generation times.
7786

7887
## Custom directives
7988
In case it's necessary to add some custom PlantUML or MermaidJS declarations
@@ -122,13 +131,13 @@ the generated PlantUML diagram will contain comments before each line containing
122131
the source location of the specific diagram element.
123132

124133
## Resolving include path and compiler flags issues
125-
Due to the fact, that your project can be compiled with different compilers
134+
Due to the fact, that a project can be compiled with different compilers
126135
and toolchains, the system paths and compilation flags detected by the Clang
127136
version linked to your `clang-uml` installation might differ from the ones
128137
actually used to compile your project.
129138

130139
> This is often an issue on macOS, when `clang-uml` uses Homebrew version of LLVM
131-
> and your project was built using system Apple Clang
140+
> and a project was built using system Apple Clang.
132141

133142
Typically, this results in error messages on the console during diagram
134143
generation, such as:

docs/diagram_filters.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ to your diagram configuration:
4040
```
4141
4242
Some filters accept either specified exact values, some support regular
43-
expressions while some except glob patterns.
43+
expressions while some accept glob patterns.
4444
4545
For filters which accept regular expressions, the regular expression has to
4646
be provided as a map ```r: 'pattern'``` due to the fact the pointer (```*```) otherwise
@@ -54,8 +54,6 @@ exclude:
5454
- r: '.*test.*'
5555
```
5656

57-
`paths` filter is currently the only filter which accepts `glob` like patterns.
58-
5957
The following table specifies the values allowed in each filter:
6058

6159
| Filter name | Possible values | Example values |
@@ -64,7 +62,7 @@ The following table specifies the values allowed in each filter:
6462
| `modules` | Qualified name or regex | ```mod1.mod2:par1```, ```r: '.*impl.*'``` |
6563
| `elements` | Qualified name or regex | ```ns1::ns2::ClassA```, ```r: '.*detail.*'``` |
6664
| `element_types` | Types of diagram elements | ```class```, ```enum```, ```concept``` |
67-
| `paths` | File or dir path or glob pattern | ```src/dir1```, ```src/dir2/a.cpp```, ```src/dir3/*.cpp``` |
65+
| `paths` | File or dir path | ```src/dir1```, ```src/dir2/a.cpp```, ```src/dir3/*.cpp``` |
6866
| `context` | Qualified name or regex | ```ns1::ns2::ClassA```, ```r: 'ns1::ns2::ClassA.+'``` |
6967
| `relationships` | Type of relationship | ```inheritance```, ```composition```, ```aggregation```, ```ownership```, ```association```, ```instantiation```, ```friendship```, ```dependency``` |
7068
| `subclasses` | Qualified name or regex | ```ns1::ns2::ClassA```, ```r: 'ns1::ns2::ClassA.+'``` |

docs/generator_types.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ instance:
5151
cmd: "/usr/bin/plantuml -tsvg \"diagrams/{}.puml\""
5252
```
5353

54+
Furthermore, `plantuml` generator accepts basic styling options for customizing
55+
diagram look and layout, e.g.:
56+
```yaml
57+
plantuml:
58+
style:
59+
# Apply this style to all classes in the diagram
60+
class: "#aliceblue;line:blue;line.dotted;text:blue"
61+
# Apply this style to all packages in the diagram
62+
package: "#back:grey"
63+
# Make all template instantiation relations point upwards and draw them
64+
# as green and dotted lines
65+
instantiation: "up[#green,dotted]"
66+
```
67+
5468
An example PlantUML diagram is presented below:
5569

5670
```plantuml
@@ -121,9 +135,9 @@ example:
121135
- 'note for {{ alias("config") }} "General options not used by diagrams."'
122136
```
123137

124-
will add before the diagram contents (right after diagram type,
125-
e.g. `classDiagram`) diagram direction hint, and after each diagram contents
126-
2 notes attached to elements.
138+
will add a diagram direction hint before the diagram contents (right after
139+
diagram type, e.g. `classDiagram`), and after each diagram contents
140+
2 notes attached to classes `inheritable_diagram_options` and `config`.
127141

128142
This generator also accepts a `cmd` parameter to specify a command to execute
129143
on the generated MermaidJS source file to generate actual diagram image, for

docs/include_diagrams.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ source files (matched by `glob`) and not their dependencies, for example:
5656
![t40001_include](./test_cases/t40001_include.svg)
5757

5858
Please note that generating include diagram, which contains third party and
59-
system library headers will result in a huge diagram that will be unlikely to
59+
system library headers will result in a huge diagram that is unlikely to
6060
be useful.

docs/installation.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#### Ubuntu
2424

2525
```bash
26-
# Currently supported Ubuntu versions are Focal, Jammy, Lunar and Mantic
26+
# Currently supported Ubuntu versions are Focal, Jammy and Mantic
2727
sudo add-apt-repository ppa:bkryza/clang-uml
2828
sudo apt update
2929
sudo apt install clang-uml
@@ -33,16 +33,16 @@ sudo apt install clang-uml
3333

3434
```bash
3535
# Fedora 37
36-
wget https://github.com/bkryza/clang-uml/releases/download/0.4.2/clang-uml-0.4.2-1.fc37.x86_64.rpm
37-
sudo dnf install ./clang-uml-0.4.2-1.fc37.x86_64.rpm
36+
wget https://github.com/bkryza/clang-uml/releases/download/0.5.1/clang-uml-0.5.1-1.fc37.x86_64.rpm
37+
sudo dnf install ./clang-uml-0.5.1-1.fc37.x86_64.rpm
3838

3939
# Fedora 38
40-
wget https://github.com/bkryza/clang-uml/releases/download/0.4.2/clang-uml-0.4.2-1.fc38.x86_64.rpm
41-
sudo dnf install ./clang-uml-0.4.2-1.fc38.x86_64.rpm
40+
wget https://github.com/bkryza/clang-uml/releases/download/0.5.1/clang-uml-0.5.1-1.fc38.x86_64.rpm
41+
sudo dnf install ./clang-uml-0.5.1-1.fc38.x86_64.rpm
4242

4343
# Fedora 39
44-
wget https://github.com/bkryza/clang-uml/releases/download/0.4.2/clang-uml-0.4.2-1.fc39.x86_64.rpm
45-
sudo dnf install ./clang-uml-0.4.2-1.fc39.x86_64.rpm
44+
wget https://github.com/bkryza/clang-uml/releases/download/0.5.1/clang-uml-0.5.1-1.fc39.x86_64.rpm
45+
sudo dnf install ./clang-uml-0.5.1-1.fc39.x86_64.rpm
4646
```
4747

4848
#### Conda
@@ -79,7 +79,7 @@ release/src/clang-uml --help
7979

8080
# To build using a specific installed version of LLVM use:
8181
LLVM_VERSION=16 make release
82-
# or specify path to a specific llvm-config binary, e.g.:
82+
# or specify a path to a specific llvm-config binary, e.g.:
8383
LLVM_CONFIG_PATH=/usr/bin/llvm-config-16 make release
8484
# or directly specify the path where LLVMConfig.cmake can be found on your system, e.g.:
8585
CMAKE_PREFIX=/usr/lib/llvm-16/lib/cmake/llvm make release
@@ -111,7 +111,7 @@ CMAKE_PREFIX=/usr/local/opt/llvm/lib/cmake/llvm make release
111111

112112
##### Visual Studio native build
113113

114-
These steps present how to build and use `clang-uml` natively using Visual Studio only.
114+
These steps present how to build and use `clang-uml` natively using Microsoft Visual Studio only.
115115

116116
First, install the following dependencies manually:
117117

docs/package_diagrams.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<!-- tocstop -->
88

99
Package diagrams are simple diagrams, which can be useful to visualize a high
10-
level structure of a C++ project, by rendering project's namespaces or
11-
subdirectories as UML packages and their interdependencies.
10+
level structure of a C++ project, by rendering project's namespaces,
11+
subdirectories or modules as UML packages and their interdependencies.
1212

1313
The minimal config required to generate a package diagram is presented below:
1414
```yaml
@@ -163,7 +163,8 @@ the configuration file:
163163
package_type: directory
164164
```
165165
166-
for example check out this diagram
166+
for example check out this diagram (you can click on package names to see the
167+
corresponding source directory):
167168
![t30011_package](./test_cases/t30011_package.svg)
168169
169170
Module based packages can be enabled using the following option:
@@ -172,8 +173,9 @@ Module based packages can be enabled using the following option:
172173
package_type: module
173174
```
174175
175-
for example check out this diagram
176-
![t30014_package](./test_cases/t30011_package.svg)
176+
for example check out this diagram (you can click on package names to see the
177+
corresponding module source):
178+
![t30014_package](./test_cases/t30012_package.svg)
177179
178180
Diagrams can be rendered relative to a specific module using `using_module`
179181
option:

docs/quick_start.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ To add an initial class diagram to your project, follow these steps:
5252
mmdc -i diagrams/some_class_diagram.mmd -o diagrams/some_class_diagram.svg
5353
```
5454
55-
Steps 3 and 4 can be combined into one step like follows:
55+
Steps 3 and 4 can be combined into one step:
5656
```
57-
clang-uml -p -n some_class_diagram -g plantuml -r --plantuml-cmd="plantuml -tsvg diagrams/{}.puml"
57+
clang-uml -p -n some_class_diagram -g plantuml -r --plantuml-cmd="/usr/bin/plantuml -tsvg diagrams/{}.puml"
5858
```
5959
where `-r` enables diagram rendering and `--plantuml-cmd` specifies command
6060
to execute on each generated diagram.

docs/sequence_diagrams.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ there are 3 types of constraints:
7474
locations
7575

7676
Currently, the constraints can be a method or a free function, both specified
77-
using the full signature of the function, e.g.
77+
using the full signature of the function, e.g.:
7878

7979
```yaml
8080
from:
@@ -97,8 +97,8 @@ and `to` locations as follows:
9797
function: "clanguml::t20034::A::a2()"]
9898
```
9999

100-
To find the exact function signature which, can be used as a `from` location,
101-
run `clang-uml` as follows:
100+
To find the exact function signature, which can be used as a `from` location,
101+
run `clang-uml` as follows (assuming the function of interest is called `main`):
102102

103103
```bash
104104
clang-uml --print-from -n main_sequence | grep main
@@ -112,7 +112,7 @@ clang-uml --print-to -n main_sequence | grep main
112112

113113
Command line flags `--print-from` and `--print-to` will print on stdout all
114114
functions and methods available in the diagram model, and each line of this
115-
output can be directly used as a value of `start_from`, `from_to` or `to`
115+
output can be directly used as a value of `from`, `from_to` or `to`
116116
properties in the config file.
117117

118118
Since that list can be quite large, it's best to filter the output to limit
@@ -141,7 +141,7 @@ tentative support, which follows the following rules:
141141
* If lambda expression is passed to some function or method, which is outside
142142
the scope of the diagram (e.g. used in `std::transform` call) the call will
143143
not be generated
144-
* If the lambda is passed as template parameter in instantiation it will not
144+
* If the lambda is passed as template argument in instantiation it will not
145145
be generated
146146

147147
Another issue is the naming of lambda participants. Currently, each lambda is
@@ -257,7 +257,7 @@ The default participant order in the sequence diagram can be suboptimal in the
257257
sense that consecutive calls can go right, then left, then right again
258258
depending on the specific call chain in the code. It is however possible to
259259
override this order in the diagram definition using `participants_order`
260-
property, for instance like this test case:
260+
property, for instance like this:
261261

262262
```yaml
263263
diagrams:
@@ -372,5 +372,5 @@ for each sequence diagram, which should include these comments.
372372

373373
In case only selected messages should have some specific comments, instead
374374
of enabling the `generate_message_comments` option, it is possible to use
375-
`\uml{note TEXT}` directive in the comment above the expression, see
375+
`\\uml{note TEXT}` directive in the comment above the expression, see
376376
[t20001](test_cases/t20001_sequence.svg).

docs/troubleshooting.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## General issues
2424

25-
### clang-uml crashes when generating diagram
25+
### clang-uml crashes when generating a diagram
2626

2727
If `clang-uml` crashes with a segmentation fault, it is possible to trace the
2828
exact stack trace of the fault using the following steps:
@@ -346,7 +346,7 @@ the exact string representation of the function signature as seen by `clang-uml`
346346
To find the exact function signature run `clang-uml` as follows:
347347

348348
```bash
349-
clang-uml -n my_sequence_diagram --print-start-from | grep foo
349+
clang-uml -n my_sequence_diagram --print-from | grep foo
350350
```
351351

352352
Command line flag `--print-from` will print on stdout all functions

0 commit comments

Comments
 (0)