Skip to content

HowTo | UML in Wiki

ML-TANGO edited this page Oct 6, 2022 · 5 revisions

How to add UML in Wiki

References:


First create *.pulm file in the GitHub repo (e.g., docs/test.puml`) and add following puml code in the file. For example,

@startuml
'https://plantuml.com/class-diagram

interface MemberService
interface MemberRepository
class MemoryMemberRepository

MemberRepository -- MemberService
MemberRepository <|-- MemoryMemberRepository

@enduml
  • you can edit puml content at online PUML Server and the copy the codes into your repo/docs/test.puml file
  • Online pulm server you should wrap you uml code with @startuml ... @enduml but removes it repo/docs/test.puml file

Then, in your Markdown Wiki, insert UML rendering images using Plant UML proxy function http://www.plantuml.com/plantuml/proxy as follows:

![class-diagram](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/ML-TANGO/TANGO/main/docs/test.puml)

Note that the value of src paramter for Plant UML proxy call should have following pattern; https://raw.githubusercontent.com instead of https://github.com/ and remaining URL parts use following syntax.

https://raw.githubusercontent.com/:owner/:repo/:branch/:file_path
  • :owner: : your GitHub Id
  • :repo: : repository name of yours
  • :brach: : branch name in the repository
  • :file_patt: : puml file path in the repository

Then, Plant UML proxy (http://www.plantuml.com/plantuml/proxy`) is called with test.puml file in your GitHub repo and renering result will be returned.

Final Result:

class-diagram