pumlformat

Crates.iopumlformat
lib.rspumlformat
version0.1.0
created_at2025-05-04 05:25:48.692463+00
updated_at2025-05-04 05:25:48.692463+00
descriptionA formatter for plantuml source code.
homepage
repositoryhttps://github.com/huleiak47/pumlformat
max_upload_size
id1659382
size19,148
James Hu (huleiak47)

documentation

README

PlantUML Formatter

A command-line tool for formatting PlantUML diagrams with consistent indentation and spacing.

Features

  • Automatically indents nested blocks
  • Remove extra blank lines
  • Configurable indentation size

Installation

From Source

  1. Ensure Rust 1.85+ is installed
  2. Build release binary:
    cd pumlformat
    cargo build --release
    
  3. The binary will be in target/release/pumlformat

Usage

Basic formatting:

pumlformatter input.puml -o formatted.puml

With custom indentation:

pumlformatter --indent 2 input.puml

Pipe from stdin/stdout:

cat input.puml | pumlformatter > formatted.puml

Command Line Options

Formats PlantUML code with consistent indentation and spacing

Usage: pumlformat [OPTIONS] [INPUT]

Arguments:
  [INPUT]  Input file (default: stdin)

Options:
  -o, --output <OUTPUT>  Output file (default: stdout)
  -i, --indent <INDENT>  Number of spaces for indentation [default: 4]
  -h, --help             Print help
  -V, --version          Print version

Examples

Before:

@startuml
actor User

alt A
User -> Server : Login
else B
Server -> Database : Query
else C
Server -> Mailer : SendEmail
end
@enduml

After formatting:

@startuml
actor User

alt A
    User -> Server : Login
else B
    Server -> Database : Query
else C
    Server -> Mailer : SendEmail
end
@enduml

License

MIT Licensed

Commit count: 4

cargo fmt