This is a template repository for web sites generated from Drawio diagrams with GitHub Actions and Nasdanika CLI Drawio Command.
Below is a list of sites created from this template:
Generate HTML Site from a Drawio diagram with Nasdanika CLI
action. Once it is successful, open the pages site.The deployment action can be triggered manually from the actions page. It can be useful if your site references external resources.
For example:
You may rename diagram.drawio
to something more meaningful, e.g.my-system.drawio
. Or you may use a pre-existing drawio diagram and delete diagram.drawio
. You can also use an external diagram and reference it by URL. If you do rename/replace the diagram, open .github/workflows/site.yml
and update line 40 with a new diagram file name.
In the page template file you can:
fluid
to false
.See Bootstrap Page Load Specification for supported confiuration keys.
The root action defines:
See Action Load Specification for supported configuration keys.
You can add documentation to diagram elements, title
and icon
property, customize element ID, and link elements to pages or other elements, including pages and elements in other diagram files.
Site pages are generated only for elements with documentation.
Important: Pages are not generated for diagram elements without labels or title
property! It may lead to broken links.
You can add inline documentation in documentation
property as it is done for Alice.
Documentation is by default treated as Markdown. Use doc-format
property to specify documentation format. Out of the box there are 3 formats supported:
markdown
html
text
You can add support for more formats, e.g. Asciidoc using AsciidoctorJ - see “Adding support for documentation format” below.
You may reference an external documentation resources with doc-ref
property - this how it is done for the diagram root (click on the diagram canvas and then on “Edit Data” button in the right panel). Documentation reference is a URL resolved relative to the diagram file location.
If you use doc-ref
property, the documentation format is inferred from the extension. You may override the inferred value using doc-format
property.
By default the element label is used as action text. For elements with long labels it may be desirable to use shorter text. To do so use title
property.
By default element icons are derived from element images where possible. Otherwise a default icon is used. You may use icon
property to customize element icon. The icon can be a URL (including data URL) or a CSS style e.g. fas fa-user
.
Element ID’s are used to construct element page URL’s. Element ID’s are generated as long random strings. They are editable - double-click on the ID at the top of the data dialog. So, if you’d like to have semantic URL’s - customize the ID’s.
You may link elements to pages and other element using the extended link syntax.
When an element links to a page, the page root2 is logically merged with the linking element and page elements (except elements liking to other elements) become logical children of the linking element.
If an element links to another element, then that element is not considered a logical child of the page/root/page linking element. The link chain is traversed and the diagram element on the generated site is linked to the page of the link target element if that element has a page (i.e. it is documented). Otherwise there is no link.
A top-level diagram page is a page that is not linked from any diagram element. If there is more than one top-level page, then you may want to add a principal action to the root-action.yml
and link pages to the principal action by removing --add-to-root
option from the command line.
See Declarative Command Pipelines for an example.
Drawio has more than two thousand built-in icons. You can find more icons on the below sites:
This section demonstrates advanced capabilities of Markdown documentation.
You can embed PNG and JPEG using fenced blocks.
```png-resource
isa.png
```
Resource location is resolved relative to the diagram file location.
```jpeg-resource
my.jpeg
```
```png
Base 64 encoded png
```
```jpeg
Base 64 encoded jpeg
```
You can also embed PlantUML, Drawio, and Mermaid diagrams using fenced blocks.
```drawio-resource
aws.drawio
```
Resource location is resolved in the same way as for image files as explained above.
PlantUML diagrams can be defined inline or loaded from resources.
```uml-resource
sequence.plantuml
```
The following language specifications (dialects) are supported:
uml
- for the following diagram types:
wireframe
- for Wireframe diagramsgantt
- for Gantt diagramsmindmap
- for Mind Mapswbs
- for Work Breakdown StructuresSequence
Fenced block:
```uml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
```
Diagram:
Component
Component diagram with links to component pages.
Fenced block:
```uml
package Core {
component Common [[https://github.com/Nasdanika/core/tree/master/common]]
}
package HTML {
component HTML as html [[https://github.com/Nasdanika/html/tree/master/html]]
[html] ..> [Common]
}
```
Diagram:
Wireframe
Fenced block:
```wireframe
{
Just plain text
[This is my button]
() Unchecked radio
(X) Checked radio
[] Unchecked box
[X] Checked box
"Enter text here "
^This is a droplist^
}
```
Diagram:
Gantt
Fenced block:
```gantt
[Prototype design] lasts 15 days and links to [[https://docs.nasdanika.org/index.html]]
[Test prototype] lasts 10 days
-- All example --
[Task 1 (1 day)] lasts 1 day
[T2 (5 days)] lasts 5 days
[T3 (1 week)] lasts 1 week
[T4 (1 week and 4 days)] lasts 1 week and 4 days
[T5 (2 weeks)] lasts 2 weeks
```
Diagram:
Mind Map
Fenced block:
```mindmap
* Debian
** [[https://ubuntu.com/ Ubuntu]]
*** Linux Mint
*** Kubuntu
*** Lubuntu
*** KDE Neon
** LMDE
** SolydXK
** SteamOS
** Raspbian with a very long name
*** <s>Raspmbc</s> => OSMC
*** <s>Raspyfi</s> => Volumio
```
Diagram:
WBS
WBS elements can have links. This type of diagram can also be used to display organization structure.
```wbs
* [[https://docs.nasdanika.org/index.html Business Process Modelling WBS]]
** Launch the project
*** Complete Stakeholder Research
*** Initial Implementation Plan
** Design phase
*** Model of AsIs Processes Completed
**** Model of AsIs Processes Completed1
**** Model of AsIs Processes Completed2
*** Measure AsIs performance metrics
*** Identify Quick Wins
** Complete innovate phase
```
Fenced block:
Diagram:
You can define Mermaid diagrams in mermaid
fenced blocks:
flowchart LR
Alice --> Bob & Chuck --> Deb
results in this diagram:
It is also possible to load a diagram definition from a resource resolved relative to the model resource:
```mermaid-resource
sequence.mermaid
```
[TOC]
to the document as explained in the documentation. This extension will create a table of contents from markdown headers.~~strikethrough~~
-> H~2~O
-> H202^5^ = 32
-> 25 = 32-r=-1
command line option means “don’t fail on page errors” such as:
Missing resources are reported on pages using danger alert blocks.
If you want to prevent deployment of a site with page errors, remove the option or set it to the expected number of errors - there might be “known errors” which you are OK to live with.
When a new version of Nasdanika CLI is released you may update lines 33 and 35 in site.yml
to point to the new distribution.
To add a new documentation format:
module-info.java
- examplesite.yml
lines 33 and 35.If you use Confluence you may keep diagrams on Confluence with diagram-level descriptions and generate detailed element-level documentation sites with Nasdanika CLI. To do so:
curl -H "Authorization: Bearer <Your token>" <download URL> -o diagram.drawio
command to download the diagram before generating a documentation siteNote: I tested this approach with on-prem Confluence - it worked fine, but I couldn’t make it work with the Cloud Confluence free plan.
This section outlines possible next steps once you have a site generated from a diagram or a set of diagrams.
You may make the diagrams executable. Details and demos are coming soon.
You can also “upgrade” to semantic mapping as explained in the Visual Communication Continuum Medium story and Beyond Diagrams book.
See Action types
↩See Drawio API
↩