Updated README

This commit is contained in:
Bartek Kryza
2022-03-23 23:35:35 +01:00
parent 67f4605e74
commit 6800baea55
3 changed files with 18 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
compilation_database_dir: debug
output_directory: docs/diagrams
generate_links:
link: "https://github.com/bkryza/clang-uml/blob/{{ git.commit }}/{{ element.source.path }}#L{{ element.source.line }}"
tooltip: "{{ element.name }}"
link: 'https://github.com/bkryza/clang-uml/blob/{{ git.commit }}/{{ element.source.path }}#L{{ element.source.line }}'
tooltip: '{% if "comment" in element %}{{ abbrv(trim(replace(element.comment, "\n+", " ")), 256) }}{% else %}{{ element.name }}{% endif %}'
diagrams:
main_package:
include!: uml/main_package_diagram.yml

View File

@@ -117,7 +117,7 @@ diagrams:
- myproject::detail
plantuml:
after:
- 'note left of @A(MyProjectMain) : Main class of myproject library.'
- 'note left of {{ alias("MyProjectMain") }}: Main class of myproject library.'
```
See ![here](docs/configuration_file.md) for detailed configuration file reference guide.

View File

@@ -27,6 +27,21 @@
* `before` - list of directives which will be added before the generated diagram
* `after` - list of directives which will be added after the generated diagram
### Template engine
`clang-uml` integrates [inja](https://github.com/pantor/inja) template engine, with several
additional functions which can be used in textual directives within the configuration files,
notes and to generate links and tooltips to diagrams.
The following, are the `clang-uml` additional template functions:
* `ltrim(string)` - left trims a string
* `rtrim(string)` - right trims a string
* `trim(string)` - trims a string
* `substr(string, offset, length)` - returns a substring of a string from offset of length
* `split(string)` - splits a string and returns a list of strings
* `replace(string, regex, replacement)` - returns a string with replace matches to regex with replacement string
* `abbrv(string, length)` - returns a string truncated to length including trailing ellipsis
* `alias(string)` - returns a PlantUML alias of an C++ entity represented by string name
## Example complete config