diff --git a/.gitignore b/.gitignore index 3f5d1e4..1d56db5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ out node_modules *.jar -*.tmLanguage \ No newline at end of file +*.tmLanguage +*.vsix \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore index 5ff3c19..1b3993c 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,6 +1,7 @@ .vscode/** .vscode-test/** out/test/** +out/snippets/** test/** src/** **/*.map diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a6866b..fab1d4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,21 @@ -# VSCode PlantUML Changelog +# plantuml-sidiandi-fork Changelog + +## To Do + +- Bundle with latest plantuml.jar +- Use X-PlantUML-Diagram-Error: Syntax Error?, X-PlantUML-Diagram-Error-Line: 2 headers from status code 400 response to highlight error +- Remove snippets format warning + +## 0.1.0 + +- Export on save +- Changed name of the configuration section from "PlantUML Configuration" to "PlantUML" to be consistent with other extensions +- Option `exportBesideDocument` to export diagrams in the same folder as the PlantUML source code +- Use the [local PlantUML PicoWeb Server](https://plantuml.com/de/picoweb) by default. +- Add the PlantUML Language Reference Guide examples as snippets (from https://github.com/coni2k/PlantUML). +- Wait until local picoserver was started successfully + +# plantuml Changelog ## 2.17.2 diff --git a/LICENSE.txt b/LICENSE.txt index bb6fad5..df86d70 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,6 @@ The MIT License (MIT) +Copyright (c) 2022 sidiandi Copyright (c) 2016 jebbs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and diff --git a/README.md b/README.md index aa6ace2..3495849 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ +# PlantUML (sidiandi fork) README + +This is a fork of the fantastic [PlantUML extension](https://github.com/qjebbs/vscode-plantuml). See below for the original readme. + +Extensions: +* Automatically use a local picoweb server of PlantUML for fast rendering. +* Auto-export diagrams every time you save. +* Option to export diagrams next to the .plantuml sources +* Add the PlantUML Language Reference Guide examples as snippets (from https://github.com/coni2k/PlantUML). + # PlantUML README Rich PlantUML support for Visual Studio Code. diff --git a/package-lock.json b/package-lock.json index f41b663..ca06dcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,16 @@ { "name": "plantuml", - "version": "2.15.1", + "version": "2.18.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "plantuml", - "version": "2.15.1", + "version": "2.18.0", "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { + "@types/glob": "^7.2.0", + "glob": "^7.2.0", "linq-collections": "*", "vscode-nls": "^2.0.2" }, @@ -25,6 +27,20 @@ "vscode": "^1.57.0" } }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" + }, "node_modules/@types/mocha": { "version": "2.2.32", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.32.tgz", @@ -34,8 +50,7 @@ "node_modules/@types/node": { "version": "6.0.46", "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.46.tgz", - "integrity": "sha1-jZ5IVygx8FsRzEx5N1TUNDchnWI=", - "dev": true + "integrity": "sha1-jZ5IVygx8FsRzEx5N1TUNDchnWI=" }, "node_modules/@types/vscode": { "version": "1.57.0", @@ -52,6 +67,11 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -72,6 +92,20 @@ } ] }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, "node_modules/entities": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", @@ -91,6 +125,44 @@ "node": ">=4" } }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "node_modules/js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -140,6 +212,33 @@ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/plist": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", @@ -184,6 +283,11 @@ "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz", "integrity": "sha1-gIUiOAhEuK0VNJmvXDsDkhrqAto=" }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, "node_modules/xmlbuilder": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", @@ -204,6 +308,20 @@ } }, "dependencies": { + "@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" + }, "@types/mocha": { "version": "2.2.32", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.32.tgz", @@ -213,8 +331,7 @@ "@types/node": { "version": "6.0.46", "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.46.tgz", - "integrity": "sha1-jZ5IVygx8FsRzEx5N1TUNDchnWI=", - "dev": true + "integrity": "sha1-jZ5IVygx8FsRzEx5N1TUNDchnWI=" }, "@types/vscode": { "version": "1.57.0", @@ -231,12 +348,31 @@ "sprintf-js": "~1.0.2" } }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, "entities": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", @@ -249,6 +385,38 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -292,6 +460,27 @@ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, "plist": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", @@ -326,6 +515,11 @@ "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz", "integrity": "sha1-gIUiOAhEuK0VNJmvXDsDkhrqAto=" }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, "xmlbuilder": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", diff --git a/package.json b/package.json index 4643004..b02d4ee 100755 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "plantuml", - "displayName": "PlantUML", + "name": "plantuml-sidiandi-fork", + "displayName": "PlantUML (sidiandi fork)", "description": "Rich PlantUML support for Visual Studio Code.", "icon": "images/icon.png", - "version": "2.17.2", - "publisher": "jebbs", + "version": "0.2.0", + "publisher": "sidiandi", "engines": { "vscode": "^1.57.0" }, @@ -182,6 +182,10 @@ { "language": "plantuml", "path": "./snippets/eggs.json" + }, + { + "language": "plantuml", + "path": "./snippets/LanguageReferenceGuide.json" } ], "configuration": { @@ -233,10 +237,22 @@ "default": ".wsd,.pu,.puml,.plantuml,.iuml", "description": "%plantuml.configuration.fileExtensions%" }, - "plantuml.exportSubFolder": { + "plantuml.exportOnSave": { "type": "boolean", "scope": "resource", "default": true, + "description": "%plantuml.configuration.exportOnSave%" + }, + "plantuml.exportBesideDocument": { + "type": "boolean", + "scope": "resource", + "default": true, + "description": "%plantuml.configuration.exportBesideDocument%" + }, + "plantuml.exportSubFolder": { + "type": "boolean", + "scope": "resource", + "default": false, "description": "%plantuml.configuration.exportSubFolder%" }, "plantuml.exportConcurrency": { @@ -302,6 +318,7 @@ "scope": "machine-overridable", "default": "", "enum": [ + "LocalServer", "Local", "PlantUMLServer" ], @@ -365,10 +382,12 @@ "workspace" ], "scripts": { + "vscode:package": "vsce package", "vscode:prepublish": "npm run buildsyntax && tsc -p ./", "compile": "tsc -p ./", "watch": "tsc -watch -p ./", - "buildsyntax": "node ./scripts/build-syntax.js" + "buildsyntax": "node ./scripts/build-syntax.js", + "buildsnippets": "node ./out/scripts/build-snippets.js" }, "devDependencies": { "@types/mocha": "^2.2.32", @@ -380,6 +399,8 @@ "typescript": "^3.7.2" }, "dependencies": { + "@types/glob": "^7.2.0", + "glob": "^7.2.0", "linq-collections": "*", "vscode-nls": "^2.0.2" } diff --git a/package.nls.json b/package.nls.json index ae3b455..2fb183b 100644 --- a/package.nls.json +++ b/package.nls.json @@ -6,11 +6,13 @@ "plantuml.URLCurrent.title": "Generate URL for Current Diagram", "plantuml.URLDocument.title": "Generate URLs for Current File Diagrams", "plantuml.extractSource.title": "Extract PlantUML Diagram Source from Image", - "plantuml.configuration.configTitle": "PlantUML configuration", + "plantuml.configuration.configTitle": "PlantUML (sidiandi fork)", "plantuml.configuration.exportFormat": "Export format. Leave it blank to pick format everytime you export.", "plantuml.configuration.jar": "Alternate plantuml.jar location. Leave it blank to use integrated jar.", "plantuml.configuration.diagramsRoot": "Specifies where all diagram files located (relative to workspace folder).", "plantuml.configuration.fileExtensions": "File extensions that find to export. Especially in workspace settings, you may add your own extensions so as to export diagrams in source code files, like \".java\".", + "plantuml.configuration.exportOnSave": "Export diagrams when document is saved.", + "plantuml.configuration.exportBesideDocument": "Export diagrams in the same directory as the plantuml source file.", "plantuml.configuration.exportSubFolder": "Export diagrams to a folder which has same name with host file.", "plantuml.configuration.exportConcurrency": "Decides concurrency count when export multiple diagrams.", "plantuml.configuration.exportOutDir": "Exported workspace diagrams will be organized in this directory (relative path to workspace folder).", diff --git a/scripts/build-snippets.ts b/scripts/build-snippets.ts new file mode 100644 index 0000000..0d36313 --- /dev/null +++ b/scripts/build-snippets.ts @@ -0,0 +1,45 @@ +// Update the LanguageReferenceGuide snippets file with the contents of https://github.com/coni2k/PlantUML.git + +import * as fs from 'fs'; +import * as child_process from 'child_process'; +import * as glob from 'glob' + +let sourceDir = "./out/snippets/coni2k/PlantUML" +if (!fs.existsSync(sourceDir)) { + child_process.execSync(`git clone https://github.com/coni2k/PlantUML.git ${sourceDir}`) +} + +let pumlFiles = glob.sync(`${sourceDir}/**/*.puml`) + +const LanguageReferenceGuide = "LanguageReferenceGuide" +const prefixSep = ": " + +let chapterNumberRe = new RegExp("\\d+[a-z]?\\s+", 'ig') + +function escapeSnippetText(t: string) : string { + // https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax + // With \ (backslash), you can escape $, }, and \. + return t.replace(/\[$}\\]/gi, "\\$1") +} + +let snippets = pumlFiles.map(function(value: string, index: number, array: string[]) : any { + let name = value.substring(sourceDir.length+1).replace("/", prefixSep).replace(".puml", "").replace(chapterNumberRe, '') + + return { + "prefix": name, + "body": escapeSnippetText(fs.readFileSync(value, "utf8")), + "description": name + } + }) + .reduce(function(p, c) { + p[c.prefix] = c + return p + }, {}) + +let json = JSON.stringify(snippets) + +fs.writeFileSync(`./snippets/${LanguageReferenceGuide}.json`, json, {encoding:'utf8'}) + + + + diff --git a/snippets/LanguageReferenceGuide.json b/snippets/LanguageReferenceGuide.json new file mode 100644 index 0000000..3e3271b --- /dev/null +++ b/snippets/LanguageReferenceGuide.json @@ -0,0 +1 @@ +{"Docs: GraphViz":{"prefix":"Docs: GraphViz","body":"' \"testdot\" is a special expression to test whether \"GraphViz\" tool is working correctly.\r\n' When you run the preview, you should see \"Installation seems OK. File generation OK\" message.\r\n' For more info: https://plantuml.com/graphviz-dot\r\n@startuml\r\ntestdot\r\n@enduml\r\n","description":"Docs: GraphViz"},"Docs: Hello":{"prefix":"Docs: Hello","body":"@startuml\r\n\r\nBob -> Alice : hello\r\n\r\n@enduml\r\n","description":"Docs: Hello"},"Docs: Version":{"prefix":"Docs: Version","body":"@startuml\r\nversion\r\n@enduml\r\n","description":"Docs: Version"},"Sequence Diagram: Basic examples":{"prefix":"Sequence Diagram: Basic examples","body":"@startuml\r\n\r\nAlice -> Bob: Authentication Request\r\nBob --> Alice: Authentication Response\r\n\r\nAlice -> Bob: Another Authentication Request\r\nAlice <-- Bob: Another Authentication Response\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Basic examples"},"Sequence Diagram: Grouping message":{"prefix":"Sequence Diagram: Grouping message","body":"@startuml\r\n\r\nAlice -> Bob: Authentication Request\r\n\r\nalt successful case\r\n Bob -> Alice: Authentication Accepted\r\nelse some kind of failure\r\n Bob -> Alice: Authentication Failure\r\n group My own label\r\n Alice -> Log : Log attack start\r\n loop 1000 times\r\n Alice -> Bob: DNS Attack\r\n end\r\n Alice -> Log : Log attack end\r\n end\r\nelse Another type of failure\r\n Bob -> Alice: Please repeat\r\nend\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Grouping message"},"Sequence Diagram: Notes on messages":{"prefix":"Sequence Diagram: Notes on messages","body":"@startuml\r\n\r\nAlice->Bob : hello\r\nnote left: this is a first note\r\n\r\nBob->Alice : ok\r\nnote right: this is another note\r\n\r\nBob->Bob : I am thinking\r\nnote left\r\n a note\r\n can also be defined\r\n on several lines\r\nend note\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Notes on messages"},"Sequence Diagram: Some other notes":{"prefix":"Sequence Diagram: Some other notes","body":"@startuml\r\n\r\nparticipant Alice\r\nparticipant Bob\r\nnote left of Alice #aqua\r\n This is displayed\r\n left of Alice.\r\nend note\r\n\r\nnote right of Alice: This is displayed right of Alice.\r\n\r\nnote over Alice: This is displayed over Alice.\r\n\r\nnote over Alice, Bob #FFAAAA: This is displayed\\n over Bob and Alice.\r\n\r\nnote over Bob, Alice\r\n This is yet another\r\n example of\r\n a long note.\r\nend note\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Some other notes"},"Sequence Diagram: Changing notes shapes":{"prefix":"Sequence Diagram: Changing notes shapes","body":"@startuml\r\n\r\ncaller -> server : conReq\r\nhnote over caller : idle\r\ncaller <- server : conConf\r\nrnote over server\r\n \"r\" as rectangle\r\n \"h\" as hexagon\r\nendrnote\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Changing notes shapes"},"Sequence Diagram: Creole and HTML":{"prefix":"Sequence Diagram: Creole and HTML","body":"@startuml\r\n\r\nparticipant Alice\r\nparticipant \"The **Famous** Bob\" as Bob\r\n\r\nAlice -> Bob : hello --there--\r\n... Some ~~long delay~~ ...\r\nBob -> Alice : ok\r\nnote left\r\n This is **bold**\r\n This is //italics//\r\n This is \"\"monospaced\"\"\r\n This is --stroked--\r\n This is __underlined__\r\n This is ~~waved~~\r\nend note\r\n\r\nAlice -> Bob : A //well formatted// message\r\nnote right of Alice\r\n This is displayed\r\n __left of__ Alice.\r\nend note\r\nnote left of Bob\r\n This is displayed\r\n **left of Alice Bob**.\r\nend note\r\nnote over Alice, Bob\r\n This is hosted by \r\nend note\r\n\r\n@enduml\r\n\r\n","description":"Sequence Diagram: Creole and HTML"},"Sequence Diagram: Divider":{"prefix":"Sequence Diagram: Divider","body":"@startuml\r\n\r\n== Initialization ==\r\n\r\nAlice -> Bob: Authentication Request\r\nBob --> Alice: Authentication Response\r\n\r\n== Repetition ==\r\n\r\nAlice -> Bob: Another authentication Request\r\nAlice <-- Bob: another authentication Response\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Divider"},"Sequence Diagram: Reference":{"prefix":"Sequence Diagram: Reference","body":"@startuml\r\n\r\nparticipant Alice\r\nactor Bob\r\n\r\nref over Alice, Bob : init\r\n\r\nAlice -> Bob : hello\r\n\r\nref over Bob\r\n This can be on\r\n several lines\r\nend ref\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Reference"},"Sequence Diagram: Delay":{"prefix":"Sequence Diagram: Delay","body":"@startuml\r\n\r\nAlice -> Bob: Authentication Request\r\n...\r\nBob --> Alice: Authentication Response\r\n...5 minutes later...\r\nBob --> Alice: Bye !\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Delay"},"Sequence Diagram: Space":{"prefix":"Sequence Diagram: Space","body":"@startuml\r\n\r\nAlice -> Bob: message 1\r\nBob --> Alice: ok\r\n|||\r\nAlice -> Bob: message 2\r\nBob --> Alice: ok\r\n||45||\r\nAlice -> Bob: message 3\r\nBob --> Alice: ok\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Space"},"Sequence Diagram: Lifeline Activation and Destruction":{"prefix":"Sequence Diagram: Lifeline Activation and Destruction","body":"@startuml\r\n\r\nparticipant User\r\n\r\nUser -> A: DoWork\r\nactivate A #FFBBBB\r\n\r\nA -> A: Internal call\r\nactivate A #DarkSalmon\r\n\r\nA -> B: << createRequest >>\r\nactivate B\r\n\r\nB --> A: RequestCreated\r\ndeactivate B\r\ndeactivate A\r\n\r\nA -> User: Done\r\ndeactivate A\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Lifeline Activation and Destruction"},"Sequence Diagram: Lifeline Activation and Destruction copy":{"prefix":"Sequence Diagram: Lifeline Activation and Destruction copy","body":"@startuml\r\n\r\nautoactivate on\r\nalice -> bob : hello\r\nbob -> bob : self call\r\nbill -> bob #005500 : hello from thread 2\r\nbob -> george ** : create\r\nreturn done in thread 2\r\nreturn rc\r\nbob -> george !! : delete\r\nreturn success\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Lifeline Activation and Destruction copy"},"Sequence Diagram: Return":{"prefix":"Sequence Diagram: Return","body":"@startuml\r\n\r\nBob -> Alice : hello\r\nactivate Alice\r\n\r\n Alice -> Alice : some action\r\n\r\nreturn bye\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Return"},"Sequence Diagram: Participant creation":{"prefix":"Sequence Diagram: Participant creation","body":"@startuml\r\n\r\nBob -> Alice : hello\r\n\r\ncreate Other\r\nAlice -> Other : new\r\n\r\ncreate control String\r\nAlice -> String\r\nnote right : You can also put notes!\r\n\r\nAlice --> Bob : ok\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Participant creation"},"Sequence Diagram: Shortcut syntax for activation, deactivation, creation":{"prefix":"Sequence Diagram: Shortcut syntax for activation, deactivation, creation","body":"@startuml\r\n\r\nalice -> bob ++ : hello\r\nbob -> bob ++ : self call\r\nbob -> bib ++ #005500 : hello\r\nbob -> george ** : create\r\nreturn done\r\nreturn rc\r\nbob -> george !! : delete\r\nreturn success\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Shortcut syntax for activation, deactivation, creation"},"Sequence Diagram: Incoming and outgoing messages":{"prefix":"Sequence Diagram: Incoming and outgoing messages","body":"@startuml\r\n\r\n[-> Bob\r\n[o-> Bob\r\n[o->o Bob\r\n[x-> Bob\r\n[<- Bob\r\n[x<- Bob\r\nBob ->]\r\nBob ->o]\r\nBob o->o]\r\nBob ->x]\r\nBob <-]\r\nBob x<-]\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Incoming and outgoing messages"},"Sequence Diagram: Anchors and Duration":{"prefix":"Sequence Diagram: Anchors and Duration","body":"@startuml\r\n\r\n!pragma teoz true\r\n{start} Alice -> Bob : start doing things during duration\r\nBob -> Max : something\r\nMax -> Bob : something else\r\n{end} Bob -> Alice : finish\r\n{start} <-> {end} : some time\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Anchors and Duration"},"Sequence Diagram: Stereotypes and Spots":{"prefix":"Sequence Diagram: Stereotypes and Spots","body":"@startuml\r\n\r\nparticipant Bob << (C,#ADD1B2) >>\r\nparticipant Alice << (C,#ADD1B2) >>\r\nBob->Alice: First message\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Stereotypes and Spots"},"Sequence Diagram: More information on titles":{"prefix":"Sequence Diagram: More information on titles","body":"@startuml\r\n\r\ntitle\r\nSimple communication example\r\non several lines and using html\r\nThis is hosted by \r\nend title\r\n\r\nAlice -> Bob: Authentication Request\r\nBob -> Alice: Authentication Response\r\n\r\n@enduml\r\n","description":"Sequence Diagram: More information on titles"},"Sequence Diagram: Participants encompass":{"prefix":"Sequence Diagram: Participants encompass","body":"@startuml\r\n\r\nbox \"Internal Service\" #LightBlue\r\nparticipant Bob\r\nparticipant Alice\r\nend box\r\n\r\nparticipant Other\r\nBob -> Alice : hello\r\nAlice -> Other : hello\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Participants encompass"},"Sequence Diagram: Removing Foot Boxes copy":{"prefix":"Sequence Diagram: Removing Foot Boxes copy","body":"@startuml\r\n\r\nhide footbox\r\ntitle Foot Box removed\r\nAlice -> Bob: Authentication Request\r\nBob --> Alice: Authentication Response\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Removing Foot Boxes copy"},"Sequence Diagram: Skinparam":{"prefix":"Sequence Diagram: Skinparam","body":"@startuml\r\n\r\nskinparam backgroundColor #EEEBDC\r\nskinparam handwritten true\r\nskinparam sequence {\r\n ArrowColor DeepSkyBlue\r\n ActorBorderColor DeepSkyBlue\r\n LifeLineBorderColor blue\r\n LifeLineBackgroundColor #A9DCDF\r\n ParticipantBorderColor DeepSkyBlue\r\n ParticipantBackgroundColor DodgerBlue\r\n ParticipantFontName Impact\r\n ParticipantFontSize 17\r\n ParticipantFontColor #A9DCDF\r\n ActorBackgroundColor aqua\r\n ActorFontColor DeepSkyBlue\r\n ActorFontSize 17\r\n ActorFontName Aapex\r\n}\r\n\r\nactor User\r\nparticipant \"First Class\" as A\r\nparticipant \"Second Class\" as B\r\nparticipant \"Last Class\" as C\r\n\r\nUser -> A: DoWork\r\nactivate A\r\n\r\nA -> B: Create Request\r\nactivate B\r\n\r\nB -> C: DoWork\r\nactivate C\r\n\r\nC --> B: WorkDone\r\ndestroy C\r\n\r\nB --> A: Request Created\r\ndeactivate B\r\n\r\nA --> User: Done\r\ndeactivate A\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Skinparam"},"Sequence Diagram: Declaring participant":{"prefix":"Sequence Diagram: Declaring participant","body":"@startuml\r\n\r\nparticipant Last order 30\r\nparticipant Middle order 20\r\nparticipant First order 10\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Declaring participant"},"Sequence Diagram: Use non-letters in participants":{"prefix":"Sequence Diagram: Use non-letters in participants","body":"@startuml\r\n\r\nAlice -> \"Bob()\" : Hello\r\n\"Bob()\" -> \"This is a very\\nlong\" as Long\r\n' You can also declare:\r\n' \"Bob() -> Long as \"This is very\\nlong\"\r\nLong --> \"Bob()\" : ok\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Use non-letters in participants"},"Sequence Diagram: Changing padding":{"prefix":"Sequence Diagram: Changing padding","body":"@startuml\r\n\r\nskinparam ParticipantPadding 20\r\nskinparam BoxPadding 10\r\n\r\nbox \"Foo1\"\r\n participant Alice1\r\n participant Alice2\r\nend box\r\n\r\nbox \"Foo2\"\r\n participant Bob1\r\n participant Bob2\r\nend box\r\n\r\nAlice1 -> Bob1 : hello\r\nAlice1 -> Out : out\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Changing padding"},"Sequence Diagram: Message to self":{"prefix":"Sequence Diagram: Message to self","body":"@startuml\r\n\r\nAlice->Alice: This is a signal to self.\\nIt also demonstrates\\nmultiline \\ntext\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Message to self"},"Sequence Diagram: Change arrow style":{"prefix":"Sequence Diagram: Change arrow style","body":"@startuml\r\n\r\nBob ->x Alice\r\nBob -> Alice\r\nBob ->> Alice\r\nBob -\\ Alice\r\nBob \\\\- Alice\r\nBob //-- Alice\r\nBob ->o Alice\r\nBob o\\\\-- Alice\r\nBob <-> Alice\r\nBob <->o Alice\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Change arrow style"},"Sequence Diagram: Change arrow color":{"prefix":"Sequence Diagram: Change arrow color","body":"@startuml\r\n\r\nBob -[#red]> Alice : hello\r\nAlice -[#0000FF]> Bob : ok\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Change arrow color"},"Sequence Diagram: Message sequence numbering":{"prefix":"Sequence Diagram: Message sequence numbering","body":"@startuml\r\n\r\nautonumber 10 10 \"[000]\"\r\nBob -> Alice : Authentication Request\r\nBob <- Alice : Authentication Response\r\n\r\nautonumber stop\r\nBob -> Alice : dummy\r\n\r\nautonumber resume \"Message 0 \"\r\nBob -> Alice : Yet another authentication Request\r\nBob <- Alice : Yet another authentication Response\r\n\r\nautonumber stop\r\nBob -> Alice : dummy\r\n\r\nautonumber resume 1 \"Message 0 \"\r\nBob -> Alice : Yet another authentication Request\r\nBob <- Alice : Yet another authentication Response\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Message sequence numbering"},"Sequence Diagram: Page Title, Header and Footer":{"prefix":"Sequence Diagram: Page Title, Header and Footer","body":"@startuml\r\n\r\nheader Page Header\r\nfooter Page %page% of %lastpage%\r\n\r\ntitle Example Title\r\n\r\nAlice -> Bob : message 1\r\nAlice -> Bob : message 2\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Page Title, Header and Footer"},"Sequence Diagram: Splitting diagrams":{"prefix":"Sequence Diagram: Splitting diagrams","body":"@startuml\r\n\r\nAlice -> Bob : message 1\r\nAlice -> Bob : message 2\r\n\r\nnewpage\r\n\r\nAlice -> Bob : message 3\r\nAlice -> Bob : message 4\r\n\r\nnewpage A title for the\\nlast page\r\n\r\nAlice -> Bob : message 5\r\nAlice -> Bob : message 6\r\n\r\n@enduml\r\n","description":"Sequence Diagram: Splitting diagrams"},"Gantt Diagram: Declaring tasks":{"prefix":"Gantt Diagram: Declaring tasks","body":"@startgantt\r\n\r\n[Prototype design] lasts 15 days\r\n[Test prototype] lasts 10 days\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Declaring tasks"},"Gantt Diagram: Working with resources":{"prefix":"Gantt Diagram: Working with resources","body":"@startgantt\r\n\r\n[Task1] on {Alice} lasts 10 days\r\n[Task2] on {Bob:50%} lasts 2 days\r\nthen [Task3] on {Alice:25%} lasts 1 days\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Working with resources"},"Gantt Diagram: Complex example":{"prefix":"Gantt Diagram: Complex example","body":"@startgantt\r\n\r\n[Prototype design] lasts 13 days and is colored in Lavender/LightBlue\r\n[Test prototype] lasts 9 days and is colored in Coral/Green and starts 3 days after [Prototype design]'s end\r\n[Write tests] lasts 5 days and ends at [Prototype design]'s end\r\n[Hire tests writers] lasts 6 days and ends at [Write tests]'s start\r\n[Init and write tests report] is colored in Coral/Green\r\n[Init and write tests report] starts 1 day before [Test prototype]'s start and ends at [Test prototype]'s end\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Complex example"},"Gantt Diagram: Adding constraints":{"prefix":"Gantt Diagram: Adding constraints","body":"@startgantt\r\n\r\n[Prototype design] lasts 10 days\r\n[Code prototype] lasts 10 days\r\n[Write tests] lasts 5 days\r\n[Code prototype] starts at [Prototype design]'s end\r\n[Write tests] starts at [Code prototype]'s start\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Adding constraints"},"Gantt Diagram: Short names":{"prefix":"Gantt Diagram: Short names","body":"@startgantt\r\n\r\n[Prototype design] as [D] lasts 15 days\r\n[Test prototype] as [T] lasts 10 days\r\n[T] starts at [D]'s end\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Short names"},"Gantt Diagram: Customize colors":{"prefix":"Gantt Diagram: Customize colors","body":"@startgantt\r\n\r\n[Prototype design] lasts 13 days\r\n[Test prototype] lasts 4 days\r\n[Test prototype] starts at [Prototype design]'s end\r\n[Prototype design] is colored in Fuchsia/FireBrick\r\n[Test prototype] is colored in GreenYellow/Green\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Customize colors"},"Gantt Diagram: Milestone":{"prefix":"Gantt Diagram: Milestone","body":"@startgantt\r\n\r\n[Test prototype] lasts 10 days\r\n[Prototype completed] happens at [Test prototype]'s end\r\n[Setup assembly line] lasts 12 days\r\n[Setup assembly line] starts at [Test prototype]'s end\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Milestone"},"Gantt Diagram: Calendar":{"prefix":"Gantt Diagram: Calendar","body":"@startgantt\r\n\r\nProject starts the 20th of september 2017\r\n[Prototype design] as [TASK1] lasts 13 days\r\n[TASK1] is colored in Lavender/LightBlue\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Calendar"},"Gantt Diagram: Close day":{"prefix":"Gantt Diagram: Close day","body":"@startgantt\r\n\r\nproject starts the 2018/04/09\r\nsaturday are closed\r\nsunday are closed\r\n2018/05/01 is closed\r\n2018/04/17 to 2018/04/19 is closed\r\n[Prototype design] lasts 14 days\r\n[Test prototype] lasts 4 days\r\n[Test prototype] starts at [Prototype design]'s end\r\n[Prototype design] is colored in Fuchsia/FireBrick\r\n[Test prototype] is colored in GreenYellow/Green\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Close day"},"Gantt Diagram: Simplified task succession":{"prefix":"Gantt Diagram: Simplified task succession","body":"@startgantt\r\n\r\n[Prototype design] lasts 14 days\r\n[Build prototype] lasts 4 days\r\n[Prepare test] lasts 6 days\r\n[Prototype design] -> [Build prototype]\r\n[Prototype design] -> [Prepare test]\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Simplified task succession"},"Gantt Diagram: Separator":{"prefix":"Gantt Diagram: Separator","body":"@startgantt\r\n\r\n[Task1] lasts 10 days\r\nthen [Task2] lasts 4 days\r\n-- Phase Two --\r\nthen [Task3] lasts 5 days\r\nthen [Task4] lasts 6 days\r\n\r\n@endgantt\r\n","description":"Gantt Diagram: Separator"},"MindMap: OrgMode syntax":{"prefix":"MindMap: OrgMode syntax","body":"@startmindmap\r\n\r\n* Debian\r\n** Ubuntu\r\n*** Linux Mint\r\n*** Kubuntu\r\n*** Lubuntu\r\n*** KDE Neon\r\n** LMDE\r\n** SolydXK\r\n** SteamOS\r\n** Raspbian with a very long name\r\n*** Raspmbc => OSMC\r\n*** Raspyfi => Volumio\r\n\r\n@endmindmap","description":"MindMap: OrgMode syntax"},"MindMap: Removing box":{"prefix":"MindMap: Removing box","body":"@startmindmap\r\n\r\n* root node\r\n** some first level node\r\n***_ second level node\r\n***_ another second level node\r\n***_ foo\r\n***_ bar\r\n***_ foobar\r\n** another first level node\r\n\r\n@endmindmap","description":"MindMap: Removing box"},"MindMap: Arithmetic notation":{"prefix":"MindMap: Arithmetic notation","body":"@startmindmap\r\n\r\n+ OS\r\n++ Ubuntu\r\n+++ Linux Mint\r\n+++ Kubuntu\r\n+++ Lubuntu\r\n+++ KDE Neon\r\n++ LMDE\r\n++ SolydXK\r\n++ SteamOS\r\n++ Raspbian\r\n-- Windows 95\r\n-- Windows 98\r\n-- Windows NT\r\n--- Windows 8\r\n--- Windows 10\r\n\r\n@endmindmap","description":"MindMap: Arithmetic notation"},"MindMap: Markdown syntax":{"prefix":"MindMap: Markdown syntax","body":"@startmindmap\r\n\r\n* root node\r\n * some first level node\r\n * second level node\r\n * another second level node\r\n * another first level node\r\n\r\n@endmindmap\r\n","description":"MindMap: Markdown syntax"},"MindMap: Changing diagram direction":{"prefix":"MindMap: Changing diagram direction","body":"@startmindmap\r\n\r\n* count\r\n** 100\r\n*** 101\r\n*** 102\r\n** 200\r\nleft side\r\n** A\r\n*** AA\r\n*** AB\r\n** B\r\n\r\n@endmindmap\r\n","description":"MindMap: Changing diagram direction"},"MindMap: Complete example":{"prefix":"MindMap: Complete example","body":"@startmindmap\r\n\r\ncaption figure 1\r\ntitle My super title\r\n\r\n* <&flag>Debian\r\n** <&globe>Ubuntu\r\n*** Linux Mint\r\n*** Kubuntu\r\n*** Lubuntu\r\n*** KDE Neon\r\n** <&graph>LMDE\r\n** <&pulse>SolydXK\r\n** <&people>SteamOS\r\n** <&star>Raspbian with a very long name\r\n*** Raspmbc => OSMC\r\n*** Raspyfi => Volumio\r\n\r\nheader\r\n My super header\r\nendheader\r\n\r\ncenter footer My super footer\r\n\r\nlegend right\r\n Short\r\n legend\r\nendlegend\r\n\r\n@endmindmap\r\n","description":"MindMap: Complete example"},"Work Breakdown Structure: OrgMode syntax":{"prefix":"Work Breakdown Structure: OrgMode syntax","body":"@startwbs\r\n\r\n* Business Process Modelling WBS\r\n** Launch the project\r\n*** Complete Stakeholder Research\r\n*** Initial Implementation Plan\r\n** Design phase\r\n*** Model of AsIs Processes Completed\r\n**** Model of AsIs Processes Completed1\r\n**** Model of AsIs Processes Completed2\r\n*** Measure AsIs performance metrics\r\n*** Identify Quick Wins\r\n** Complete innovate phase\r\n\r\n@endwbs\r\n","description":"Work Breakdown Structure: OrgMode syntax"},"Work Breakdown Structure: Change direction":{"prefix":"Work Breakdown Structure: Change direction","body":"@startwbs\r\n\r\n* Business Process Modelling WBS\r\n** Launch the project\r\n*** Complete Stakeholder Research\r\n*** Initial Implementation Plan\r\n** Design phase\r\n*** Model of AsIs Processes Completed\r\n****< Model of AsIs Processes Completed1\r\n****> Model of AsIs Processes Completed2\r\n***< Measure AsIs performance metrics\r\n***< Identify Quick Wins\r\n\r\n@endwbs\r\n","description":"Work Breakdown Structure: Change direction"},"Work Breakdown Structure: Arithmetic notation":{"prefix":"Work Breakdown Structure: Arithmetic notation","body":"@startwbs\r\n\r\n+ Project\r\n + Part One\r\n + Task 1.1\r\n - LeftTask 1.2\r\n + Task 1.3\r\n + Part Two\r\n + Task 2.1\r\n + Task 2.2\r\n -_ Task 2.2.1 To the left boxless\r\n -_ Task 2.2.2 To the Left boxless\r\n +_ Task 2.2.3 To the right boxless\r\n\r\n@endwbs\r\n","description":"Work Breakdown Structure: Arithmetic notation"},"Maths: Intro":{"prefix":"Maths: Intro","body":"@startuml\r\n\r\nBob -> Alice : Can you solve: ax^2+bx+c=0\r\nAlice --> Bob: x = (-b+-sqrt(b^2-4ac))/(2a)\r\n\r\n@enduml","description":"Maths: Intro"},"Maths: Standalone diagram":{"prefix":"Maths: Standalone diagram","body":"@startlatex\r\n\\sum_{i=0}^{n-1} (a_i + b_i^2)\r\n@endlatex\r\n","description":"Maths: Standalone diagram"},"Common commands: Footer and header":{"prefix":"Common commands: Footer and header","body":"@startuml\r\n\r\nAlice -> Bob: Authentication Request\r\n\r\nheader\r\n Warning:\r\n Do not use in production.\r\nendheader\r\n\r\ncenter footer Generated for demonstration\r\n\r\n@enduml","description":"Common commands: Footer and header"},"Common commands: Zoom":{"prefix":"Common commands: Zoom","body":"@startuml\r\n\r\nscale 180*90\r\nBob->Alice : hello\r\n\r\n@enduml","description":"Common commands: Zoom"},"Common commands: Title":{"prefix":"Common commands: Title","body":"@startuml\r\n\r\ntitle\r\n Simple communication example\r\n on several lines and using creole tags\r\nend title\r\n\r\nAlice -> Bob: Authentication Request\r\nBob -> Alice: Authentication Response\r\n\r\n@enduml","description":"Common commands: Title"},"Common commands: Caption":{"prefix":"Common commands: Caption","body":"@startuml\r\n\r\ncaption figure 1\r\nAlice -> Bob: Hello\r\n\r\n@enduml","description":"Common commands: Caption"},"Common commands: Legend the diagram":{"prefix":"Common commands: Legend the diagram","body":"@startuml\r\n\r\nAlice -> Bob : Hello\r\n\r\nlegend top left\r\n Short\r\n legend\r\nendlegend\r\n\r\n@enduml","description":"Common commands: Legend the diagram"},"Salt (wireframe): Basic widgets":{"prefix":"Salt (wireframe): Basic widgets","body":"@startuml\r\n\r\nsalt\r\n{\r\n Just plain text\r\n [This is my button]\r\n () Unchecked radio\r\n (X) Checked radio\r\n [] Unchecked box\r\n [X] Checked box\r\n \"Enter text here \"\r\n ^This is a droplist^\r\n}\r\n\r\n@enduml","description":"Salt (wireframe): Basic widgets"},"Salt (wireframe): OpenIconic":{"prefix":"Salt (wireframe): OpenIconic","body":"@startuml\r\nlistopeniconic\r\n@enduml\r\n","description":"Salt (wireframe): OpenIconic"},"Salt (wireframe): Include Salt":{"prefix":"Salt (wireframe): Include Salt","body":"@startuml\r\n\r\n!unquoted procedure SALT($x)\r\n\"{{\r\nsalt\r\n%invoke_procedure(\"_\"+$x)\r\n}}\" as $x\r\n!endprocedure\r\n\r\n!procedure _choose()\r\n{+\r\n an example\r\n choose one option\r\n ()one\r\n ()two\r\n [ok]\r\n}\r\n!endprocedure\r\n\r\n!procedure _wait()\r\n{+\r\n please wait\r\n operation in progress\r\n <&clock>\r\n [cancel]\r\n}\r\n!endprocedure\r\n\r\n!procedure _success()\r\n{+\r\n success\r\n congratulations!\r\n [ok]\r\n}\r\n!endprocedure\r\n\r\n!procedure _error()\r\n{+\r\n error\r\n failed, sorry\r\n [ok]\r\n}\r\n!endprocedure\r\n\r\n(*) --> SALT(choose)\r\n-right-> SALT(wait)\r\nwait -right-> SALT(success)\r\nwait -down-> SALT(error)\r\n\r\n@enduml\r\n","description":"Salt (wireframe): Include Salt"},"Salt (wireframe): Scroll Bars":{"prefix":"Salt (wireframe): Scroll Bars","body":"@startsalt\r\n\r\n{S-\r\nMessage\r\n.\r\n.\r\n.\r\n.\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Scroll Bars"},"Salt (wireframe): Using grid":{"prefix":"Salt (wireframe): Using grid","body":"@startsalt\r\n\r\n{+\r\n Login | \"MyName \"\r\n Password | \"**** \"\r\n [Cancel] | [ OK ]\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Using grid"},"Salt (wireframe): Group box":{"prefix":"Salt (wireframe): Group box","body":"@startsalt\r\n\r\n{^\"My group box\"\r\n Login | \"MyName \"\r\n Password | \"**** \"\r\n [Cancel] | [ OK ]\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Group box"},"Salt (wireframe): Using separator":{"prefix":"Salt (wireframe): Using separator","body":"@startsalt\r\n\r\n{\r\n Text1\r\n ..\r\n \"Some field\"\r\n ==\r\n Note on usage\r\n ~~\r\n Another text\r\n --\r\n [Ok]\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Using separator"},"Salt (wireframe): Tree widget":{"prefix":"Salt (wireframe): Tree widget","body":"@startsalt\r\n\r\n{\r\n{T\r\n + World\r\n ++ America\r\n +++ Canada\r\n +++ USA\r\n ++++ New York\r\n ++++ Boston\r\n +++ Mexico\r\n ++ Europe\r\n +++ Italy\r\n +++ Germany\r\n ++++ Berlin\r\n ++ Africa\r\n}\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Tree widget"},"Salt (wireframe): Enclosing brackets":{"prefix":"Salt (wireframe): Enclosing brackets","body":"@startsalt\r\n\r\n{\r\n Name | \" \"\r\n Modifiers: | { (X) public | () default | () private | () protected\r\n [] abstract | [] final | [] static }\r\n Superclass: | { \"java.lang.Object \" | [Browse...] }\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Enclosing brackets"},"Salt (wireframe): Adding tabs":{"prefix":"Salt (wireframe): Adding tabs","body":"@startsalt\r\n\r\n{+\r\n {/ General\r\n Fullscreen\r\n Behavior\r\n Saving } |\r\n {\r\n { Open image in: | ^Smart Mode^ }\r\n [X] Smooth images when zoomed\r\n [X] Confirm image deletion\r\n [ ] Show hidden images\r\n [Close]\r\n }\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Adding tabs"},"Salt (wireframe): Using menu":{"prefix":"Salt (wireframe): Using menu","body":"@startsalt\r\n\r\n{+\r\n {* File | Edit | Source | Refactor\r\n Refactor | New | Open File | - | Close | Close All }\r\n {/ General | Fullscreen | Behavior | Saving }\r\n {\r\n { Open image in: | ^Smart Mode^ }\r\n [X] Smooth images when zoomed\r\n [X] Confirm image deletion\r\n [ ] Show hidden images\r\n }\r\n [Close]\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Using menu"},"Salt (wireframe): Advanced table":{"prefix":"Salt (wireframe): Advanced table","body":"@startsalt\r\n\r\n{#\r\n . | Column 2 | Column 3\r\n Row header 1 | value 1 | value 2\r\n Row header 2 | A long cell | *\r\n}\r\n\r\n@endsalt\r\n","description":"Salt (wireframe): Advanced table"},"Creole: Emphasized text":{"prefix":"Creole: Emphasized text","body":"@startuml\r\n\r\nAlice -> Bob : hello --there--\r\n... Some ~~long delay~~ ...\r\nBob -> Alice : ok\r\nnote left\r\n This is **bold**\r\n This is //italics//\r\n This is \"\"monospaced\"\"\r\n This is --stroked--\r\n This is __underlined__\r\n This is ~~waved~~\r\nend note\r\n\r\n@enduml","description":"Creole: Emphasized text"},"Creole: OpenIconic":{"prefix":"Creole: OpenIconic","body":"@startuml\r\nlistopeniconic\r\n@enduml\r\n","description":"Creole: OpenIconic"},"Creole: List":{"prefix":"Creole: List","body":"@startuml\r\n\r\nobject demo {\r\n * Bullet list\r\n * Second item\r\n}\r\nnote left\r\n * Bullet list\r\n * Second item\r\n ** Sub item\r\nend note\r\n\r\nlegend\r\n # Numbered list\r\n # Second item\r\n ## Sub item\r\n ## Another sub item\r\n # Third item\r\nend legend\r\n\r\n@enduml","description":"Creole: List"},"Creole: Escape character":{"prefix":"Creole: Escape character","body":"@startuml\r\n\r\nobject demo {\r\n This is not ~___underscored__.\r\n This is not ~\"\"monospaced\"\".\r\n}\r\n\r\n@enduml","description":"Creole: Escape character"},"Creole: Horizontal lines":{"prefix":"Creole: Horizontal lines","body":"@startuml\r\n\r\ndatabase DB1 as \"\r\nYou can have horizontal line\r\n----\r\nOr double line\r\n====\r\nOr strong line\r\n____\r\nOr dotted line\r\n..My title..\r\nEnjoy!\r\n\"\r\nnote right\r\n This is working also in notes\r\n You can also add title in all these lines\r\n ==Title==\r\n --Another title--\r\nend note\r\n\r\n@enduml","description":"Creole: Horizontal lines"},"Creole: Headings":{"prefix":"Creole: Headings","body":"@startuml\r\n\r\nusecase UC1 as \"\r\n= Extra-large heading\r\nSome text\r\n== Large heading\r\nOther text\r\n=== Medium heading\r\nInformation\r\n....\r\n==== Small heading\"\r\n\r\n@enduml","description":"Creole: Headings"},"Creole: Legacy HTML":{"prefix":"Creole: Legacy HTML","body":"@startuml\r\n\r\n:* You can change text color\r\n* You can change background color\r\n* You can change size\r\n* You use legacy HTML tag\r\n* You use color in HTML tag\r\n----\r\n* Use image : \r\n;\r\n\r\n@enduml","description":"Creole: Legacy HTML"},"Creole: Table":{"prefix":"Creole: Table","body":"@startuml\r\n\r\nstart\r\n:Here is the result\r\n|= |= table |= header |\r\n| a | table | row |\r\n|<#FF8080> red |<#80FF80> green |<#8080FF> blue |\r\n<#yellow>| b | table | row |;\r\n\r\n@enduml","description":"Creole: Table"},"Creole: Tree":{"prefix":"Creole: Tree","body":"@startuml\r\n\r\nskinparam titleFontSize 14\r\n\r\ntitle\r\n Example of Tree\r\n |_ First line\r\n |_ **Bom(Model)**\r\n |_ prop1\r\n |_ prop2\r\n |_ prop3\r\n |_ Last line\r\nend title\r\n\r\n[*] --> State1\r\n\r\n@enduml","description":"Creole: Tree"},"Creole: Special characters":{"prefix":"Creole: Special characters","body":"@startuml\r\n\r\nusecase foo as \"this is ∞ long\"\r\nusecase bar as \"this is also long\"\r\n\r\n@enduml\r\n","description":"Creole: Special characters"},"Defining and using sprites: Intro":{"prefix":"Defining and using sprites: Intro","body":"@startuml\r\n\r\nsprite $foo1 {\r\n FFFFFFFFFFFFFFF\r\n F0123456789ABCF\r\n F0123456789ABCF\r\n F0123456789ABCF\r\n F0123456789ABCF\r\n F0123456789ABCF\r\n F0123456789ABCF\r\n F0123456789ABCF\r\n F0123456789ABCF\r\n FFFFFFFFFFFFFFF\r\n}\r\nAlice -> Bob : Testing <$foo1{scale=3}>\r\n\r\n@enduml","description":"Defining and using sprites: Intro"},"Defining and using sprites: Examples":{"prefix":"Defining and using sprites: Examples","body":"@startuml\r\n\r\nsprite $bug [15x15/16z] PKzR2i0m2BFMi15p__FEjQEqB1z27aeqCqixa8S4OT7C53cKpsHpaYPDJY_12MHM-BLRyywPhrrlw3qumqNThmXgd1TOterAZmOW8sgiJafogofWRwtV3nCF\r\nsprite $printer [15x15/8z] NOtH3W0W208HxFz_kMAhj7lHWpa1XC716sz0Pq4MVPEWfBHIuxP3L6kbTcizR8tAhzaqFvXwvFfPEqm0\r\nsprite $disk {\r\n 444445566677881\r\n 436000000009991\r\n 43600000000ACA1\r\n 53700000001A7A1\r\n 53700000012B8A1\r\n 53800000123B8A1\r\n 63800001233C9A1\r\n 634999AABBC99B1\r\n 744566778899AB1\r\n 7456AAAAA99AAB1\r\n 8566AFC228AABB1\r\n 8567AC8118BBBB1\r\n 867BD4433BBBBB1\r\n 39AAAAABBBBBBC1\r\n}\r\n\r\ntitle Use of sprites (<$printer>, <$bug>...)\r\n\r\nclass Example {\r\n Can have some bug : <$bug>\r\n Click on <$disk> to save\r\n}\r\nnote left : The printer <$printer> is available\r\n\r\n@enduml","description":"Defining and using sprites: Examples"},"Skinparam command: List of all skinparam parameters":{"prefix":"Skinparam command: List of all skinparam parameters","body":"@startuml\r\nhelp skinparams\r\n@enduml\r\n","description":"Skinparam command: List of all skinparam parameters"},"Skinparam command: Black and White":{"prefix":"Skinparam command: Black and White","body":"@startuml\r\n\r\nskinparam monochrome true\r\n\r\nactor User\r\nparticipant \"First Class\" as A\r\nparticipant \"Second Class\" as B\r\nparticipant \"Last Class\" as C\r\n\r\nUser -> A: DoWork\r\nactivate A\r\n\r\nA -> B: Create Request\r\nactivate B\r\n\r\nB -> C: DoWork\r\nactivate C\r\nC --> B: WorkDone\r\ndestroy C\r\n\r\nB --> A: Request Created\r\ndeactivate B\r\n\r\nA --> User: Done\r\ndeactivate A\r\n\r\n@enduml\r\n","description":"Skinparam command: Black and White"},"Skinparam command: Shadowing":{"prefix":"Skinparam command: Shadowing","body":"@startuml\r\n\r\nleft to right direction\r\n\r\nskinparam shadowing<> false\r\nskinparam shadowing<> true\r\n\r\nactor User\r\n(Glowing use case) <> as guc\r\n(Flat use case) <> as fuc\r\nUser -- guc\r\nUser -- fuc\r\n\r\n@enduml","description":"Skinparam command: Shadowing"},"Skinparam command: Reverse colors":{"prefix":"Skinparam command: Reverse colors","body":"@startuml\r\n\r\nskinparam monochrome reverse\r\n\r\nactor User\r\nparticipant \"First Class\" as A\r\nparticipant \"Second Class\" as B\r\nparticipant \"Last Class\" as C\r\n\r\nUser -> A: DoWork\r\nactivate A\r\n\r\nA -> B: Create Request\r\nactivate B\r\n\r\nB -> C: DoWork\r\nactivate C\r\nC --> B: WorkDone\r\ndestroy C\r\n\r\nB --> A: Request Created\r\ndeactivate B\r\n\r\nA --> User: Done\r\ndeactivate A\r\n\r\n@enduml\r\n","description":"Skinparam command: Reverse colors"},"Skinparam command: Text Alignment":{"prefix":"Skinparam command: Text Alignment","body":"@startuml\r\n\r\nskinparam sequenceMessageAlign center\r\nAlice -> Bob : Hi\r\nAlice -> Bob : This is very long\r\n\r\n@enduml\r\n","description":"Skinparam command: Text Alignment"},"Skinparam command: Examples":{"prefix":"Skinparam command: Examples","body":"@startuml\r\n\r\n[AA] <>\r\n[BB] <>\r\n[CC] <>\r\n\r\nnode node1\r\nnode node2 <>\r\ndatabase Production\r\n\r\nskinparam component {\r\n backgroundColor<> DarkKhaki\r\n backgroundColor<> Green\r\n}\r\n\r\nskinparam node {\r\n borderColor Green\r\n backgroundColor Yellow\r\n backgroundColor<> Magenta\r\n}\r\nskinparam databaseBackgroundColor Aqua\r\n\r\n@enduml\r\n","description":"Skinparam command: Examples"},"Preprocessing: Logging":{"prefix":"Preprocessing: Logging","body":"@startuml\r\n\r\n!function bold($text)\r\n !$result = \"\"+ $text +\"\"\r\n !log Calling bold function with $text. The result is $result\r\n !return $result\r\n!endfunction\r\n\r\nAlice -> Bob : This is bold(\"bold\")\r\nAlice -> Bob : This is bold(\"a second call\")\r\n\r\n@enduml","description":"Preprocessing: Logging"},"Preprocessing: Memory dump":{"prefix":"Preprocessing: Memory dump","body":"@startuml\r\n\r\n!function $inc($string)\r\n !$val = %intval($string)\r\n !log value is $val\r\n !dump_memory\r\n !return $val+1\r\n!endfunction\r\n\r\nAlice -> Bob : 4 $inc(\"3\")\r\n!unused = \"foo\"\r\n!dump_memory EOF\r\n\r\n@enduml\r\n","description":"Preprocessing: Memory dump"},"Preprocessing: Assertion":{"prefix":"Preprocessing: Assertion","body":"@startuml\r\n\r\nAlice -> Bob : Hello\r\n!assert %strpos(\"abcdef\", \"cd\") == 3 : \"This always fail\"\r\n\r\n@enduml\r\n","description":"Preprocessing: Assertion"},"Preprocessing: Building custom library":{"prefix":"Preprocessing: Building custom library","body":"@startuml\r\n\r\n!import 14 Building custom library - Include.zip\r\n\r\n!include 14 Building custom library - Include.puml\r\n\r\n@enduml\r\n","description":"Preprocessing: Building custom library"},"Preprocessing: Argument concatenation":{"prefix":"Preprocessing: Argument concatenation","body":"@startuml\r\n\r\n!unquoted procedure COMP_TEXTGENCOMP(name)\r\n [name] << Comp >>\r\n interface Ifc << IfcType >> AS name##Ifc\r\n name##Ifc - [name]\r\n!endprocedure\r\n\r\nCOMP_TEXTGENCOMP(dummy)\r\n\r\n@enduml\r\n","description":"Preprocessing: Argument concatenation"},"Preprocessing: Dynamic function invocation":{"prefix":"Preprocessing: Dynamic function invocation","body":"@startuml\r\n\r\n!function bold($text)\r\n !return \"\"+ $text +\"\"\r\n!endfunction\r\nAlice -> Bob : %call_user_func(\"bold\", \"Hello\") there\r\n\r\n@enduml","description":"Preprocessing: Dynamic function invocation"},"Preprocessing: Variable definition":{"prefix":"Preprocessing: Variable definition","body":"@startuml\r\n\r\n!$ab = \"foo1\"\r\n!$cd = \"foo2\"\r\n!global $ef = $ab + $cd\r\n\r\nAlice -> Bob : $ab\r\nAlice -> Bob : $cd\r\nAlice -> Bob : $ef\r\n\r\n@enduml","description":"Preprocessing: Variable definition"},"Preprocessing: Conditions":{"prefix":"Preprocessing: Conditions","body":"@startuml\r\n\r\n!$a = 10\r\n!$ijk = \"foo\"\r\n\r\nAlice -> Bob : A\r\n\r\n!if ($ijk == \"foo\") && ($a + 10 >= 4)\r\n Alice -> Bob : yes\r\n!else\r\n Alice -> Bob : This should not appear\r\n!endif\r\nAlice -> Bob : B\r\n\r\n@enduml\r\n","description":"Preprocessing: Conditions"},"Preprocessing: Void function":{"prefix":"Preprocessing: Void function","body":"@startuml\r\n\r\n!procedure msg($source, $destination)\r\n $source --> $destination\r\n!endprocedure\r\n\r\n!procedure init_class($name)\r\n class $name {\r\n $addCommonMethod()\r\n }\r\n!endprocedure\r\n\r\n!procedure $addCommonMethod()\r\n toString()\r\n hashCode()\r\n!endprocedure\r\n\r\ninit_class(\"foo1\")\r\ninit_class(\"foo2\")\r\nmsg(\"foo1\", \"foo2\")\r\n\r\n@enduml\r\n","description":"Preprocessing: Void function"},"Preprocessing: Return function":{"prefix":"Preprocessing: Return function","body":"@startuml\r\n\r\n!procedure $dummy()\r\n !local $ijk = \"local\"\r\n Alice -> Bob : $ijk\r\n!endprocedure\r\n\r\n!global $ijk = \"foo\"\r\n\r\nAlice -> Bob : $ijk\r\n$dummy()\r\nAlice -> Bob : $ijk\r\n\r\n@enduml\r\n","description":"Preprocessing: Return function"},"Preprocessing: Default argument value":{"prefix":"Preprocessing: Default argument value","body":"@startuml\r\n\r\n!procedure defaulttest($x, $y=\"DefaultY\", $z=\"DefaultZ\")\r\nnote over Alice\r\n x = $x\r\n y = $y\r\n z = $z\r\nend note\r\n!endprocedure\r\n\r\ndefaulttest(1, 2, 3)\r\ndefaulttest(1, 2)\r\ndefaulttest(1)\r\n\r\n@enduml","description":"Preprocessing: Default argument value"},"Preprocessing: Unquoted function":{"prefix":"Preprocessing: Unquoted function","body":"@startuml\r\n\r\n!unquoted function id($text1, $text2=\"FOO\") return $text1 + $text2\r\n\r\nalice -> bob : id(aa)\r\nalice -> bob : id(ab,cd)\r\n\r\n@enduml","description":"Preprocessing: Unquoted function"},"Preprocessing: Including files or URL":{"prefix":"Preprocessing: Including files or URL","body":"@startuml\r\n\r\n!include 8 Including files or URL - List.iuml\r\nList <|.. ArrayList\r\n\r\n@enduml","description":"Preprocessing: Including files or URL"},"Preprocessing: Including Subpart - File":{"prefix":"Preprocessing: Including Subpart - File","body":"@startuml\r\n\r\nA -> A : stuff1\r\n!startsub BASIC\r\nB -> B : stuff2\r\n!endsub\r\n\r\nC -> C : stuff3\r\n\r\n!startsub BASIC\r\nD -> D : stuff4\r\n!endsub\r\n\r\n@enduml\r\n","description":"Preprocessing: Including Subpart - File"},"Preprocessing: Including Subpart":{"prefix":"Preprocessing: Including Subpart","body":"@startuml\r\n\r\ntitle this contains only B and D\r\n!includesub 9 Including Subpart - File.puml!BASIC\r\n\r\n@enduml","description":"Preprocessing: Including Subpart"},"Use Case Diagram: Usecases":{"prefix":"Use Case Diagram: Usecases","body":"@startuml\r\n\r\n(First usecase)\r\n(Another usecase) as (UC2)\r\nusecase UC3\r\nusecase (Last\\nusecase) as UC4\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Usecases"},"Use Case Diagram: Left to right direction":{"prefix":"Use Case Diagram: Left to right direction","body":"@startuml\r\n\r\nleft to right direction\r\nuser1 --> (Usecase 1)\r\nuser2 --> (Usecase 2)\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Left to right direction"},"Use Case Diagram: Skinparam":{"prefix":"Use Case Diagram: Skinparam","body":"@startuml\r\n\r\nskinparam handwritten true\r\nskinparam usecase {\r\n BackgroundColor DarkSeaGreen\r\n BorderColor DarkSlateGray\r\n BackgroundColor<< Main >> YellowGreen\r\n BorderColor<< Main >> YellowGreen\r\n ArrowColor Olive\r\n ActorBorderColor black\r\n ActorFontName Courier\r\n ActorBackgroundColor<< Human >> Gold\r\n}\r\n\r\nUser << Human >>\r\n:Main Database: as MySql << Application >>\r\n(Start) << One Shot >>\r\n(Use the application) as (Use) << Main >>\r\n\r\nUser -> (Start)\r\nUser --> (Use)\r\nMySql --> (Use)\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Skinparam"},"Use Case Diagram: Complete example":{"prefix":"Use Case Diagram: Complete example","body":"@startuml\r\n\r\nleft to right direction\r\nskinparam packageStyle rectangle\r\n\r\nactor customer\r\nactor clerk\r\n\r\nrectangle checkout {\r\n customer -- (checkout)\r\n (checkout) .> (payment) : include\r\n (help) .> (checkout) : extends\r\n (checkout) -- clerk\r\n}\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Complete example"},"Use Case Diagram: Actors":{"prefix":"Use Case Diagram: Actors","body":"@startuml\r\n\r\n:First Actor:\r\n:Another\\nactor: as Men2\r\nactor Men3\r\nactor :Last actor: as Men4\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Actors"},"Use Case Diagram: Usecases description":{"prefix":"Use Case Diagram: Usecases description","body":"@startuml\r\n\r\nusecase UC1 as \"You can use\r\nseveral lines to define your usecase.\r\nYou can also use separators.\r\n--\r\nSeveral separators are possible.\r\n==\r\nAnd you can add titles:\r\n..Conclusion..\r\nThis allows large description.\"\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Usecases description"},"Use Case Diagram: Basic example":{"prefix":"Use Case Diagram: Basic example","body":"@startuml\r\n\r\nUser -> (Start)\r\nUser --> (Use the application) : A small label\r\n:Main Admin: ---> (Use the application) : This is\\nyet another\\nlabel\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Basic example"},"Use Case Diagram: Extension":{"prefix":"Use Case Diagram: Extension","body":"@startuml\r\n\r\n:Main Admin: as Admin\r\n(Use the application) as (Use)\r\nUser <|-- Admin\r\n(Start) <|-- (Use)\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Extension"},"Use Case Diagram: Using notes":{"prefix":"Use Case Diagram: Using notes","body":"@startuml\r\n\r\n:Main Admin: as Admin\r\n(Use the application) as (Use)\r\nUser -> (Start)\r\nUser --> (Use)\r\nAdmin ---> (Use)\r\n\r\nnote right of Admin : This is an example.\r\nnote right of (Use)\r\n A note can also\r\n be on several lines\r\nend note\r\n\r\nnote \"This note is connected\\nto several objects.\" as N2\r\n(Start) .. N2\r\nN2 .. (Use)\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Using notes"},"Use Case Diagram: Stereotypes":{"prefix":"Use Case Diagram: Stereotypes","body":"@startuml\r\n\r\nUser << Human >>\r\n:Main Database: as MySql << Application >>\r\n(Start) << One Shot >>\r\n(Use the application) as (Use) << Main >>\r\nUser -> (Start)\r\nUser --> (Use)\r\nMySql --> (Use)\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Stereotypes"},"Use Case Diagram: Changing arrows direction":{"prefix":"Use Case Diagram: Changing arrows direction","body":"@startuml\r\n\r\n:user: -left-> (dummyLeft)\r\n:user: -right-> (dummyRight)\r\n:user: -up-> (dummyUp)\r\n:user: -down-> (dummyDown)\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Changing arrows direction"},"Use Case Diagram: Splitting diagrams":{"prefix":"Use Case Diagram: Splitting diagrams","body":"@startuml\r\n\r\n:actor1: --> (Usecase1)\r\nnewpage\r\n:actor2: --> (Usecase2)\r\n\r\n@enduml\r\n","description":"Use Case Diagram: Splitting diagrams"},"Unicode: Examples":{"prefix":"Unicode: Examples","body":"@startuml\r\n\r\n() \"Σωκράτηςψεύτης\" as Σωκράτης\r\nΣωκράτης - [Πτηνά πολεμοχαρής]\r\n[Πτηνά πολεμοχαρής] ..> () Αθήνα : Αυτές οι φράσειςσημαίνουν τίποτα\r\n\r\n@enduml\r\n","description":"Unicode: Examples"},"Standard library: AWS library":{"prefix":"Standard library: AWS library","body":"' Repository: https://github.com/milo-minderbinder/AWS-PlantUML\r\n' Note: The example is from the repository, and not from the documentation\r\n\r\n@startuml\r\n\r\n!define AWSPUML https://raw.githubusercontent.com/milo-minderbinder/AWS-PlantUML/release/18-2-22/dist\r\n!includeurl AWSPUML/common.puml\r\n!includeurl AWSPUML/Storage/AmazonS3/AmazonS3.puml\r\n!includeurl AWSPUML/Storage/AmazonS3/bucket/bucket.puml\r\n\r\nAMAZONS3(s3_internal)\r\nAMAZONS3(s3_partner,\"Vendor's S3\")\r\ns3_internal <-- s3_partner\r\n\r\n@enduml","description":"Standard library: AWS library"},"Standard library: Azure library":{"prefix":"Standard library: Azure library","body":"' Repository: https://github.com/RicardoNiepel/Azure-PlantUML/\r\n' Note: The example is from the repository, and not from the documentation\r\n\r\n@startuml Hello World\r\n\r\n!define AzurePuml https://raw.githubusercontent.com/RicardoNiepel/Azure-PlantUML/release/2-1/dist\r\n!includeurl AzurePuml/AzureCommon.puml\r\n!includeurl AzurePuml/Databases/all.puml\r\n!includeurl AzurePuml/Compute/AzureFunction.puml\r\n\r\nactor \"Person\" as personAlias\r\nAzureFunction(functionAlias, \"Label\", \"Technology\", \"Optional Description\")\r\nAzureCosmosDb(cosmosDbAlias, \"Label\", \"Technology\", \"Optional Description\")\r\n\r\npersonAlias --> functionAlias\r\nfunctionAlias --> cosmosDbAlias\r\n\r\n@enduml","description":"Standard library: Azure library"},"Standard library: Cloud Insight":{"prefix":"Standard library: Cloud Insight","body":"' Repository: https://github.com/rabelenda/cicon-plantuml-sprites\r\n' Note: The example is from the repository, and not from the documentation\r\n\r\n@startuml\r\n\r\n!define SPRITESURL https://raw.githubusercontent.com/rabelenda/cicon-plantuml-sprites/v1.0/sprites\r\n!includeurl SPRITESURL/tomcat.puml\r\n!includeurl SPRITESURL/kafka.puml\r\n!includeurl SPRITESURL/java.puml\r\n!includeurl SPRITESURL/cassandra.puml\r\n\r\ntitle Cloudinsight sprites example\r\n\r\nskinparam monochrome true\r\n\r\nrectangle \"<$tomcat>\\nwebapp\" as webapp\r\nqueue \"<$kafka>\" as kafka\r\nrectangle \"<$java>\\ndaemon\" as daemon\r\ndatabase \"<$cassandra>\" as cassandra\r\n\r\nwebapp -> kafka\r\nkafka -> daemon\r\ndaemon --> cassandra \r\n\r\n@enduml","description":"Standard library: Cloud Insight"},"Standard library: Devicons and Font Awesome library":{"prefix":"Standard library: Devicons and Font Awesome library","body":"' Repository: https://github.com/tupadr3/plantuml-icon-font-sprites\r\n' Note: The example is from the repository, and not from the documentation\r\n\r\n@startuml\r\n\r\nskinparam defaultTextAlignment center\r\n\r\n!define ICONURL https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/v2.2.0\r\n\r\n!includeurl ICONURL/common.puml\r\n!includeurl ICONURL/devicons/mysql.puml\r\n!includeurl ICONURL/font-awesome/server.puml\r\n!includeurl ICONURL/font-awesome-5/database.puml\r\n\r\ntitle Styling example\r\n\r\nFA_SERVER(web1,WEB1) #Green\r\nFA_SERVER(web2,WEB1) #Yellow\r\nFA_SERVER(web3,WEB1) #Blue\r\nFA_SERVER(web4,WEB1) #YellowGreen\r\n\r\nFA5_DATABASE(db1,LIVE,database,white) #RoyalBlue\r\nDEV_MYSQL(db2,SPARE,database) #Red\r\n\r\ndb1 <--> db2\r\n\r\nweb1 <--> db1\r\nweb2 <--> db1\r\nweb3 <--> db1\r\nweb4 <--> db1\r\n\r\n@enduml\r\n","description":"Standard library: Devicons and Font Awesome library"},"Standard library: Google Material Icons":{"prefix":"Standard library: Google Material Icons","body":"' Repository: https://github.com/Templarian/MaterialDesign\r\n\r\n@startuml\r\n\r\n!include \r\n' To import the sprite file you DON'T need to place a prefix!\r\n!include \r\n\r\nMA_FOLDER_MOVE(Red, 1, dir, rectangle, \"A label\") {\r\n}\r\n\r\nclass foo {\r\n bar\r\n}\r\n\r\n@enduml\r\n","description":"Standard library: Google Material Icons"},"Standard library: Office":{"prefix":"Standard library: Office","body":"' Repository: https://github.com/Roemer/plantuml-office\r\n' Note: The example is from the repository, and not from the documentation\r\n\r\n@startuml\r\n\r\n!includeurl https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/v2.2.0/common.puml\r\n\r\n!define ICONURL https://raw.githubusercontent.com/Roemer/plantuml-office/master/office2014\r\n!includeurl ICONURL/Servers/database_server.puml\r\n!includeurl ICONURL/Servers/application_server.puml\r\n!includeurl ICONURL/Concepts/firewall_orange.puml\r\n!includeurl ICONURL/Clouds/cloud_disaster_red.puml\r\n\r\n' Used to center the label under the images\r\nskinparam defaultTextAlignment center\r\n\r\ntitle Extended Office Icons Example\r\n\r\npackage \"Use sprite directly\" {\r\n [Some <$cloud_disaster_red> object]\r\n}\r\n\r\npackage \"Different makro usages\" {\r\n OFF_CLOUD_DISASTER_RED(cloud1)\r\n OFF_CLOUD_DISASTER_RED(cloud2,Default with text)\r\n OFF_CLOUD_DISASTER_RED(cloud3,Other shape,Folder)\r\n OFF_CLOUD_DISASTER_RED(cloud4,Even another shape,Database)\r\n OFF_CLOUD_DISASTER_RED(cloud5,Colored,Rectangle, red)\r\n OFF_CLOUD_DISASTER_RED(cloud6,Colored background) #red\r\n}\r\n\r\n@enduml","description":"Standard library: Office"},"Standard library: ArchiMate":{"prefix":"Standard library: ArchiMate","body":"' Repository: https://github.com/ebbypeter/Archimate-PlantUML\r\n\r\n@startuml\r\n\r\n!includeurl https://raw.githubusercontent.com/ebbypeter/Archimate-PlantUML/master/Archimate.puml\r\n\r\ntitle Archimate Sample - Internet Browser\r\n\r\n' Elements\r\nBusiness_Object(businessObject, \"A Business Object\")\r\nBusiness_Process(someBusinessProcess,\"Some Business Process\")\r\nBusiness_Service(itSupportService, \"IT Support for Business (Application Service)\")\r\nApplication_DataObject(dataObject, \"Web Page Data \\n 'on the fly'\")\r\nApplication_Function(webpageBehaviour, \"Web page behaviour\")\r\nApplication_Component(ActivePartWebPage, \"Active Part of the web page \\n 'on the fly'\")\r\nTechnology_Artifact(inMemoryItem,\"in memory / 'on the fly' html/javascript\")\r\nTechnology_Service(internetBrowser, \"Internet Browser Generic & Plugin\")\r\nTechnology_Service(internetBrowserPlugin, \"Some Internet Browser Plugin\")\r\nTechnology_Service(webServer, \"Some web server\")\r\n\r\n'Relationships\r\nRel_Flow_Left(someBusinessProcess, businessObject, \"\")\r\nRel_Serving_Up(itSupportService, someBusinessProcess, \"\")\r\nRel_Specialization_Up(webpageBehaviour, itSupportService, \"\")\r\nRel_Flow_Right(dataObject, webpageBehaviour, \"\")\r\nRel_Specialization_Up(dataObject, businessObject, \"\")\r\nRel_Assignment_Left(ActivePartWebPage, webpageBehaviour, \"\")\r\nRel_Specialization_Up(inMemoryItem, dataObject, \"\")\r\nRel_Realization_Up(inMemoryItem, ActivePartWebPage, \"\")\r\nRel_Specialization_Right(inMemoryItem,internetBrowser, \"\")\r\nRel_Serving_Up(internetBrowser, webpageBehaviour, \"\")\r\nRel_Serving_Up(internetBrowserPlugin, webpageBehaviour, \"\")\r\nRel_Aggregation_Right(internetBrowser, internetBrowserPlugin, \"\")\r\nRel_Access_Up(webServer, inMemoryItem, \"\")\r\nRel_Serving_Up(webServer, internetBrowser, \"\")\r\n\r\n@enduml","description":"Standard library: ArchiMate"},"Standard library: Miscellaneous":{"prefix":"Standard library: Miscellaneous","body":"@startuml\r\nstdlib\r\n@enduml","description":"Standard library: Miscellaneous"},"Class Diagram: Abstract class and interface":{"prefix":"Class Diagram: Abstract class and interface","body":"@startuml\r\n\r\nabstract class AbstractList\r\nabstract AbstractCollection\r\ninterface List\r\ninterface Collection\r\n\r\nList <|-- AbstractList\r\nCollection <|-- AbstractCollection\r\nCollection <|- List\r\nAbstractCollection <|- AbstractList\r\nAbstractList <|-- ArrayList\r\n\r\nclass ArrayList {\r\n Object[] elementData\r\n size()\r\n}\r\n\r\nenum TimeUnit {\r\n DAYS\r\n HOURS\r\n MINUTES\r\n}\r\n\r\nannotation SuppressWarnings\r\n\r\n@enduml","description":"Class Diagram: Abstract class and interface"},"Class Diagram: Using non-letters":{"prefix":"Class Diagram: Using non-letters","body":"@startuml\r\n\r\nclass \"This is my class\" as class1\r\nclass class2 as \"It works this way too\"\r\nclass2 *-- \"foo/dummy\" : use\r\n\r\n@enduml","description":"Class Diagram: Using non-letters"},"Class Diagram: Hide attributes, methods":{"prefix":"Class Diagram: Hide attributes, methods","body":"@startuml\r\n\r\nclass Dummy1 {\r\n +myMethods()\r\n}\r\n\r\nclass Dummy2 {\r\n +hiddenMethod()\r\n}\r\n\r\nclass Dummy3 <> {\r\n String name\r\n}\r\n\r\nhide members\r\nhide <> circle\r\nshow Dummy1 methods\r\nshow <> fields\r\n\r\n@enduml","description":"Class Diagram: Hide attributes, methods"},"Class Diagram: Hide classes":{"prefix":"Class Diagram: Hide classes","body":"@startuml\r\n\r\nclass Foo1\r\nclass Foo2\r\n\r\nFoo2 *-- Foo1\r\n\r\nhide Foo2\r\n\r\n@enduml","description":"Class Diagram: Hide classes"},"Class Diagram: Use generics":{"prefix":"Class Diagram: Use generics","body":"@startuml\r\n\r\nclass Foo {\r\n int size()\r\n}\r\n\r\nFoo *- Element\r\n\r\n@enduml","description":"Class Diagram: Use generics"},"Class Diagram: Specific Spot":{"prefix":"Class Diagram: Specific Spot","body":"@startuml\r\n\r\nclass System << (S,#FF7700) Singleton >>\r\nclass Date << (D,orchid) >>\r\n\r\n@enduml","description":"Class Diagram: Specific Spot"},"Class Diagram: Packages":{"prefix":"Class Diagram: Packages","body":"@startuml\r\n\r\npackage \"Classic Collections\" #DDDDDD {\r\n Object <|-- ArrayList\r\n}\r\n\r\npackage net.sourceforge.plantuml {\r\n Object <|-- Demo1\r\n Demo1 *- Demo2\r\n}\r\n\r\n@enduml","description":"Class Diagram: Packages"},"Class Diagram: Packages style":{"prefix":"Class Diagram: Packages style","body":"@startuml\r\n\r\nskinparam packageStyle rectangle\r\n\r\npackage foo1.foo2 {\r\n}\r\n\r\npackage foo1.foo2.foo3 {\r\n class Object\r\n}\r\n\r\nfoo1.foo2 +-- foo1.foo2.foo3\r\n\r\n@enduml","description":"Class Diagram: Packages style"},"Class Diagram: Namespaces":{"prefix":"Class Diagram: Namespaces","body":"@startuml\r\n\r\nclass BaseClass\r\n\r\nnamespace net.dummy #DDDDDD {\r\n .BaseClass <|-- Person\r\n Meeting o-- Person\r\n .BaseClass <|- Meeting\r\n}\r\n\r\nnamespace net.foo {\r\n net.dummy.Person <|- Person\r\n .BaseClass <|-- Person\r\n net.dummy.Meeting o-- Person\r\n}\r\n\r\nBaseClass <|-- net.unused.Person\r\n\r\n@enduml","description":"Class Diagram: Namespaces"},"Class Diagram: Automatic namespace creation":{"prefix":"Class Diagram: Automatic namespace creation","body":"@startuml\r\n\r\nset namespaceSeparator none\r\n class X1.X2.foo {\r\n some info\r\n}\r\n\r\n@enduml","description":"Class Diagram: Automatic namespace creation"},"Class Diagram: Relations between classes":{"prefix":"Class Diagram: Relations between classes","body":"@startuml\r\n\r\nClass21 #-- Class22\r\nClass23 x-- Class24\r\nClass25 }-- Class26\r\nClass27 +-- Class28\r\nClass29 ^-- Class30\r\n\r\n@enduml","description":"Class Diagram: Relations between classes"},"Class Diagram: Label on relations":{"prefix":"Class Diagram: Label on relations","body":"@startuml\r\n\r\nClass01 \"1\" *-- \"many\" Class02 : contains\r\nClass03 o-- Class04 : aggregation\r\nClass05 --> \"1\" Class06\r\n\r\n@enduml","description":"Class Diagram: Label on relations"},"Class Diagram: Lollipop interface":{"prefix":"Class Diagram: Lollipop interface","body":"@startuml\r\n\r\nclass foo\r\nbar ()- foo\r\n\r\n@enduml","description":"Class Diagram: Lollipop interface"},"Class Diagram: Changing arrows direction":{"prefix":"Class Diagram: Changing arrows direction","body":"@startuml\r\n\r\nfoo -left-> dummyLeft\r\nfoo -right-> dummyRight\r\nfoo -up-> dummyUp\r\nfoo -down-> dummyDown\r\n\r\n@enduml","description":"Class Diagram: Changing arrows direction"},"Class Diagram: Changing arrows direction copy":{"prefix":"Class Diagram: Changing arrows direction copy","body":"@startuml\r\n\r\nStudent -o Room\r\nChair --* Room\r\n\r\n@enduml","description":"Class Diagram: Changing arrows direction copy"},"Class Diagram: Association classes":{"prefix":"Class Diagram: Association classes","body":"@startuml\r\n\r\nclass Student {\r\n Name\r\n}\r\nStudent \"0..*\" -- \"1..*\" Course\r\n(Student, Course) . Enrollment\r\n\r\nclass Enrollment {\r\n drop()\r\n cancel()\r\n}\r\n\r\n@enduml","description":"Class Diagram: Association classes"},"Class Diagram: Skinparam":{"prefix":"Class Diagram: Skinparam","body":"@startuml\r\n\r\nskinparam class {\r\n BackgroundColor PaleGreen\r\n ArrowColor SeaGreen\r\n BorderColor SpringGreen\r\n}\r\nskinparam stereotypeCBackgroundColor YellowGreen\r\n\r\nClass01 \"1\" *-- \"many\" Class02 : contains\r\nClass03 o-- Class04 : aggregation\r\n\r\n@enduml\r\n","description":"Class Diagram: Skinparam"},"Class Diagram: Skinned Stereotypes":{"prefix":"Class Diagram: Skinned Stereotypes","body":"@startuml\r\n\r\nskinparam class {\r\n BackgroundColor PaleGreen\r\n ArrowColor SeaGreen\r\n BorderColor SpringGreen\r\n BackgroundColor<> Wheat\r\n BorderColor<> Tomato\r\n}\r\nskinparam stereotypeCBackgroundColor YellowGreen\r\nskinparam stereotypeCBackgroundColor<< Foo >> DimGray\r\n\r\nClass01 <>\r\nClass03 <>\r\nClass01 \"1\" *-- \"many\" Class02 : contains\r\nClass03 o-- Class04 : aggregation\r\n\r\n@enduml\r\n","description":"Class Diagram: Skinned Stereotypes"},"Class Diagram: Color gradient":{"prefix":"Class Diagram: Color gradient","body":"@startuml\r\n\r\nskinparam backgroundcolor AntiqueWhite/Gold\r\nskinparam classBackgroundColor Wheat|CornflowerBlue\r\n\r\nclass Foo #red-green\r\nnote left of Foo #blue\\9932CC\r\n this is my\r\n note on this class\r\nend note\r\n\r\npackage example #GreenYellow/LightGoldenRodYellow {\r\n class Dummy\r\n}\r\n\r\n@enduml\r\n","description":"Class Diagram: Color gradient"},"Class Diagram: Help on layout":{"prefix":"Class Diagram: Help on layout","body":"@startuml\r\n\r\nclass Bar1\r\nclass Bar2\r\ntogether {\r\n class Together1\r\n class Together2\r\n class Together3\r\n}\r\n\r\nTogether1 - Together2\r\nTogether2 - Together3\r\nTogether2 -[hidden]--> Bar1\r\nBar1 -[hidden]> Bar2\r\n\r\n@enduml\r\n","description":"Class Diagram: Help on layout"},"Class Diagram: Splitting large files":{"prefix":"Class Diagram: Splitting large files","body":"@startuml\r\n\r\n' Split into 4 pages\r\npage 2x2\r\nskinparam pageMargin 10\r\nskinparam pageExternalColor gray\r\nskinparam pageBorderColor black\r\n\r\nclass BaseClass\r\n\r\nnamespace net.dummy #DDDDDD {\r\n .BaseClass <|-- Person\r\n Meeting o-- Person\r\n .BaseClass <|- Meeting\r\n}\r\n\r\nnamespace net.foo {\r\n net.dummy.Person <|- Person\r\n .BaseClass <|-- Person\r\n net.dummy.Meeting o-- Person\r\n}\r\n\r\nBaseClass <|-- net.unused.Person\r\n\r\n@enduml\r\n","description":"Class Diagram: Splitting large files"},"Class Diagram: Label on relations copy":{"prefix":"Class Diagram: Label on relations copy","body":"@startuml\r\n\r\nDriver - Car : drives >\r\nCar *- Wheel : have 4 >\r\nCar -- Person : < owns\r\n\r\n@enduml","description":"Class Diagram: Label on relations copy"},"Class Diagram: Adding methods":{"prefix":"Class Diagram: Adding methods","body":"@startuml\r\n\r\nclass Dummy {\r\n {field} A field (despite parentheses)\r\n {method} Some method\r\n}\r\n\r\n@enduml","description":"Class Diagram: Adding methods"},"Class Diagram: Defining visibility":{"prefix":"Class Diagram: Defining visibility","body":"@startuml\r\n\r\nskinparam classAttributeIconSize 0\r\n\r\nclass Dummy {\r\n -field1\r\n #field2\r\n ~method1()\r\n +method2()\r\n}\r\n\r\n@enduml","description":"Class Diagram: Defining visibility"},"Class Diagram: Abstract and Static":{"prefix":"Class Diagram: Abstract and Static","body":"@startuml\r\n\r\nclass Dummy {\r\n {static} String id\r\n {abstract} void methods()\r\n}\r\n\r\n@enduml","description":"Class Diagram: Abstract and Static"},"Class Diagram: Advanced class body":{"prefix":"Class Diagram: Advanced class body","body":"@startuml\r\n\r\nclass Foo1 {\r\n You can use\r\n several lines\r\n ..\r\n as you want\r\n and group\r\n ==\r\n things together.\r\n __\r\n You can have as many groups\r\n as you want\r\n --\r\n End of class\r\n}\r\n\r\nclass User {\r\n .. Simple Getter ..\r\n + getName()\r\n + getAddress()\r\n .. Some setter ..\r\n + setName()\r\n __ private data __\r\n int age\r\n -- encrypted --\r\n String password\r\n}\r\n\r\n@enduml","description":"Class Diagram: Advanced class body"},"Class Diagram: Notes and stereotypes":{"prefix":"Class Diagram: Notes and stereotypes","body":"@startuml\r\n\r\nclass Object << general >>\r\nObject <|--- ArrayList\r\n\r\nnote top of Object : In java, every class\\nextends this one.\r\n\r\nnote \"This is a floating note\" as N1\r\nnote \"This note is connected\\nto several objects.\" as N2\r\nObject .. N2\r\nN2 .. ArrayList\r\n\r\nclass Foo\r\nnote left: On last defined class\r\n\r\n@enduml","description":"Class Diagram: Notes and stereotypes"},"Class Diagram: More on notes":{"prefix":"Class Diagram: More on notes","body":"@startuml\r\n\r\nclass Foo\r\nnote left: On last defined class\r\n\r\nnote top of Object\r\n In java, every class\r\n extends\r\n this one.\r\nend note\r\n\r\nnote as N1\r\n This note is also\r\n on several\r\n words lines\r\n And this is hosted by \r\nend note\r\n\r\n@enduml","description":"Class Diagram: More on notes"},"Class Diagram: Note on links":{"prefix":"Class Diagram: Note on links","body":"@startuml\r\n\r\nclass Dummy\r\nDummy --> Foo : A link\r\nnote on link #red: note that is red\r\n\r\nDummy --> Foo2 : Another link\r\nnote right on link #blue\r\n this is my note on right link\r\n and in blue\r\nend note\r\n\r\n@enduml","description":"Class Diagram: Note on links"},"Activity Diagram: Simple Activity":{"prefix":"Activity Diagram: Simple Activity","body":"@startuml\r\n\r\n(*) --> \"First Activity\"\r\n\"First Activity\" --> (*)\r\n\r\n@enduml\r\n","description":"Activity Diagram: Simple Activity"},"Activity Diagram: Skinparam":{"prefix":"Activity Diagram: Skinparam","body":"@startuml\r\n\r\nskinparam backgroundColor #AAFFFF\r\nskinparam activity {\r\n StartColor red\r\n BarColor SaddleBrown\r\n EndColor Silver\r\n BackgroundColor Peru\r\n BackgroundColor<< Begin >> Olive\r\n BorderColor Peru\r\n FontName Impact\r\n}\r\n\r\n(*) --> \"Climbs on Platform\" << Begin >>\r\n--> === S1 ===\r\n--> Bows\r\n--> === S2 ===\r\n--> WavesArmes\r\n--> (*)\r\n\r\n@enduml\r\n","description":"Activity Diagram: Skinparam"},"Activity Diagram: Octagon":{"prefix":"Activity Diagram: Octagon","body":"@startuml\r\n\r\n'Default is skinparam activityShape roundBox\r\nskinparam activityShape octagon\r\n(*) --> \"First Activity\"\r\n\"First Activity\" --> (*)\r\n\r\n@enduml\r\n","description":"Activity Diagram: Octagon"},"Activity Diagram: Complete example":{"prefix":"Activity Diagram: Complete example","body":"@startuml\r\n\r\ntitle Servlet Container\r\n\r\n(*) --> \"ClickServlet.handleRequest()\"\r\n--> \"new Page\"\r\n\r\nif \"Page.onSecurityCheck\" then\r\n ->[true] \"Page.onInit()\"\r\n\r\n if \"isForward?\" then\r\n ->[no] \"Process controls\"\r\n\r\n if \"continue processing?\" then\r\n -->[yes] ===RENDERING===\r\n else\r\n -->[no] ===REDIRECT_CHECK===\r\n endif\r\n else\r\n -->[yes] ===RENDERING===\r\n endif\r\n \r\n if \"is Post?\" then\r\n -->[yes] \"Page.onPost()\"\r\n --> \"Page.onRender()\" as render\r\n --> ===REDIRECT_CHECK===\r\n else\r\n -->[no] \"Page.onGet()\"\r\n --> render\r\n endif\r\nelse\r\n -->[false] ===REDIRECT_CHECK===\r\nendif\r\n\r\nif \"Do redirect?\" then\r\n ->[yes] \"redirect request\"\r\n --> ==BEFORE_DESTROY===\r\nelse\r\n if \"Do Forward?\" then\r\n -left->[yes] \"Forward request\"\r\n --> ==BEFORE_DESTROY===\r\n else\r\n -right->[no] \"Render page template\"\r\n --> ==BEFORE_DESTROY===\r\n endif\r\nendif\r\n\r\n--> \"Page.onDestroy()\"\r\n-->(*)\r\n\r\n@enduml\r\n","description":"Activity Diagram: Complete example"},"Activity Diagram: Label on arrows":{"prefix":"Activity Diagram: Label on arrows","body":"@startuml\r\n\r\n(*) --> \"First Activity\"\r\n-->[You can put also labels] \"Second Activity\"\r\n--> (*)\r\n\r\n@enduml\r\n","description":"Activity Diagram: Label on arrows"},"Activity Diagram: Changing arrow direction":{"prefix":"Activity Diagram: Changing arrow direction","body":"@startuml\r\n\r\n(*) -up-> \"First Activity\"\r\n-right-> \"Second Activity\"\r\n--> \"Third Activity\"\r\n-left-> (*)\r\n\r\n@enduml\r\n","description":"Activity Diagram: Changing arrow direction"},"Activity Diagram: Branches":{"prefix":"Activity Diagram: Branches","body":"@startuml\r\n\r\n(*) --> \"check input\"\r\n\r\nIf \"input is verbose\" then\r\n --> [Yes] \"turn on verbosity\"\r\n --> \"run command\"\r\nelse\r\n --> \"run command\"\r\nEndif\r\n\r\n-->(*)\r\n\r\n@enduml\r\n","description":"Activity Diagram: Branches"},"Activity Diagram: More on Branches":{"prefix":"Activity Diagram: More on Branches","body":"@startuml\r\n\r\n(*) --> if \"Some Test\" then\r\n -->[true] \"activity 1\"\r\n if \"\" then\r\n -> \"activity 3\" as a3\r\n else\r\n if \"Other test\" then\r\n -left-> \"activity 5\"\r\n else\r\n --> \"activity 6\"\r\n endif\r\n endif\r\nelse\r\n ->[false] \"activity 2\"\r\nendif\r\n\r\na3 --> if \"last test\" then\r\n --> \"activity 7\"\r\nelse\r\n -> \"activity 8\"\r\nendif\r\n\r\n@enduml\r\n","description":"Activity Diagram: More on Branches"},"Activity Diagram: Synchronization":{"prefix":"Activity Diagram: Synchronization","body":"@startuml\r\n\r\n(*) --> ===B1===\r\n--> \"Parallel Activity 1\"\r\n--> ===B2===\r\n===B1=== --> \"Parallel Activity 2\"\r\n--> ===B2===\r\n--> (*)\r\n\r\n@enduml\r\n","description":"Activity Diagram: Synchronization"},"Activity Diagram: Long activity description":{"prefix":"Activity Diagram: Long activity description","body":"@startuml\r\n\r\n(*) -left-> \"this activity\r\nis very long2\r\nand defined on several lines\r\nthat contains many text\" as A1\r\n-up-> \"Another activity\\n on several lines\"\r\nA1 --> \"Short activity \"\r\n\r\n@enduml\r\n","description":"Activity Diagram: Long activity description"},"Activity Diagram: Notes":{"prefix":"Activity Diagram: Notes","body":"@startuml\r\n\r\n(*) --> \"Some Activity\"\r\nnote right: This activity has to be defined\r\n\r\n\"Some Activity\" --> (*)\r\nnote left\r\n This note is on\r\n several lines\r\nend note\r\n\r\n@enduml\r\n","description":"Activity Diagram: Notes"},"Activity Diagram: Partition":{"prefix":"Activity Diagram: Partition","body":"@startuml\r\n\r\npartition Conductor {\r\n (*) --> \"Climbs on Platform\"\r\n --> === S1 ===\r\n --> Bows\r\n}\r\n\r\npartition Audience #LightSkyBlue {\r\n === S1 === --> Applauds\r\n}\r\n\r\npartition Conductor {\r\n Bows --> === S2 ===\r\n --> WavesArmes\r\n Applauds --> === S2 ===\r\n}\r\n\r\npartition Orchestra #CCCCEE {\r\n WavesArmes --> Introduction\r\n --> \"Play music\"\r\n}\r\n\r\n@enduml\r\n","description":"Activity Diagram: Partition"},"Activity Diagram (beta): Simple Activity":{"prefix":"Activity Diagram (beta): Simple Activity","body":"@startuml\r\n\r\n:Hello world;\r\n:This is defined on\r\nseveral **lines**;\r\n\r\n@enduml","description":"Activity Diagram (beta): Simple Activity"},"Activity Diagram (beta): Connector":{"prefix":"Activity Diagram (beta): Connector","body":"@startuml\r\n\r\nstart\r\n:Some activity;\r\n(A)\r\ndetach\r\n(A)\r\n:Other activity;\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Connector"},"Activity Diagram (beta): Grouping":{"prefix":"Activity Diagram (beta): Grouping","body":"@startuml\r\n\r\nstart\r\n\r\npartition Initialization {\r\n :read config file;\r\n :init internal variable;\r\n}\r\n\r\npartition Running {\r\n :wait for user interaction;\r\n :print information;\r\n}\r\n\r\nstop\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Grouping"},"Activity Diagram (beta): Swimlanes":{"prefix":"Activity Diagram (beta): Swimlanes","body":"@startuml\r\n\r\n|Swimlane1|\r\nstart\r\n:foo1;\r\n|#AntiqueWhite|Swimlane2|\r\n:foo2;\r\n:foo3;\r\n|Swimlane1|\r\n:foo4;\r\n|Swimlane2|\r\n:foo5;\r\nstop\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Swimlanes"},"Activity Diagram (beta): Detach":{"prefix":"Activity Diagram (beta): Detach","body":"@startuml\r\n\r\n:start;\r\nfork\r\n:foo1;\r\n:foo2;\r\nfork again\r\n:foo3;\r\ndetach\r\nendfork\r\nif (foo4) then\r\n :foo5;\r\n detach\r\nendif\r\n:foo6;\r\ndetach\r\n:foo7;\r\nstop\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Detach"},"Activity Diagram (beta): SDL":{"prefix":"Activity Diagram (beta): SDL","body":"@startuml\r\n\r\n:Ready;\r\n:next(o)|\r\n:Receiving;\r\nsplit\r\n:nak(i)<\r\n:ack(o)>\r\nsplit again\r\n:ack(i)<\r\n:next(o)\r\non several lines|\r\n:i := i + 1]\r\n:ack(o)>\r\nsplit again\r\n:err(i)<\r\n:nak(o)>\r\nsplit again\r\n:foo/\r\nsplit again\r\n:i > 5}\r\nstop\r\nend split\r\n:finish;\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): SDL"},"Activity Diagram (beta): Complete example":{"prefix":"Activity Diagram (beta): Complete example","body":"@startuml\r\n\r\nstart\r\n:ClickServlet.handleRequest();\r\n:new page;\r\n\r\nif (Page.onSecurityCheck) then (true)\r\n :Page.onInit();\r\n if (isForward?) then (no)\r\n:Process controls;\r\nif (continue processing?) then (no)\r\n stop\r\nendif\r\n\r\nif (isPost?) then (yes)\r\n :Page.onPost();\r\nelse (no)\r\n :Page.onGet();\r\nendif\r\n:Page.onRender();\r\n endif\r\nelse (false)\r\nendif\r\n\r\nif (do redirect?) then (yes)\r\n :redirect process;\r\nelse\r\n if (do forward?) then (yes)\r\n :Forward request;\r\n else (no)\r\n :Render page template;\r\n endif\r\nendif\r\nstop\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Complete example"},"Activity Diagram (beta): Start-Stop":{"prefix":"Activity Diagram (beta): Start-Stop","body":"@startuml\r\n\r\nstart\r\n:Hello world;\r\n:This is defined on\r\nseveral **lines**;\r\nend\r\n\r\n@enduml","description":"Activity Diagram (beta): Start-Stop"},"Activity Diagram (beta): Conditional":{"prefix":"Activity Diagram (beta): Conditional","body":"@startuml\r\n\r\nstart\r\nif (condition A) then (yes)\r\n :Text 1;\r\nelseif (condition B) then (yes)\r\n :Text 2;\r\n stop\r\nelseif (condition C) then (yes)\r\n :Text 3;\r\nelseif (condition D) then (yes)\r\n :Text 4;\r\nelse (nothing)\r\n :Text else;\r\nendif\r\nstop\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Conditional"},"Activity Diagram (beta): Repeat loop":{"prefix":"Activity Diagram (beta): Repeat loop","body":"@startuml\r\n\r\nstart\r\nrepeat\r\n :read data;\r\n :generate diagrams;\r\nrepeat while (more data?) is (yes)\r\n->no;\r\nstop\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Repeat loop"},"Activity Diagram (beta): While loop":{"prefix":"Activity Diagram (beta): While loop","body":"@startuml\r\n\r\nstart\r\nwhile (data available?)\r\n :read data;\r\n :generate diagrams;\r\nendwhile\r\nstop\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): While loop"},"Activity Diagram (beta): Parallel processing":{"prefix":"Activity Diagram (beta): Parallel processing","body":"@startuml\r\n\r\nstart\r\nif (multiprocessor?) then (yes)\r\n fork\r\n:Treatment 1;\r\n fork again\r\n:Treatment 2;\r\n end fork\r\nelse (monoproc)\r\n :Treatment 1;\r\n :Treatment 2;\r\nendif\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Parallel processing"},"Activity Diagram (beta): Notes":{"prefix":"Activity Diagram (beta): Notes","body":"@startuml\r\n\r\nstart\r\n:foo1;\r\nfloating note left: This is a note\r\n:foo2;\r\nnote right\r\n This note is on several\r\n //lines// and can\r\n contain HTML\r\n ====\r\n * Calling the method \"\"foo()\"\" is prohibited\r\nend note\r\nstop\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Notes"},"Activity Diagram (beta): Colors":{"prefix":"Activity Diagram (beta): Colors","body":"@startuml\r\n\r\nstart\r\n:starting progress;\r\n#HotPink:reading configuration files\r\nThese files should be edited at this point!;\r\n#AAAAAA:ending of the process;\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Colors"},"Activity Diagram (beta): Arrows":{"prefix":"Activity Diagram (beta): Arrows","body":"@startuml\r\n\r\n:foo1;\r\n-> You can put text on arrows;\r\nif (test) then\r\n -[#blue]->\r\n :foo2;\r\n -[#green,dashed]-> The text can\r\n also be on several lines\r\n and **very** long...;\r\n :foo3;\r\nelse\r\n -[#black,dotted]->\r\n :foo4;\r\nendif\r\n-[#gray,bold]->\r\n:foo5;\r\n\r\n@enduml\r\n","description":"Activity Diagram (beta): Arrows"},"Component Diagram: Components":{"prefix":"Component Diagram: Components","body":"@startuml\r\n\r\n[First component]\r\n[Another component] as Comp2\r\ncomponent Comp3\r\ncomponent [Last\\ncomponent] as Comp4\r\n\r\n@enduml\r\n","description":"Component Diagram: Components"},"Component Diagram: Using Sprite in Stereotype":{"prefix":"Component Diagram: Using Sprite in Stereotype","body":"@startuml\r\n\r\nsprite $businessProcess [16x16/16] {\r\n FFFFFFFFFFFFFFFF\r\n FFFFFFFFFFFFFFFF\r\n FFFFFFFFFFFFFFFF\r\n FFFFFFFFFFFFFFFF\r\n FFFFFFFFFF0FFFFF\r\n FFFFFFFFFF00FFFF\r\n FF00000000000FFF\r\n FF000000000000FF\r\n FF00000000000FFF\r\n FFFFFFFFFF00FFFF\r\n FFFFFFFFFF0FFFFF\r\n FFFFFFFFFFFFFFFF\r\n FFFFFFFFFFFFFFFF\r\n FFFFFFFFFFFFFFFF\r\n FFFFFFFFFFFFFFFF\r\n FFFFFFFFFFFFFFFF\r\n}\r\n\r\nrectangle \" End to End\\nbusiness process\" <<$businessProcess>> {\r\n rectangle \"inner process 1\" <<$businessProcess>> as src\r\n rectangle \"inner process 2\" <<$businessProcess>> as tgt\r\n src -> tgt\r\n}\r\n\r\n@enduml\r\n","description":"Component Diagram: Using Sprite in Stereotype"},"Component Diagram: Skinparam":{"prefix":"Component Diagram: Skinparam","body":"@startuml\r\n\r\n[AA] <>\r\n[BB] <>\r\n[CC] <>\r\n\r\nnode node1\r\nnode node2 <>\r\ndatabase Production\r\n\r\nskinparam component {\r\n backgroundColor<> DarkKhaki\r\n backgroundColor<> Green\r\n}\r\n\r\nskinparam node {\r\n borderColor Green\r\n backgroundColor Yellow\r\n backgroundColor<> Magenta\r\n}\r\nskinparam databaseBackgroundColor Aqua\r\n\r\n@enduml\r\n","description":"Component Diagram: Skinparam"},"Component Diagram: Interfaces":{"prefix":"Component Diagram: Interfaces","body":"@startuml\r\n\r\n() \"First Interface\"\r\n() \"Another interface\" as Interf2\r\ninterface Interf3\r\ninterface \"Last\\ninterface\" as Interf4\r\n\r\n@enduml\r\n","description":"Component Diagram: Interfaces"},"Component Diagram: Basic example":{"prefix":"Component Diagram: Basic example","body":"@startuml\r\n\r\nDataAccess - [First Component]\r\n[First Component] ..> HTTP : use\r\n\r\n@enduml\r\n","description":"Component Diagram: Basic example"},"Component Diagram: Using notes":{"prefix":"Component Diagram: Using notes","body":"@startuml\r\n\r\ninterface \"Data Access\" as DA\r\n\r\nDA - [First Component]\r\n[First Component] ..> HTTP : use\r\n\r\nnote left of HTTP : Web Service only\r\n\r\nnote right of [First Component]\r\n A note can also\r\n be on several lines\r\nend note\r\n\r\n@enduml\r\n","description":"Component Diagram: Using notes"},"Component Diagram: Grouping components":{"prefix":"Component Diagram: Grouping components","body":"@startuml\r\n\r\npackage \"Some Group\" {\r\n HTTP - [First Component]\r\n [Another Component]\r\n}\r\n\r\nnode \"Other Groups\" {\r\n FTP - [Second Component]\r\n [First Component] --> FTP\r\n}\r\n\r\ncloud {\r\n [Example 1]\r\n}\r\n\r\ndatabase \"MySql\" {\r\n folder \"This is my folder\" {\r\n [Folder 3]\r\n }\r\n\r\n frame \"Foo\" {\r\n [Frame 4]\r\n }\r\n}\r\n\r\n[Another Component] --> [Example 1]\r\n[Example 1] --> [Folder 3]\r\n[Folder 3] --> [Frame 4]\r\n\r\n@enduml\r\n","description":"Component Diagram: Grouping components"},"Component Diagram: Changing arrows direction":{"prefix":"Component Diagram: Changing arrows direction","body":"@startuml\r\n\r\n[Component] -left-> left\r\n[Component] -right-> right\r\n[Component] -up-> up\r\n[Component] -down-> down\r\n\r\n@enduml\r\n","description":"Component Diagram: Changing arrows direction"},"Component Diagram: Use UMLnotation":{"prefix":"Component Diagram: Use UMLnotation","body":"@startuml\r\n\r\nskinparam componentStyle uml2\r\n\r\ninterface \"Data Access\" as DA\r\n\r\nDA - [First Component]\r\n[First Component] ..> HTTP : use\r\n\r\n@enduml\r\n","description":"Component Diagram: Use UMLnotation"},"Component Diagram: Long description":{"prefix":"Component Diagram: Long description","body":"@startuml\r\n\r\ncomponent comp1 [\r\n This component\r\n has a long comment\r\n on several lines\r\n]\r\n\r\n@enduml\r\n","description":"Component Diagram: Long description"},"Component Diagram: Individual colors":{"prefix":"Component Diagram: Individual colors","body":"@startuml\r\n\r\ncomponent [Web Server] #Yellow\r\n\r\n@enduml\r\n","description":"Component Diagram: Individual colors"},"State Diagram: Simple State":{"prefix":"State Diagram: Simple State","body":"@startuml\r\n\r\n[*] --> State1\r\nState1 --> [*]\r\nState1 : this is a string\r\nState1 : this is another string\r\n\r\nState1 -> State2\r\nState2 --> [*]\r\n\r\n@enduml\r\n","description":"State Diagram: Simple State"},"State Diagram: Skinparam":{"prefix":"State Diagram: Skinparam","body":"@startuml\r\n\r\nskinparam backgroundColor LightYellow\r\nskinparam state {\r\n StartColor MediumBlue\r\n EndColor Red\r\n BackgroundColor Peru\r\n BackgroundColor<> Olive\r\n BorderColor Gray\r\n FontName Impact\r\n}\r\n\r\n[*] --> NotShooting\r\n\r\nstate \"Not Shooting State\" as NotShooting {\r\n state \"Idle mode\" as Idle <>\r\n state \"Configuring mode\" as Configuring\r\n [*] --> Idle\r\n Idle --> Configuring : EvConfig\r\n Configuring --> Idle : EvConfig\r\n}\r\n\r\nNotShooting --> [*]\r\n\r\n@enduml\r\n","description":"State Diagram: Skinparam"},"State Diagram: Change state rendering":{"prefix":"State Diagram: Change state rendering","body":"@startuml\r\n\r\nhide empty description\r\n[*] --> State1\r\nState1 --> [*]\r\nState1 : this is a string\r\nState1 : this is another string\r\n\r\nState1 -> State2\r\nState2 --> [*]\r\n\r\n@enduml\r\n","description":"State Diagram: Change state rendering"},"State Diagram: Composite state":{"prefix":"State Diagram: Composite state","body":"@startuml\r\n\r\nscale 350 width\r\n\r\n[*] --> NotShooting\r\n\r\nstate NotShooting {\r\n [*] --> Idle\r\n Idle --> Configuring : EvConfig\r\n Configuring --> Idle : EvConfig\r\n}\r\n\r\nstate Configuring {\r\n [*] --> NewValueSelection\r\n NewValueSelection --> NewValuePreview : EvNewValue\r\n NewValuePreview --> NewValueSelection : EvNewValueRejected\r\n NewValuePreview --> NewValueSelection : EvNewValueSaved\r\n\r\n state NewValuePreview {\r\n State1 -> State2\r\n }\r\n}\r\n\r\n@enduml\r\n","description":"State Diagram: Composite state"},"State Diagram: Long name":{"prefix":"State Diagram: Long name","body":"@startuml\r\n\r\nscale 600 width\r\n\r\n[*] -> State1\r\nState1 --> State2 : Succeeded\r\nState1 --> [*] : Aborted\r\nState2 --> State3 : Succeeded\r\nState2 --> [*] : Aborted\r\n\r\nstate State3 {\r\n state \"Accumulate Enough Data\\nLong State Name\" as long1\r\n long1 : Just a test\r\n [*] --> long1\r\n long1 --> long1 : New Data\r\n long1 --> ProcessData : Enough Data\r\n}\r\n\r\nState3 --> State3 : Failed\r\nState3 --> [*] : Succeeded / Save Result\r\nState3 --> [*] : Aborted\r\n\r\n@enduml\r\n","description":"State Diagram: Long name"},"State Diagram: Fork":{"prefix":"State Diagram: Fork","body":"@startuml\r\n\r\nstate fork_state <>\r\n[*] --> fork_state\r\nfork_state --> State2\r\nfork_state --> State3\r\n\r\nstate join_state <>\r\nState2 --> join_state\r\nState3 --> join_state\r\njoin_state --> State4\r\nState4 --> [*]\r\n\r\n@enduml\r\n","description":"State Diagram: Fork"},"State Diagram: Concurrent state":{"prefix":"State Diagram: Concurrent state","body":"@startuml\r\n\r\n[*] --> Active\r\n\r\nstate Active {\r\n [*] -> NumLockOff\r\n NumLockOff --> NumLockOn : EvNumLockPressed\r\n NumLockOn --> NumLockOff : EvNumLockPressed\r\n --\r\n [*] -> CapsLockOff\r\n CapsLockOff --> CapsLockOn : EvCapsLockPressed\r\n CapsLockOn --> CapsLockOff : EvCapsLockPressed\r\n --\r\n [*] -> ScrollLockOff\r\n ScrollLockOff --> ScrollLockOn : EvCapsLockPressed\r\n ScrollLockOn --> ScrollLockOff : EvCapsLockPressed\r\n}\r\n\r\n@enduml\r\n","description":"State Diagram: Concurrent state"},"State Diagram: Arrow direction":{"prefix":"State Diagram: Arrow direction","body":"@startuml\r\n\r\n[*] -up-> First\r\nFirst -right-> Second\r\nSecond --> Third\r\nThird -left-> Last\r\n\r\n@enduml\r\n","description":"State Diagram: Arrow direction"},"State Diagram: Note":{"prefix":"State Diagram: Note","body":"@startuml\r\n\r\nstate foo\r\nnote \"This is a floating note\" as N1\r\n\r\n@enduml\r\n","description":"State Diagram: Note"},"State Diagram: More in notes":{"prefix":"State Diagram: More in notes","body":"@startuml\r\n\r\n[*] --> NotShooting\r\n\r\nstate \"Not Shooting State\" as NotShooting {\r\n state \"Idle mode\" as Idle\r\n state \"Configuring mode\" as Configuring\r\n [*] --> Idle\r\n Idle --> Configuring : EvConfig\r\n Configuring --> Idle : EvConfig\r\n}\r\n\r\nnote right of NotShooting : This is a note on a composite state\r\n\r\n@enduml\r\n","description":"State Diagram: More in notes"},"Object Diagram: Definition of objects":{"prefix":"Object Diagram: Definition of objects","body":"@startuml\r\n\r\nobject firstObject\r\nobject \"My Second Object\" as o2\r\n\r\n@enduml\r\n","description":"Object Diagram: Definition of objects"},"Object Diagram: Relations between objects":{"prefix":"Object Diagram: Relations between objects","body":"@startuml\r\n\r\nobject Object01\r\nobject Object02\r\nobject Object03\r\nobject Object04\r\nobject Object05\r\nobject Object06\r\nobject Object07\r\nobject Object08\r\n\r\nObject01 <|-- Object02\r\nObject03 *-- Object04\r\nObject05 o-- \"4\" Object06\r\nObject07 .. Object08 : some labels\r\n\r\n@enduml\r\n","description":"Object Diagram: Relations between objects"},"Object Diagram: Adding fields":{"prefix":"Object Diagram: Adding fields","body":"@startuml\r\n\r\nobject user {\r\n name = \"Dummy\"\r\n id = 123\r\n}\r\n\r\n@enduml\r\n","description":"Object Diagram: Adding fields"},"Timing Diagram: Declaring participant":{"prefix":"Timing Diagram: Declaring participant","body":"@startuml\r\n\r\nrobust \"Web Browser\" as WB\r\nconcise \"Web User\" as WU\r\n\r\n@0\r\nWU is Idle\r\nWB is Idle\r\n\r\n@100\r\nWU is Waiting\r\nWB is Processing\r\n\r\n@300\r\nWB is Waiting\r\n\r\n@enduml\r\n","description":"Timing Diagram: Declaring participant"},"Timing Diagram: Adding texts":{"prefix":"Timing Diagram: Adding texts","body":"@startuml\r\n\r\nTitle This is my title\r\nheader: some header\r\nfooter: some footer\r\nlegend\r\nSome legend\r\nend legend\r\ncaption some caption\r\n\r\nrobust \"Web Browser\" as WB\r\nconcise \"Web User\" as WU\r\n\r\n@0\r\nWU is Idle\r\nWB is Idle\r\n\r\n@100\r\nWU is Waiting\r\nWB is Processing\r\n\r\n@300\r\nWB is Waiting\r\n\r\n@enduml\r\n","description":"Timing Diagram: Adding texts"},"Timing Diagram: Adding message":{"prefix":"Timing Diagram: Adding message","body":"@startuml\r\n\r\nrobust \"Web Browser\" as WB\r\nconcise \"Web User\" as WU\r\n\r\n@0\r\nWU is Idle\r\nWB is Idle\r\n\r\n@100\r\nWU -> WB : URL\r\nWU is Waiting\r\nWB is Processing\r\n\r\n@300\r\nWB is Waiting\r\n\r\n@enduml\r\n","description":"Timing Diagram: Adding message"},"Timing Diagram: Relative time":{"prefix":"Timing Diagram: Relative time","body":"@startuml\r\n\r\nrobust \"DNS Resolver\" as DNS\r\nrobust \"Web Browser\" as WB\r\nconcise \"Web User\" as WU\r\n\r\n@0\r\nWU is Idle\r\nWB is Idle\r\nDNS is Idle\r\n\r\n@+100\r\nWU -> WB : URL\r\nWU is Waiting\r\nWB is Processing\r\n\r\n@+200\r\nWB is Waiting\r\nWB -> DNS@+50 : Resolve URL\r\n\r\n@+100\r\nDNS is Processing\r\n\r\n@+300\r\nDNS is Idle\r\n\r\n@enduml\r\n","description":"Timing Diagram: Relative time"},"Timing Diagram: Participant oriented":{"prefix":"Timing Diagram: Participant oriented","body":"@startuml\r\n\r\nrobust \"Web Browser\" as WB\r\nconcise \"Web User\" as WU\r\n\r\n@WB\r\n0 is idle\r\n+200 is Proc.\r\n+100 is Waiting\r\n\r\n@WU\r\n0 is Waiting\r\n+500 is ok\r\n\r\n@enduml\r\n","description":"Timing Diagram: Participant oriented"},"Timing Diagram: Setting scale":{"prefix":"Timing Diagram: Setting scale","body":"@startuml\r\n\r\nconcise \"Web User\" as WU\r\nscale 100 as 50 pixels\r\n\r\n@WU\r\n0 is Waiting\r\n+500 is ok\r\n\r\n@enduml\r\n","description":"Timing Diagram: Setting scale"},"Timing Diagram: Initial state":{"prefix":"Timing Diagram: Initial state","body":"@startuml\r\n\r\nrobust \"Web Browser\" as WB\r\nconcise \"Web User\" as WU\r\n\r\nWB is Initializing\r\nWU is Absent\r\n\r\n@WB\r\n0 is idle\r\n+200 is Processing\r\n+100 is Waiting\r\n\r\n@WU\r\n0 is Waiting\r\n+500 is ok\r\n\r\n@enduml\r\n","description":"Timing Diagram: Initial state"},"Timing Diagram: Intricated state":{"prefix":"Timing Diagram: Intricated state","body":"@startuml\r\n\r\nrobust \"Signal1\" as S1\r\nrobust \"Signal2\" as S2\r\n\r\nS1 has 0,1,2,hello\r\nS2 has 0,1,2\r\n\r\n@0\r\nS1 is 0\r\nS2 is 0\r\n\r\n@100\r\nS1 is {0,1} #SlateGrey\r\nS2 is {0,1}\r\n\r\n@200\r\nS1 is 1\r\nS2 is 0\r\n\r\n@300\r\nS1 is hello\r\nS2 is {0,2}\r\n\r\n@enduml\r\n","description":"Timing Diagram: Intricated state"},"Timing Diagram: Hidden state":{"prefix":"Timing Diagram: Hidden state","body":"@startuml\r\n\r\nconcise \"Web User\" as WU\r\n\r\n@0\r\nWU is {-}\r\n\r\n@100\r\nWU is A1\r\n\r\n@200\r\nWU is {-}\r\n\r\n@300\r\nWU is {hidden}\r\n\r\n@400\r\nWU is A3\r\n\r\n@500\r\nWU is {-}\r\n\r\n@enduml\r\n","description":"Timing Diagram: Hidden state"},"Timing Diagram: Adding constraint":{"prefix":"Timing Diagram: Adding constraint","body":"@startuml\r\n\r\nrobust \"Web Browser\" as WB\r\nconcise \"Web User\" as WU\r\n\r\nWB is Initializing\r\nWU is Absent\r\n\r\n@WB\r\n0 is idle\r\n+200 is Processing\r\n+100 is Waiting\r\nWB@0 <-> @50 : {50 ms lag}\r\n\r\n@WU\r\n0 is Waiting\r\n+500 is ok\r\n@200 <-> @+150 : {150 ms}\r\n\r\n@enduml\r\n","description":"Timing Diagram: Adding constraint"}} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index ebd6ffd..c6719c9 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -22,13 +22,14 @@ import { CommandURLDocument } from './commands/urlDocument'; import { CommandExtractSource } from './commands/extractSource'; import { plantumlPlugin } from './markdown-it-plantuml/index'; import { Diagnoser } from './providers/diagnoser'; +import { exportTextDocument } from './plantuml/exporter/exportDocument'; // this method is called when your extension is activated // your extension is activated the very first time the command is executed export function activate(context: vscode.ExtensionContext) { contextManager.set(context); try { - const ext = vscode.extensions.getExtension("jebbs.plantuml"); + const ext = vscode.extensions.getExtension("sidiandi.plantuml-sidiandi-fork"); const version = ext.packageJSON.version; notifyOnNewVersion(context, version); @@ -49,6 +50,13 @@ export function activate(context: vscode.ExtensionContext) { outputPanel, bar, ); + + vscode.workspace.onDidSaveTextDocument((document: vscode.TextDocument) => { + if (config.exportOnSave(document.uri)) { + exportTextDocument(document); + } + }); + return { extendMarkdownIt(md: any) { return md.use(plantumlPlugin); diff --git a/src/plantuml/common.ts b/src/plantuml/common.ts index 6cefb30..f63e09e 100644 --- a/src/plantuml/common.ts +++ b/src/plantuml/common.ts @@ -6,7 +6,7 @@ export const languageid = "plantuml"; export var outputPanel = vscode.window.createOutputChannel("PlantUML"); export var bar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left); -export const extensionPath = vscode.extensions.getExtension("jebbs.plantuml").extensionPath; +export const extensionPath = vscode.extensions.getExtension("sidiandi.plantuml-sidiandi-fork").extensionPath; nls.config({ locale: vscode.env.language }); export var localize: any = nls.loadMessageBundle(join(extensionPath, "langs", "lang.json")); diff --git a/src/plantuml/config.ts b/src/plantuml/config.ts index b766de9..a3b8760 100755 --- a/src/plantuml/config.ts +++ b/src/plantuml/config.ts @@ -8,6 +8,7 @@ import { javaCommandExists, testJava } from './tools'; export const RenderType = { Local: 'Local', + LocalServer: 'LocalServer', PlantUMLServer: 'PlantUMLServer' }; @@ -79,6 +80,14 @@ class Config extends ConfigReader { return vscode.Uri.file(fsPath); } + exportOnSave(uri: vscode.Uri): boolean { + return this.read('exportOnSave', uri); + } + + exportBesideDocument(uri: vscode.Uri): boolean { + return this.read('exportBesideDocument', uri); + } + exportFormat(uri: vscode.Uri): string { return this.read('exportFormat', uri); } @@ -116,7 +125,7 @@ class Config extends ConfigReader { } render(uri: vscode.Uri): string { - return this.read('render') || "Local"; + return this.read('render') || "LocalServer"; } includepaths(uri: vscode.Uri): string[] { diff --git a/src/plantuml/exporter/appliedRender.ts b/src/plantuml/exporter/appliedRender.ts index b4cdadc..a03efc4 100644 --- a/src/plantuml/exporter/appliedRender.ts +++ b/src/plantuml/exporter/appliedRender.ts @@ -3,6 +3,7 @@ import { IRender } from '../renders/interfaces'; import { localRender } from '../renders/local'; import { plantumlServer } from '../renders/plantumlServer'; import { config, RenderType } from '../config'; +import { localServer } from '../renders/localServer'; /** * get applied base exporter @@ -12,6 +13,8 @@ export function appliedRender(uri: vscode.Uri): IRender { switch (config.render(uri)) { case RenderType.Local: return localRender; + case RenderType.LocalServer: + return localServer; case RenderType.PlantUMLServer: return plantumlServer; default: diff --git a/src/plantuml/exporter/exportDocument.ts b/src/plantuml/exporter/exportDocument.ts index 294344e..ae219f1 100644 --- a/src/plantuml/exporter/exportDocument.ts +++ b/src/plantuml/exporter/exportDocument.ts @@ -66,4 +66,50 @@ export async function exportDocument(all: boolean) { } ); return; +} + +export async function exportTextDocument(document: vscode.TextDocument) { + let stopWatch = new StopWatch(); + stopWatch.start(); + if (!path.isAbsolute(document.fileName)) { + vscode.window.showInformationMessage(localize(1, null)); + return; + }; + let format = config.exportFormat(document.uri); + if (!format) { + format = await vscode.window.showQuickPick(appliedRender(document.uri).formats()); + if (!format) return; + } + let diagrams: Diagram[] = []; + + diagrams = diagramsOf(document); + if (!diagrams.length) { + vscode.window.showInformationMessage(localize(2, null)); + return; + } + + exportDiagrams(diagrams, format, bar).then( + async results => { + stopWatch.stop(); + bar.hide(); + if (!results.length) return; + let viewReport = localize(26, null); + let btn = await vscode.window.showInformationMessage(localize(4, null), viewReport); + if (btn !== viewReport) return; + let fileCnt = 0; + let fileLst = results.reduce((prev, files) => { + let filtered = files.filter(v => !!v.length); + fileCnt += filtered.length; + return prev + "\n" + filtered.join("\n"); + }, ""); + showMessagePanel( + localize(27, null, diagrams.length, fileCnt, stopWatch.runTime() / 1000) + fileLst + ); + }, + error => { + bar.hide(); + showMessagePanel(error); + } + ); + return; } \ No newline at end of file diff --git a/src/plantuml/renders/localServer.ts b/src/plantuml/renders/localServer.ts new file mode 100644 index 0000000..ae079c3 --- /dev/null +++ b/src/plantuml/renders/localServer.ts @@ -0,0 +1,125 @@ +import { outputPanel } from '../common'; +import * as vscode from 'vscode'; +import { IRender, RenderTask } from './interfaces' +import { Diagram } from '../diagram/diagram'; +import { config } from '../config'; +import { localize } from '../common'; +import { addFileIndex } from '../tools'; +import { httpWrapper } from './httpWrapper'; +import { HTTPError } from './httpErrors'; +import internal = require('assert'); +import * as child_process from 'child_process'; +import { Task } from 'vscode'; + +interface Dictionary { + [key: string]: T; +} + +class LocalServer implements IRender { + + /** + * Indicates the exporter should limt concurrency or not. + * @returns boolean + */ + limitConcurrency(): boolean { + return false; + } + /** + * formats return an string array of formats that the exporter supports. + * @returns an array of supported formats + */ + formats(): string[] { + return [ + "png", + "svg", + "txt" + ]; + } + + async ensureLocalServerIsStarted(diagram : Diagram): Promise { + if (this.process && this.process.exitCode == null) { + return this.localServer; + } + + if (this.process) { + this.process.kill(); + this.process = null; + } + + let params = [ + '-jar', config.jar(diagram.parentUri), + '-picoweb:' + this.port.toString() + ':127.0.0.1', + '-verbose' + ] + + let p = child_process.spawn(config.java(diagram.parentUri), params); + p.stdout.on('data', function (data) { + outputPanel.appendLine(data.toString()); + }) + p.stderr.on('data', function (data) { + outputPanel.appendLine(data.toString()); + }) + + this.process = p; + + this.localServer = "http://localhost:" + this.port.toString(); + outputPanel.appendLine(`PlantUML picoweb server started: params=${params.join(" ")}, pid=${p.pid}, url=${this.localServer}`) + ++this.port; + + // wait for server to come online + for (let i=0; i<10;++i) { + let diagram = new Diagram("A --> B") + try + { + let buffer = await httpWrapper("GET", this.localServer, diagram, "png", 0, null); + break; + } + catch { + } + await new Promise( resolve => setTimeout(resolve, 500) ); + } + + return this.localServer; + } + + port : number = 47323; + localServer : string; + process : any; + + /** + * export a diagram to file or to Buffer. + * @param diagram The diagram to export. + * @param format format of export file. + * @param savePath if savePath is given, it exports to a file, or, to Buffer. + * @returns ExportTask. + */ + render(diagram: Diagram, format: string, savePath: string): RenderTask { + return { + processes: [], + promise: this.doRender(diagram, format, savePath), + } + } + + async doRender(diagram: Diagram, format: string, savePath: string) : Promise { + let server = await this.ensureLocalServerIsStarted(diagram); + + if (!server) { + throw localize(53, null) + } + + let promiseArray = [...Array(diagram.pageCount).keys()].map( + (index) => { + let savePath2 = savePath ? addFileIndex(savePath, index, diagram.pageCount) : ""; + return httpWrapper("GET", server, diagram, format, index, savePath2); + }, + Promise.resolve(Buffer.alloc(0)) + ); + + return await Promise.all(promiseArray); + } + + getMapData(diagram: Diagram, savePath: string): RenderTask { + return this.render(diagram, "map", savePath); + } +} +export const localServer = new LocalServer(); \ No newline at end of file diff --git a/src/plantuml/tools.ts b/src/plantuml/tools.ts index 16d12b3..06a8a8a 100644 --- a/src/plantuml/tools.ts +++ b/src/plantuml/tools.ts @@ -95,7 +95,10 @@ export function calculateExportPath(diagram: Diagram, format: string): string { let exportDir = ""; let folder = vscode.workspace.getWorkspaceFolder(diagram.parentUri); - if (folder) { + if (config.exportBesideDocument(diagram.parentUri) || !folder) { + // export beside the document. + exportDir = diagram.dir; + } else { let wkdir = folder ? folder.uri.fsPath : ""; let diagramsRoot = config.diagramsRoot(diagram.parentUri).fsPath; let outDir = config.exportOutDir(diagram.parentUri).fsPath; @@ -106,9 +109,6 @@ export function calculateExportPath(diagram: Diagram, format: string): string { // If current document is in WorkspaceFolder, organize exports in %outDir%/_WorkspaceFolder_. exportDir = path.join(outDir, "__WorkspaceFolder__", path.relative(wkdir, diagram.dir)); } - } else { - // export beside the document. - exportDir = diagram.dir; } if (config.exportSubFolder(diagram.parentUri)) { diff --git a/test/helper.ts b/test/helper.ts index c1c9e52..5979954 100644 --- a/test/helper.ts +++ b/test/helper.ts @@ -18,7 +18,7 @@ export let platformEol: string; */ export async function activate(docUri: vscode.Uri, sleepMsForServer: number = 0) { // The extensionId is `publisher.name` from package.json - const ext = vscode.extensions.getExtension('jebbs.plantuml'); + const ext = vscode.extensions.getExtension('sidiandi.plantuml-sidiandi-fork'); await ext.activate(); try { doc = await vscode.workspace.openTextDocument(docUri);