Skip to content

sundeepbhatia/puml

 
 

Repository files navigation

Puml Build Status CodeQL

A java app for rendering plantuml diagrams sourced from the Internet.

Usage

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

demo

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

demo

Rendering protected sources

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 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://puml-demo.herokuapp.com/github/ghe/lyang/puml-demo/blob/master/README.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.

Development

Dependency: gradle-7.1, graphviz

Java

Building the fat jar:

gradle build

Run it locally:

gradle run --args="server config.yaml"

For IDE, I use IntelliJ CE

Docker

Prebuilt images are at: linyang1218/puml:latest (Docker Hub)

Deployment

A demo app is deployed to https://puml-demo.herokuapp.com via .travis.yml

Releases

No releases published

Packages

No packages published

Languages

  • Java 81.7%
  • Starlark 14.8%
  • Dockerfile 3.5%