├── README.adoc ├── github-adoc-puml.adoc ├── j2.re7.cu1.adoc ├── plantuml.cfg ├── small.puml ├── table.csv └── test.puml /README.adoc: -------------------------------------------------------------------------------- 1 | = my github journal 2 | :author: David Buret 3 | :source-highlighter: highlightjs 4 | :sectnums: 5 | :toclevels: 4 6 | :toc: 7 | :imagesdir: images/ 8 | :toc-title: Sommaire 9 | :gitplant: http://www.plantuml.com/plantuml/proxy?src=https://gitlab.com/dburet/journal/raw/master 10 | ifdef::env-gitlab[] 11 | :areweingitlab: yes❗➡ℹ💡☠⚠ 12 | endif::[] 13 | ifndef::env-gitlab[] 14 | :plantuml-server-url: http://192.168.1.49:23318 15 | endif::[] 16 | 17 | == Introduction 18 | 19 | Hi there! 20 | 21 | == Asciidoc, plantuml & github 22 | 23 | * link:github-adoc-puml.adoc[my tests] 24 | 25 | == Asciidoc, plantuml & Gitlab 26 | 27 | You can check https://gitlab.com/dburet/journal/tree/master[my repo on gitlab] for more informations. 28 | 29 | == ... 30 | image::https://idratherbewriting.com/docs-as-code-tools-and-workflows/media/vectors/docsascode_titleslide.svg[doc-as-code] 31 | image:https://about.gitlab.com/images/press/logo/png/gitlab-icon-rgb.png[gitlab,64] 32 | image:https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png[github,64] 33 | image:https://avatars1.githubusercontent.com/u/3137042?s=200&v=4[asciidoc,64] 34 | image:https://dominik-sigmund.de/wp-content/uploads/2018/03/plantuml.png[plantuml,64] 35 | -------------------------------------------------------------------------------- /github-adoc-puml.adoc: -------------------------------------------------------------------------------- 1 | = Using plantuml in AsciiDoc on GitHub 2 | :author: David Buret 3 | :source-highlighter: pygments 4 | :pygments-style: github 5 | :icons: font 6 | :sectnums: 7 | :toclevels: 4 8 | :toc: 9 | :imagesdir: images/ 10 | :toc-title: Sommaire 11 | :gitplant: http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/DBuret/journal/master/ 12 | ifdef::env-github[] 13 | :tip-caption: :bulb: 14 | :note-caption: :information_source: 15 | :important-caption: :heavy_exclamation_mark: 16 | :caution-caption: :fire: 17 | :warning-caption: :warning: 18 | endif::[] 19 | 20 | == introduction 21 | 22 | I'm currently moving to asciidoc and plantuml to write docs. 23 | Github asciidoc parsing does not understand plantuml. 24 | 25 | WARNING: AsciiDoc on GitHub currently needs some tricks. See https://gist.github.com/dcode/0cfbf2699a1fe9b46ff04c41721dda74[GitHub Flavored Asciidoc (GFA)] for Tips. 26 | 27 | == solution 28 | 29 | Use plantuml online server to parse the plantuml file on github, and use its full url in github asciidoc files 30 | 31 | .PlantUML proxy syntax 32 | http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/DBuret/journal/master/test.puml 33 | 34 | .AsciiDoc syntax 35 | image::http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/DBuret/journal/master/test.puml[test] 36 | 37 | This syntax is too long, let's use an asciidoc variable _gitplant_ 38 | 39 | Easy way to display plantuml in asciidoc on github 40 | 41 | .In the ASciiDoc header 42 | :gitplant: http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/DBuret/journal/master/ 43 | 44 | .In your document 45 | image::{gitplant}/test.puml[test] 46 | 47 | .Result 48 | image::{gitplant}/test.puml[PlantUML Image] 49 | 50 | TIP: Purge an image from GitHub cache with: `curl -X PURGE https://camo.githubusercontent.com/xxxxxxxxxxx` 51 | 52 | == Styling PlantUML 53 | 54 | If you want to use a styling shared by several plantUML diagrams, you can _include_ a file from an HTTP repository. 55 | 56 | I'm using the following: 57 | 58 | !includeurl https://raw.githubusercontent.com/DBuret/journal/master/plantuml.cfg 59 | 60 | All my _skinparam_, _include_ of sprites, and so on are stored in this file. 61 | So my diagrams now contain only elements declaration and links. 62 | 63 | * link:test.puml[Source of the above diagram] 64 | * link:plantuml.cfg[the 'styling' include file] 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /j2.re7.cu1.adoc: -------------------------------------------------------------------------------- 1 | [cols="1,4,4,2,6"] 2 | |=== 3 | | # | source | cible | proto | remarque 4 | 5 | | 1 | user | f5 | https | 6 | | 2 | f5 | web service | https | glop 7 | 8 | |=== 9 | -------------------------------------------------------------------------------- /plantuml.cfg: -------------------------------------------------------------------------------- 1 | scale 0.9 2 | skinparam defaultFontName Calibri 3 | 4 | !include 5 | !include 6 | !include 7 | !include 8 | !include 9 | !include 10 | !include 11 | !include 12 | !include 13 | !include 14 | !include 15 | !include 16 | !include 17 | !include 18 | !include 19 | !include 20 | !include 21 | !include 22 | !include 23 | !include 24 | !include 25 | !include 26 | !include 27 | !include 28 | !include 29 | !include 30 | !include 31 | !include 32 | !include 33 | !include 34 | !include 35 | 36 | 37 | hide stereotype 38 | 39 | skinparam { 40 | ArrowColor<< https >> Red 41 | ArrowColor<< http >> Green 42 | ArrowColor<< ssh >> Purple 43 | ArrowColor<< nfs >> DarkOrange 44 | ArrowColor<< jdbc >> Blue 45 | ArrowColor<< flow >> Black 46 | ArrowColor Black 47 | DefaultTextAlignment center 48 | BackgroundColor White 49 | shadowing false 50 | RoundCorner 10 51 | dpi 300 52 | } 53 | 54 | skinparam rectangle { 55 | BackgroundColor transparent 56 | BorderColor #ffffff 57 | 58 | BorderColor<< groupe >> #888888 59 | BorderColor<< dmz >> #555555 60 | } 61 | -------------------------------------------------------------------------------- /small.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | scale 0.9 3 | skinparam defaultFontName Calibri 4 | !include 5 | !include 6 | !include 7 | !include 8 | !include 9 | !include 10 | !include 11 | !include 12 | !include 13 | !include 14 | !include 15 | !include 16 | !include 17 | !include 18 | 19 | hide stereotype 20 | 21 | skinparam { 22 | ArrowColor<< https >> Red 23 | ArrowColor<< http >> Green 24 | ArrowColor<< ssh >> Purple 25 | ArrowColor<< nfs >> DarkOrange 26 | ArrowColor<< jdbc >> Blue 27 | ArrowColor<< flow >> Black 28 | DefaultTextAlignment center 29 | BackgroundColor White 30 | ' shadowing false 31 | RoundCorner 10 32 | RoundCorner<< flat >> 50 33 | dpi 300 34 | } 35 | 36 | skinparam rectangle { 37 | BackgroundColor transparent 38 | BorderColor #cccccc 39 | 40 | 'GROUPE 41 | BorderColor<< groupe >> #888888 42 | shadowing<< groupe >> false 43 | BorderStyle<< groupe >> dashed 44 | BorderTickness<< groupe >> 10 45 | 46 | ' ~bug 47 | TextAlignment<< groupe >> left 48 | 49 | ' DMZ 50 | BorderColor<< dmz >> #999999 51 | 52 | 'FLAT 53 | BorderColor<< flat >> transparent 54 | shadowing<< flat >> false 55 | 56 | 'FW 57 | BorderColor<< fw >> chocolate 58 | } 59 | 60 | rectangle "Servers LAN" << dmz >> as lan { 61 | rectangle "<$web_server>\nApplication" as App 62 | rectangle "data" << groupe >> as data { 63 | rectangle "<$database_server>\nRedis" as redis 64 | rectangle "<$server_farm>\nhadoop" as hpc 65 | rectangle "<$database_availability_group>\nDatabase" as db 66 | rectangle "<$file_server>\nNAS" as nas 67 | } 68 | } 69 | 70 | 71 | 72 | 'user flow' 73 | 74 | 'app flows' 75 | App --> db << jdbc >> : 4 76 | App --> hpc << flow >> : 6 77 | App --> redis << flow >> : 5 78 | App --> nas << nfs >> : 7 79 | 80 | 81 | @enduml 82 | -------------------------------------------------------------------------------- /table.csv: -------------------------------------------------------------------------------- 1 | Name, Class, Dorm, Room, GPA 2 | Sally Whittaker,2018,McCarren House,312,3.75 3 | Belinda Jameson,2017,Cushing House,148,3.52 4 | Jeff Smith,2018,Prescott House,17-D,3.20 5 | Sandy Allen,2019,Oliver House,108,3.48 6 | -------------------------------------------------------------------------------- /test.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | 3 | !includeurl https://raw.githubusercontent.com/DBuret/journal/master/plantuml.cfg 4 | 5 | rectangle DMZ << dmz >> { 6 | rectangle "<$reverse_proxy>\nReverse Proxy\nIPS/IDS" << serveur >> as ReverseProxy 7 | } 8 | 9 | rectangle "Servers LAN" << dmz >> as lan { 10 | rectangle "<$web_server>\nApplication" as App 11 | rectangle "<$database_server>Redis" as redis 12 | rectangle "<$server_farm>\nCompute" as hpc 13 | rectangle "<$database_availability_group>\nDatabase" as db 14 | rectangle "<$file_server>\nNAS" as nas 15 | } 16 | 17 | rectangle "Admin LAN" << dmz >> as adminlan { 18 | rectangle "<$cluster_server>\nBastion" as bastion 19 | } 20 | 21 | rectangle "<$firewall>\nexternal firewall" as fwe 22 | rectangle "<$firewall>\ninternal firewal" as fwi 23 | rectangle "<$firewall>\nadmin firewall E" as fwa 24 | rectangle "<$firewall>\nadmin firewall I" as fwai 25 | 26 | 27 | rectangle "<$users>\nInternet Users" as users 28 | rectangle "<$users>\nOffices Users" as office 29 | 30 | rectangle "<$globe_internet>Internet" as internet 31 | rectangle "<$cloud>\nWAN" as wan 32 | 33 | rectangle "<$administrator>\nAdmins" as Admins 34 | 35 | 'user flow' 36 | users .> internet << https >> : 2 37 | internet .> fwe << https >>: 2 38 | 39 | office -l-> wan << https >> : 1 40 | wan -l-> fwe << https >> : 1 41 | 42 | fwe ..> ReverseProxy << https >> : "1+2" 43 | 44 | ReverseProxy .> fwi << http >> : 3 45 | fwi ..> App << http >> : 3 46 | 47 | 'app flows' 48 | App --> db << jdbc >> : 4 49 | App --> hpc << flow >> : 6 50 | App --> redis << flow >> : 5 51 | App --> nas << nfs >> : 7 52 | 53 | 'admin flows' 54 | Admins ~> fwa << ssh >> : a 55 | fwa ~> bastion << ssh >> : a 56 | Admins -[hidden]-> bastion << ssh >> 57 | bastion -u-> fwai << ssh >> : b 58 | fwai -u-> App << ssh >> : b 59 | fwai -u-> db << ssh >> : b 60 | fwai -u-> hpc << ssh >> : b 61 | fwai -u-> redis << ssh >> : b 62 | fwai -u-> nas << https >> : b 63 | 64 | @enduml --------------------------------------------------------------------------------