Pumlify
Pumlify formats PlantUML sequence diagrams in Visual Studio Code and from the command line.
Features
- Indents nested
alt, opt, loop, group, par, critical, and box blocks.
- Indents multiline
note over, note left, and note right blocks.
- Tracks nested participant activations and deactivations.
- Optionally adds sequential flow numbers to message lines containing PlantUML arrows. Existing Pumlify flow-number comments are replaced when formatting again.
Usage in Visual Studio Code
Open a .puml file and run Format Document (Shift+Alt+F), or choose Pumlify from the editor context menu.
Settings
Set pumlify.numberFlows in Visual Studio Code settings to control message numbering. It is enabled by default:
{
"pumlify.numberFlows": false
}
Command-line usage
Print the formatted content without changing the source file:
node format-puml.js diagram.puml
Format the file in place:
node format-puml.js diagram.puml --write
Example
Input:
@startuml
Alice -> Bob: Request
alt accepted
Bob --> Alice: Response
else rejected
Bob -> Alice: Error
end
@enduml
Output:
@startuml
/'1'/ Alice -> Bob: Request
alt accepted
/'2'/ Bob --> Alice: Response
else rejected
/'3'/ Bob -> Alice: Error
end
@enduml