Skip to content

Instantly share code, notes, and snippets.

@hsanson
Created February 4, 2015 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsanson/f9a6e0678ff137e07c63 to your computer and use it in GitHub Desktop.
Save hsanson/f9a6e0678ff137e07c63 to your computer and use it in GitHub Desktop.
Patch to add PlantUML related documentation to gollum-wiki
From d34f0b7088548ad733fad9027bf6b942f9486946 Mon Sep 17 00:00:00 2001
From: Horacio Sanson <horacio@allm.net>
Date: Thu, 5 Feb 2015 00:19:53 +0900
Subject: [PATCH] Add PlantUML documentation
---
Home.md | 20 +++++++++++++++++++-
PlantUML-Server.md | 44 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 1 deletion(-)
create mode 100644 PlantUML-Server.md
diff --git a/Home.md b/Home.md
index 03bdf54..0aef20f 100644
--- a/Home.md
+++ b/Home.md
@@ -402,6 +402,24 @@ following syntax:
You can replace the string "blue-modern" with any supported style.
+## PlantUML Diagrams
+
+It is possible to embed [PlantUML](http://plantuml.sourceforge.net/) diagrams in your wiki pages using the normal PlantUML syntax:
+
+ @startuml
+ Alice -> Bob: Authentication Request
+ Bob --> Alice: Authentication Response
+
+ Alice -> Bob: Another authentication Request
+ Alice <-- Bob: another authentication Response
+ @enduml
+
+You can embed any of the diagram types supported by PlantUML: sequence diagrams, case diagrams, class diagrams, activity diagrams, component diagrams, class diagrams, object diagrams and even wireframing diagrams.
+
+Notes:
+
+ - For wireframe diagrams you must use the *@startuml* tag followed by the *salt* keyword syntax. The new *@salt* syntax is not supported [limk](http://plantuml.sourceforge.net/salt.html)
+ - You must install and configure your own [[PlantUML-Server]] to render these diagrams.
## Include other pages
@@ -420,4 +438,4 @@ See [[Macros]].
## Misc options
* [[Uploading files]]
-* [[Configuring page titles|Page titles]]
\ No newline at end of file
+* [[Configuring page titles|Page titles]]
diff --git a/PlantUML-Server.md b/PlantUML-Server.md
new file mode 100644
index 0000000..131df14
--- /dev/null
+++ b/PlantUML-Server.md
@@ -0,0 +1,44 @@
+# Install local PlantUML server
+
+These instructions have been tested on Debian Jessie and Ubuntu 14.04 LTS distributions.
+
+ sudo apt-get install maven graphviz openjdk-7-jdk git-core
+ git clone https://github.com/plantuml/plantuml-server.git
+ cd plantuml-server
+ mvn package
+
+After building the package you can start a local server using the embedded jetty server:
+
+ mvn jetty:run
+
+The server will then be available on *http://localhost:8080/plantuml*.
+
+# Run PlantUML on a server
+
+These instructions are to run PlantUML using the default Jetty server on Ubuntu Server:
+
+ sudo apt-get install jetty
+
+Edit the */etc/default/jetty* file and change *NO_START* to 0 so jetty is started by default. Then copy the *plantuml.war* file generated when building the package (mvn package) to the Jetty applications folder:
+
+ sudo cp plantuml.war /usr/share/jetty/webapps/plantuml.war
+ sudo chown jetty:jetty /usr/share/jetty/webapps/plantuml.war
+ sudo service restart jetty
+
+After restarting Jetty the application will be running on the server port 8080. You can change the port and other parameters in the */etc/default/jetty* file.
+
+# Configuring gollum-lib
+
+If you have a remote PlantUML server and want gollum-lib to use that server for rendering diagrams you can set the server URL using the following snippet after requiring gollum-lib:
+
+ require "gollum-lib"
+
+ Gollum::Filter::PlantUML.configure do |config|
+ config.url = "http://my-own-plantuml.com:8080/plantuml/png"
+ end
+
+PlantUML can generate diagrams in PNG, SVG and TXT formats. The way you select which format you want is by replacing the last part of the URL path:
+
+ - PNG: http://my-own-plantuml.com:8080/plantuml/png
+ - SVG: http://my-own-plantuml.com:8080/plantuml/svg
+ - TXT: http://my-own-plantuml.com:8080/plantuml/txt
--
2.1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment