Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.94 KB

github.md

File metadata and controls

51 lines (36 loc) · 1.94 KB

GitHub

Pattern: /github/{owner}/{repo}/blob/{commit}/{path}

Example: https://demo.puml.net/github/lyang/puml/blob/main/github.md

@startuml
puml->GitHub: Hello
caption Generated at %date("yyyy-MM-dd HH:mm:ss z")
@enduml

demo

Pattern: /github/{owner}/{repo}/blob/{commit}/{path}?pumlIndex={n}

Example: https://demo.puml.net/github/lyang/puml/blob/main/github.md?pumlIndex=1

@startuml

participant browser as b
participant puml as p
participant GitHub as gh

b->p: GET /github/lyang/puml/blob/main/github.md?pumlIndex=1
p->gh: GET https://api.github.com/
gh->p: Plain Text
p->b: PNG

caption Generated at %date("yyyy-MM-dd HH:mm:ss z")

@enduml

demo

Rendering protected sources

Protected sources can be accessed by setting up credentials in config file, for example

Example: https://demo.puml.net/github/lyang/puml-demo/blob/main/github.md demo

Rendering for GitHub Enterprise Instances

GHE instance, even multiple instances, are also supported, via host mapping.

Pattern: /github/{key}/{owner}/{repo}/blob/{branch}/{path}

Host mapping for {key} needs to be configured in config.yaml, for example.

Example: https://demo.puml.net/github/ghe/lyang/puml-demo/blob/main/github.md demo

NOTE: Unfortunately I don't have a GHE instance to properly demo this, so instead I'm mapping ghe to github.com for this case.