Make UML from a directory of rust files.
The dot binary from graphviz package must exist in your path. This is usually
provided by the graphviz package in your package manager of choice.
Note that the rust-toolchain.toml specifies an older nightly toolchain. Newer
toolchains will require source changes. Nightly is required to use
#![feature(rustc_private)].
The library can be executed via the ml example:
--src_namearg will name the generated.dotand.svgfiles--src_dirshould point to thesrc/directory of the crate that you are modeling
cargo run --example ml -- --src_name my_crate --src_dir /Users/me/crates/my_crate/srcThe output will be in the target/doc/<src_name> directory. One of the files is
an SVG that can be viewed with a web browser.
The batch example can process multiple modules in a single command:
cargo run --example batch -- /path/to/your/project/runtimeThis will generate UML diagrams for the main project and all configured modules,
outputting them to target/doc/<module_name>/.
To automatically copy the generated diagrams to your documentation folder, add
the --copy flag:
cargo run --example batch -- /path/to/your/project/runtime --copyThis will generate UML and copy all generated diagrams to
/path/to/your/project/documentation/runtime_architecture/module_uml/.
The full list of modules that this script will document can be found in
./examples/batch.rs. If new modules are added to the runtime, they also need
to be added here.
All command line args can be viewed in examples/main.rs.