Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plantuml docs #63

Merged
merged 3 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/plantuml_docs_synd_and_process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: PLANTUML DOCS Sync docs from alphadoc and process antora

on:
workflow_dispatch:
inputs:
fetch_docs:
description: 'Fetch docs from alphadoc?'
required: true
default: true
type: boolean
concurrency:
group: 'plantuml_docs_sync_and_process'
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: plantuml-docs
steps:
- name: Checkout Source
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 19
- run: npm ci
- name: Fetch docs from alphadoc
run: |
npm run fetchDocsFromAlphadoc
if: ${{ inputs.fetch_docs }}
- name: Process antora docs
run: |
npm run processAntoraDocsComponent
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
commit-message: Fetch latest docs from alphadoc
delete-branch: true
title: '[Sync Docs] Fetch latest docs'
body: |
Automated sync docs from alphadoc.
labels: |
automated pr
2 changes: 2 additions & 0 deletions plantuml-docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
build
Empty file.
13 changes: 13 additions & 0 deletions plantuml-docs/_antora/supplemental-ui/css/site-extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.plantuml-diagram {
overflow: hidden;
}

.plantuml-diagram .listingblock {
float: left;
overflow: hidden;
}

.plantuml-diagram .img {
float: left;
overflow: hidden;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'

module.exports = (string) => {
return string.replace(/\.[^/.]+$/, "")
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions plantuml-docs/_antora/supplemental-ui/js/site-extra.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(function() {
// uml diagrams are toggled by default
if(window.location.pathname.endsWith('docs/main/index.html')){
document.querySelector('.nav-item[data-depth="0"]:nth-child(2)').classList.add("is-active")
}
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script id="site-script" src="{{{uiRootPath}}}/js/site.js" data-ui-root-path="{{{uiRootPath}}}"></script>
<script id="site-script" src="{{{uiRootPath}}}/js/site-extra.js"></script>
<script async src="{{{uiRootPath}}}/js/vendor/highlight.js"></script>
{{#if env.SITE_SEARCH_PROVIDER}}
{{> search-scripts}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="{{uiRootPath}}/css/site-extra.css">
73 changes: 73 additions & 0 deletions plantuml-docs/_antora/supplemental-ui/partials/header-content.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="{{{or site.url siteRootPath}}}">{{site.title}}</a>
{{#if env.SITE_SEARCH_PROVIDER}}
<div class="navbar-item search hide-for-print">
<div id="search-field" class="field">
<input id="search-input" type="text" placeholder="Search the docs"{{#if page.home}} autofocus{{/if}}>
</div>
</div>
{{/if}}
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">UML Diagrams</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/sequence-diagram.html">Sequence</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/use-case-diagram.html">Use Case</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/class-diagram.html">Class</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/activity-diagram-legacy.html">Activity</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/activity-diagram-beta.html">Activity(beta)</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/component-diagram.html">Component</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/state-diagram.html">State</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/object-diagram.html">Object</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/deployment-diagram.html">Deployment</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/timing-diagram.html">Timing</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">non-UML Diagrams</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/nwdiag.html">Network</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/salt.html">Wireframe</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/archimate-diagram.html">Archimate</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/gantt-diagram.html">Gantt</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/mindmap-diagram.html">MindMap</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/wbs-diagram.html">WBS</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/json.html">JSON</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/yaml.html">YAML</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="https://plantuml.com/" target="_blank">PlantUML</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="https://plantuml.com/news" target="_blank">What's New?</a>
<a class="navbar-item" href="https://plantuml.com/download" target="_blank">Download</a>
<a class="navbar-item" href="https://plantuml.com/guide" target="_blank">PDF Guide</a>
<a class="navbar-item" href="https://plantuml.com/running" target="_blank">Tools</a>
<a class="navbar-item" href="{{{or site.url siteRootPath}}}/docs/main/faq.html">F.A.Q.</a>
<a class="navbar-item" href="https://crashedmind.github.io/PlantUMLHitchhikersGuide" target="_blank">Hitchiker's Guide</a>
<a class="navbar-item" href="https://forum.plantuml.net/" target="_blank">Forum</a>
</div>
</div>
<div class="navbar-item">
<span class="control">
<a class="button is-primary" href="https://plantuml.github.io/plantuml.js/" target="_blank">Playground</a>
</span>
</div>
<a class="navbar-item" href="https://github.com/plantuml/plantuml" target="_blank">
<span class="icon">
<img src="{{{uiRootPath}}}/img/github-mark-white.png" />
</span>
</a>
</div>
</div>
</nav>
</header>
13 changes: 13 additions & 0 deletions plantuml-docs/_antora/supplemental-ui/partials/toolbar.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="toolbar" role="navigation">
{{> nav-toggle}}
{{#with site.homeUrl}}
<a href="{{{relativize this}}}" class="home-link{{#if @root.page.home}} is-current{{/if}}"></a>
{{/with}}
{{> breadcrumbs}}
{{> page-versions}}
{{#if (and page.fileUri (not env.CI))}}
<div class="edit-this-page"><a href="http://alphadoc.plantuml.com/doc/dokuwiki/en/{{removeFileExtension page.relativeSrcPath}}" target="_blank">Edit this Page</a></div>
{{else if (and page.editUrl (or env.FORCE_SHOW_EDIT_PAGE_LINK (not page.origin.private)))}}
<div class="edit-this-page"><a href="http://alphadoc.plantuml.com/doc/dokuwiki/en/{{removeFileExtension page.relativeSrcPath}}" target="_blank">Edit this Page</a></div>
{{/if}}
</div>
1 change: 1 addition & 0 deletions plantuml-docs/_antora/supplemental-ui/ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
static_files: [.nojekyll]
Binary file added plantuml-docs/_antora/ui-bundle.zip
Binary file not shown.
20 changes: 20 additions & 0 deletions plantuml-docs/_asciidoc/extensions/plantuml-source-block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const plantumlEncoder = require('plantuml-encoder')

module.exports = function (registry) {
registry.block(function () {
const self = this
self.named('plantuml')
self.onContext('listing')
self.process(function (parent, reader) {
const lines = reader.getLines()

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>`

const imagePath = plantumlEncoder.encode(lines.join("\n"))
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>`

const html = `<div class="paragraph plantuml-diagram">${codeBlock} ${imageBlock}</div>`
return self.createBlock(parent, 'pass', html, {}, {})
})
})
}
23 changes: 23 additions & 0 deletions plantuml-docs/antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
site:
title: PlantUML Alternative Docs
start_page: docs::index.adoc
robots: disallow
# keys:
# google_analytics: XX-123456
# url: https://plantuml.github.io/plantuml-alternative-docs/
content:
sources:
- url: ..
branches: HEAD
start_path: plantuml-docs
ui:
bundle:
url: _antora/ui-bundle.zip
snapshot: true
supplemental_files: _antora/supplemental-ui
antora:
extensions:
- require: '@antora/lunr-extension'
asciidoc:
extensions:
- ./_asciidoc/extensions/plantuml-source-block.js
5 changes: 5 additions & 0 deletions plantuml-docs/antora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: docs
version: 'main'
title: Docs
nav:
- modules/ROOT/nav.adoc
Empty file.
Loading