Skip to content

Commit 5b1f27a

Browse files
authored
Add plantuml docs (#63)
* Add plantuml docs structure * Add workflow for updating docs * Add extra blank line for ending
1 parent 1b670ae commit 5b1f27a

File tree

288 files changed

+98977
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+98977
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: PLANTUML DOCS Sync docs from alphadoc and process antora
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
fetch_docs:
7+
description: 'Fetch docs from alphadoc?'
8+
required: true
9+
default: true
10+
type: boolean
11+
concurrency:
12+
group: 'plantuml_docs_sync_and_process'
13+
cancel-in-progress: true
14+
jobs:
15+
ci:
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
shell: bash
20+
working-directory: plantuml-docs
21+
steps:
22+
- name: Checkout Source
23+
uses: actions/checkout@v3
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: 19
27+
- run: npm ci
28+
- name: Fetch docs from alphadoc
29+
run: |
30+
npm run fetchDocsFromAlphadoc
31+
if: ${{ inputs.fetch_docs }}
32+
- name: Process antora docs
33+
run: |
34+
npm run processAntoraDocsComponent
35+
- name: Create Pull Request
36+
id: cpr
37+
uses: peter-evans/create-pull-request@v4
38+
with:
39+
commit-message: Fetch latest docs from alphadoc
40+
delete-branch: true
41+
title: '[Sync Docs] Fetch latest docs'
42+
body: |
43+
Automated sync docs from alphadoc.
44+
labels: |
45+
automated pr

plantuml-docs/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
build

plantuml-docs/_antora/supplemental-ui/.nojekyll

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.plantuml-diagram {
2+
overflow: hidden;
3+
}
4+
5+
.plantuml-diagram .listingblock {
6+
float: left;
7+
overflow: hidden;
8+
}
9+
10+
.plantuml-diagram .img {
11+
float: left;
12+
overflow: hidden;
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict'
2+
3+
module.exports = (string) => {
4+
return string.replace(/\.[^/.]+$/, "")
5+
}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(function() {
2+
// uml diagrams are toggled by default
3+
if(window.location.pathname.endsWith('docs/main/index.html')){
4+
document.querySelector('.nav-item[data-depth="0"]:nth-child(2)').classList.add("is-active")
5+
}
6+
})();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script id="site-script" src="{{{uiRootPath}}}/js/site.js" data-ui-root-path="{{{uiRootPath}}}"></script>
2+
<script id="site-script" src="{{{uiRootPath}}}/js/site-extra.js"></script>
3+
<script async src="{{{uiRootPath}}}/js/vendor/highlight.js"></script>
4+
{{#if env.SITE_SEARCH_PROVIDER}}
5+
{{> search-scripts}}
6+
{{/if}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<link rel="stylesheet" href="{{uiRootPath}}/css/site-extra.css">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<header class="header">
2+
<nav class="navbar">
3+
<div class="navbar-brand">
4+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}">{{site.title}}</a>
5+
{{#if env.SITE_SEARCH_PROVIDER}}
6+
<div class="navbar-item search hide-for-print">
7+
<div id="search-field" class="field">
8+
<input id="search-input" type="text" placeholder="Search the docs"{{#if page.home}} autofocus{{/if}}>
9+
</div>
10+
</div>
11+
{{/if}}
12+
<button class="navbar-burger" data-target="topbar-nav">
13+
<span></span>
14+
<span></span>
15+
<span></span>
16+
</button>
17+
</div>
18+
<div id="topbar-nav" class="navbar-menu">
19+
<div class="navbar-end">
20+
<div class="navbar-item has-dropdown is-hoverable">
21+
<a class="navbar-link" href="#">UML Diagrams</a>
22+
<div class="navbar-dropdown">
23+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/sequence-diagram.html">Sequence</a>
24+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/use-case-diagram.html">Use Case</a>
25+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/class-diagram.html">Class</a>
26+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/activity-diagram-legacy.html">Activity</a>
27+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/activity-diagram-beta.html">Activity(beta)</a>
28+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/component-diagram.html">Component</a>
29+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/state-diagram.html">State</a>
30+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/object-diagram.html">Object</a>
31+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/deployment-diagram.html">Deployment</a>
32+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/timing-diagram.html">Timing</a>
33+
</div>
34+
</div>
35+
<div class="navbar-item has-dropdown is-hoverable">
36+
<a class="navbar-link" href="#">non-UML Diagrams</a>
37+
<div class="navbar-dropdown">
38+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/nwdiag.html">Network</a>
39+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/salt.html">Wireframe</a>
40+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/archimate-diagram.html">Archimate</a>
41+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/gantt-diagram.html">Gantt</a>
42+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/mindmap-diagram.html">MindMap</a>
43+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/wbs-diagram.html">WBS</a>
44+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/json.html">JSON</a>
45+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/yaml.html">YAML</a>
46+
</div>
47+
</div>
48+
<div class="navbar-item has-dropdown is-hoverable">
49+
<a class="navbar-link" href="https://plantuml.com/" target="_blank">PlantUML</a>
50+
<div class="navbar-dropdown">
51+
<a class="navbar-item" href="https://plantuml.com/news" target="_blank">What's New?</a>
52+
<a class="navbar-item" href="https://plantuml.com/download" target="_blank">Download</a>
53+
<a class="navbar-item" href="https://plantuml.com/guide" target="_blank">PDF Guide</a>
54+
<a class="navbar-item" href="https://plantuml.com/running" target="_blank">Tools</a>
55+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/faq.html">F.A.Q.</a>
56+
<a class="navbar-item" href="https://crashedmind.github.io/PlantUMLHitchhikersGuide" target="_blank">Hitchiker's Guide</a>
57+
<a class="navbar-item" href="https://forum.plantuml.net/" target="_blank">Forum</a>
58+
</div>
59+
</div>
60+
<div class="navbar-item">
61+
<span class="control">
62+
<a class="button is-primary" href="https://plantuml.github.io/plantuml.js/" target="_blank">Playground</a>
63+
</span>
64+
</div>
65+
<a class="navbar-item" href="https://github.com/plantuml/plantuml" target="_blank">
66+
<span class="icon">
67+
<img src="{{{uiRootPath}}}/img/github-mark-white.png" />
68+
</span>
69+
</a>
70+
</div>
71+
</div>
72+
</nav>
73+
</header>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="toolbar" role="navigation">
2+
{{> nav-toggle}}
3+
{{#with site.homeUrl}}
4+
<a href="{{{relativize this}}}" class="home-link{{#if @root.page.home}} is-current{{/if}}"></a>
5+
{{/with}}
6+
{{> breadcrumbs}}
7+
{{> page-versions}}
8+
{{#if (and page.fileUri (not env.CI))}}
9+
<div class="edit-this-page"><a href="http://alphadoc.plantuml.com/doc/dokuwiki/en/{{removeFileExtension page.relativeSrcPath}}" target="_blank">Edit this Page</a></div>
10+
{{else if (and page.editUrl (or env.FORCE_SHOW_EDIT_PAGE_LINK (not page.origin.private)))}}
11+
<div class="edit-this-page"><a href="http://alphadoc.plantuml.com/doc/dokuwiki/en/{{removeFileExtension page.relativeSrcPath}}" target="_blank">Edit this Page</a></div>
12+
{{/if}}
13+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
static_files: [.nojekyll]

plantuml-docs/_antora/ui-bundle.zip

256 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const plantumlEncoder = require('plantuml-encoder')
2+
3+
module.exports = function (registry) {
4+
registry.block(function () {
5+
const self = this
6+
self.named('plantuml')
7+
self.onContext('listing')
8+
self.process(function (parent, reader) {
9+
const lines = reader.getLines()
10+
11+
const codeBlock = `<div class="listingblock"><div class="content"><pre class="highlightjs highlight"><code class="language-plantuml hljs" data-lang="plantuml">${lines.join("\n")}</code></pre></div></div>`
12+
13+
const imagePath = plantumlEncoder.encode(lines.join("\n"))
14+
const imageBlock = `<a href="https://plantuml.github.io/plantuml.js/#encodedString=${imagePath}" target="_blank"><img loading="lazy" src="https://plantuml.com/plantuml/pmg/${imagePath}"/></a>`
15+
16+
const html = `<div class="paragraph plantuml-diagram">${codeBlock} ${imageBlock}</div>`
17+
return self.createBlock(parent, 'pass', html, {}, {})
18+
})
19+
})
20+
}

plantuml-docs/antora-playbook.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
site:
2+
title: PlantUML Alternative Docs
3+
start_page: docs::index.adoc
4+
robots: disallow
5+
# keys:
6+
# google_analytics: XX-123456
7+
# url: https://plantuml.github.io/plantuml-alternative-docs/
8+
content:
9+
sources:
10+
- url: ..
11+
branches: HEAD
12+
start_path: plantuml-docs
13+
ui:
14+
bundle:
15+
url: _antora/ui-bundle.zip
16+
snapshot: true
17+
supplemental_files: _antora/supplemental-ui
18+
antora:
19+
extensions:
20+
- require: '@antora/lunr-extension'
21+
asciidoc:
22+
extensions:
23+
- ./_asciidoc/extensions/plantuml-source-block.js

plantuml-docs/antora.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: docs
2+
version: 'main'
3+
title: Docs
4+
nav:
5+
- modules/ROOT/nav.adoc

plantuml-docs/docs_from_alphadoc/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)