Tuesday, 9 April 2024

PlantUML: Highlight some parts of the yaml document

Using #highlight directive, we can highlight some parts of the yaml document.

Example

#highlight "name" : Highlight name property

#highlight "address" / "city" : Highlight city property in address yaml document

#highlight "hobbies" / "1" : Highlight second hobby, here indexing starts from 0.

#highlight "emails" / "0" / "id": Highlight id property of first email object

highlightYaml.txt

@startyaml

#highlight "name"
#highlight "address" / "city"
#highlight "hobbies" / "1"
#highlight "emails" / "0" / "id"

id: 1
name: Krishna
address:
  state: Karnatka
  city: Bnagalore
  country: India
hobbies:
- Playing cricket
- blogging

@endyaml

Above snippet generate below diagram.




 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment