The sassy UML renderer that generates diagrams from text
npm install nomnomlnomnoml



=======
Hello, this is nomnoml, a tool for drawing UML diagrams based on a simple syntax. It tries to keep its syntax visually as close as possible to the generated UML diagram without resorting to ASCII drawings.
Created by Daniel Kallin with help from a group of contributors.
The nomnoml javascript library can render diagrams on your web page. The only dependency is graphre. Install nomnoml using either _npm_ or good old script inclusion.
```
npm install nomnoml
`js`
var nomnoml = require('nomnoml')
var src = '[nomnoml] is -> [awesome]'
console.log(nomnoml.renderSvg(src))
In the SVG output the node name is attached to SVG shapes and containers with data-name attribute. You can use this to implement interactive diagrams.
`js`
document.querySelector('svg').onclick = function (e) {
console.log(e.target.closest('g[data-name]')?.attributes['data-name'])
}
`html
`
npx nomnoml exposes the SVG renderer with a command-line interface. This mode also supports the #import: directive for dividing complex diagrams into multiple files.
```
npx nomnoml input-file.noml
The nomnoml web application is a simple editor with a live preview. It is purely client-side and uses your browser's _localStorage_, so your diagram should be here the next time you visit (but no guarantees).
This is how the Decorator pattern can look in nomnoml syntax:
[Decorator pattern|
[
[Client] depends --> [Component]
[Decorator|- next: Component]
[Decorator] decorates -- [ConcreteComponent]
[Component] <:- [Decorator]
[Component] <:- [ConcreteComponent]
]
- association
-> association
<-> association
--> dependency
<--> dependency
-:> generalization
<:- generalization
--:> implementation
<:-- implementation
+- composition
+-> composition
o- aggregation
o-> aggregation
-o) ball and socket
o<-) ball and socket
->o ball and socket
-- note
-/- hidden
[name]
[
[
[
[
[
[ name]
[
[
[
[
[
[
[
[ name]
[
[
[
[
[
[
[
[