A java app for rendering plantuml diagrams sourced from the Internet.
Pattern: /github/{owner}/{repo}/blob/{commit}/{path}
Example: https://puml-demo.herokuapp.com/github/lyang/puml/blob/master/README.md
@startuml
puml->World: Hello
caption Generated at %date("yyyy-MM-dd HH:mm:ss z")
@enduml
Pattern: /github/{owner}/{repo}/blob/{commit}/{path}?pumlIndex={n}
Example: https://puml-demo.herokuapp.com/github/lyang/puml/blob/master/README.md?pumlIndex=1
@startuml
participant browser as b
participant puml as p
participant Internet as i
b->p: GET /github/lyang/puml/blob/master/README.md?pumlIndex=1
p->i: GET https://api.github.com/
i->p: Plain Text
p->b: PNG
caption Generated at %date("yyyy-MM-dd HH:mm:ss z")
@enduml
Protected sources can be accessed by setting up credentials in config file, for example
Example: https://puml-demo.herokuapp.com/github/lyang/puml-demo/blob/master/README.md
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://puml-demo.herokuapp.com/github/ghe/lyang/puml-demo/blob/master/README.md
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.
Dependency: gradle-7.1
, graphviz
Building the fat jar:
gradle build
Run it locally:
gradle run --args="server config.yaml"
For IDE, I use IntelliJ CE
Prebuilt images are at: linyang1218/puml:latest
(Docker Hub)
A demo app is deployed to https://puml-demo.herokuapp.com via .travis.yml