a simple DSL modeling lang to target plantuml
sml.UsecaseDiagram(title, (ml) => {
const user = ml.actor('user')
const uc1 = ml.usecase('blog')
const us2 = ml.usecase('music')
const us3 = ml.usecase('play')
user.link([uc1, us2, us3], (l) => l.commentOf(`like`))
})
sml.JsonDiagram(title, (ml) => {
ml.highlights(['lastName', 'address.city', 'phoneNumbers.0.number']).json({
firstName: 'John',
lastName: 'Smith',
isAlive: true,
age: 28,
address: {
streetAddress: '21 2nd Street',
city: 'New York',
state: 'NY',
postalCode: '10021-3100',
},
phoneNumbers: [
{
type: 'home',
number: '212 555-1234',
},
{
type: 'office',
number: '646 555-4567',
},
],
children: [],
spouse: null,
})
})
sml.YamlDiagram(title, (ml) => {
ml.highlights(['french-hens', 'xmas-fifth-day.partridges']).yaml(
`doe: "a deer, a female deer"
ray: "a drop of golden sun"
pi: 3.14159
xmas: true
french-hens: 3
calling-birds:
- huey
- dewey
- louie
- fred
xmas-fifth-day:
calling-birds: four
french-hens: 3
golden-rings: 5
partridges:
count: 1
location: "a pear tree"
turtle-doves: two`,
)
})