mirror of
https://github.com/bkryza/clang-uml.git
synced 2025-05-17 19:22:19 +08:00
1.5 KiB
1.5 KiB
Quick start
To add an initial class diagram to your project, follow these steps:
- Enter your projects top level directory and run:
$ clang-uml --init
- Edit the generated
.clang-uml
file and set the following:# Path to `compile_commands.json` directory compilation_database_dir: . # Path to diagram output directory output_directory: puml diagrams: # This is the name of the diagram some_class_diagram: type: class # Parse only translation units in `src` subdirectory glob: - src/*.cc # Render all names relative to `myproject` namespace using_namespace: - myproject include: # Include only elements in `myproject` namespace namespaces: - myproject exclude: # Exclude elements in `myproject::detail` namespace namespaces: - myproject::detail
- Run
clang-uml
in the projects top directory:$ clang-uml
- Generate SVG images from the PlantUML diagrams:
$ plantuml -tsvg puml/*.puml
- Add another diagram:
$ clang-uml --add-sequence-diagram another_diagram
- Now list the diagrams defined in the config:
$ clang-uml -l The following diagrams are defined in the config file: - another_diagram [sequence] - some_class_diagram [class]
- Generate only the new diagram:
clang-uml -n another_diagram