All Projects → eshepelyuk → Asciidoctor Plantuml.js

eshepelyuk / Asciidoctor Plantuml.js

Licence: isc
Extension for Asciidoctor.js that provides integration with PlantUML using PlantUML Server. As a bonus it works in Antora.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Asciidoctor Plantuml.js

Asciidocfx
Asciidoc Editor and Toolchain written with JavaFX 16 (Build PDF, Epub, Mobi and HTML books, documents and slides)
Stars: ✭ 1,533 (+6287.5%)
Mutual labels:  plantuml, asciidoctor
Asciidoctor Kroki
Asciidoctor.js extension to convert diagrams to images using Kroki!
Stars: ✭ 55 (+129.17%)
Mutual labels:  plantuml, asciidoctor
asciidoctor-mathematical
An extension for Asciidoctor that converts the content of STEM blocks and inline macros using Mathematical.
Stars: ✭ 37 (+54.17%)
Mutual labels:  asciidoctor
Vscode Markdown Pdf
Markdown converter for Visual Studio Code
Stars: ✭ 571 (+2279.17%)
Mutual labels:  plantuml
Plantuml Syntax
vim syntax file for plantuml
Stars: ✭ 329 (+1270.83%)
Mutual labels:  plantuml
Gradle Multi Project Example
Gradle 多项目管理示例
Stars: ✭ 283 (+1079.17%)
Mutual labels:  asciidoctor
Goplantuml
PlantUML Class Diagram Generator for golang projects
Stars: ✭ 352 (+1366.67%)
Mutual labels:  plantuml
plantuml2ddl
Intellij IDEA plugin- MySQL DDL and PlantUML convert to each other.
Stars: ✭ 23 (-4.17%)
Mutual labels:  plantuml
Asciidoc Kate
AsciiDoc/AsciiDoctor syntax highlighting plugin for Kate editor/KatePart
Stars: ✭ 5 (-79.17%)
Mutual labels:  asciidoctor
Plantuml Editor
PlantUML online demo client
Stars: ✭ 313 (+1204.17%)
Mutual labels:  plantuml
Aws Plantuml
PlantUML sprites, macros, and other includes for AWS components.
Stars: ✭ 565 (+2254.17%)
Mutual labels:  plantuml
Aws Icons For Plantuml
PlantUML sprites, macros, and other includes for Amazon Web Services services and resources
Stars: ✭ 309 (+1187.5%)
Mutual labels:  plantuml
Netbeans Mmd Plugin
Free mind map and PlantUML editor with plugins for both NetBeans and Intellij
Stars: ✭ 283 (+1079.17%)
Mutual labels:  plantuml
Asciidoctor
💎 A fast, open source text processor and publishing toolchain, written in Ruby, for converting AsciiDoc content to HTML 5, DocBook 5, and other formats.
Stars: ✭ 3,905 (+16170.83%)
Mutual labels:  asciidoctor
Cleancppproject
Clean C++ project for you to use. Features: Modern CMake, CPack, Doxygen, PlantUML, Catch Unit testing, static analysis
Stars: ✭ 276 (+1050%)
Mutual labels:  plantuml
Arkit
JavaScript architecture diagrams and dependency graphs
Stars: ✭ 671 (+2695.83%)
Mutual labels:  plantuml
asciidoctor-lein-plugin
A Leiningen plugin for generating documentation using Asciidoctor
Stars: ✭ 26 (+8.33%)
Mutual labels:  asciidoctor
Markdown Preview Enhanced
One of the 'BEST' markdown preview extensions for Atom editor!
Stars: ✭ 3,478 (+14391.67%)
Mutual labels:  plantuml
Doctoolchain
a Gradle based AsciiDoc Toolchain for Software Architecture Documentation
Stars: ✭ 355 (+1379.17%)
Mutual labels:  asciidoctor
Jbake
Java based open source static site/blog generator for developers & designers.
Stars: ✭ 904 (+3666.67%)
Mutual labels:  asciidoctor

= Asciidoctor PlantUML Extension :plantuml-server-public: http://www.plantuml.com/plantuml :antora-link: https://antora.org[Antora] :toc: macro :icons: font

Extension for https://github.com/asciidoctor/asciidoctor.js[Asciidoctor.js] that provides integration with http://plantuml.com[PlantUML] using https://github.com/plantuml/plantuml-server[PlantUML Server]

ifdef::env-github[]

image:https://img.shields.io/travis/eshepelyuk/asciidoctor-plantuml.js?style=for-the-badge&logo=travis[Travis (.org), link="https://travis-ci.org/eshepelyuk/asciidoctor-plantuml.js"] image:https://img.shields.io/npm/v/asciidoctor-plantuml?style=for-the-badge&logo=npm["npm version", link="https://www.npmjs.com/package/asciidoctor-plantuml"] image:https://img.shields.io/badge/code_style-standardjs-brightgreen?style=for-the-badge[StandardJS, link="https://standardjs.com"]

endif::[]

⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠

This project is out of maintenance. No bug fixes or feature requests are going to be processed.

Do not be frustrated, though !

There's great extension https://github.com/Mogztter/asciidoctor-kroki[asciidoctor-kroki] that supports PlantUML and much more, meanwhile being actively maintained by developers of AsciidoctorJS.

So, the suggestion is - to migrate to asciidoctor-kroki

⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠

toc::[]

== Overview

This extension mimics the behavior of the PlantUML support in https://asciidoctor.org/docs/asciidoctor-diagram[Asciidoctor Diagram] as closely as possible. Positional and named attributes as well as PNG and SVG formats are supported.

.PlantUML example

[plantuml#myId,mydiagram,svg,role=sequence] <1> <2> <3> .... alice -> bob ....

<1> block style modifiers are supported <2> positional attributes are supported <3> named attributes are supported

Unlike Asciidoctor Diagram, this extension uses https://github.com/plantuml/plantuml-server[PlantUML server] for displaying images. The default behavior is that generated image tags will have the src attribute contain a link to a PlantUML server.

[NOTE]

Since the PlantUML server supports some other formats, it's possible to use the http://ditaa.sourceforge.net/[Ditaa] and http://www.graphviz.org/doc/info/lang.html[Graphiz (DOT)] syntax as well. Check the http://plantuml.com/[PlantUML website] for the complete list of supported diagrams.

.Ditaa example

[ditaa] .... +----------+ +-------------+ |cAAA | | | | +---+ Application | | Database | | cRED{d}| | {s}| +-------------+ +----------+ ....

NOTE: Only PNG generation is supported for Ditaa diagrams.

.Graphviz (DOT) example

[graphviz] .... digraph foo { node [style=rounded] node1 [shape=box] node2 [fillcolor=yellow, style="rounded,filled", shape=diamond] node3 [shape=record, label="{ a | b | c }"]

node1 -> node2 -> node3 } ....

=== PlantUML server

https://github.com/plantuml/plantuml-server[PlantUML server] is a standalone web application exposing an HTTP API that allows generating diagram images on the fly.

It can be used in two modes:

  • Public instance, for example this one {plantuml-server-public}.
  • For performance reason it's recommended to use private one.

One could easily deploy it as Docker container as described in https://github.com/plantuml/plantuml-server#how-to-run-the-server-with-docker[README].

$ docker run -d -p 8080:8080 plantuml/plantuml-server:jetty

=== Configuration

Extension behaviour can be configured via http://asciidoctor.org/docs/user-manual/#attributes[Asciidoctor attributes].

.Supported global or page configuration attributes [cols="3,9"] |=== |Attribute |Description

|plantuml-server-url | mandatory PlantUML Server instance URL. Will be used for generating diagram src. E.g. http://www.plantuml.com/plantuml

|plantuml-fetch-diagram |If set, images will be downloaded and saved to local folder. img tags will be pointing to local folder. Otherwise, img tags will have src attribute pointing to :plantuml-server-url:

|imagesoutdir |Analogue of https://asciidoctor.org/docs/asciidoctor-diagram/#image-output-location[Asciidoctor Diagram] attribute. E.g. ./assets/images

|plantuml-config-file |Analogue of https://github.com/asciidoctor/asciidoctor-diagram#plantuml[PlantUML config] attribute.

|plantuml-default-format |Sets the default output format, which is normally png. This can be overriden in a specific diagram with the format attribute.

|plantuml-default-options |Sets the default for the options attribute. May be set to inline for inline svg, or interactive for interactive object.

|===

== Antora integration

Integration is just the matter of enabling the extension in https://docs.antora.org/antora/2.0/playbook/[site playbook] and providing address of PlantUML server via extension's config.

There's https://github.com/eshepelyuk/asciidoctor-plantuml-antora[sample repository] demonstrating usage of this extension in Antora.

== Asciidoctor.js integration

=== Using in Node.JS

Install dependencies::

$ yarn add asciidoctor.js asciidoctor-plantuml

Create file with following content and run it:: + [source,javascript] [subs="verbatim,attributes"] .plantuml.js .... const asciidoctor = require('asciidoctor.js')(); const plantuml = require('asciidoctor-plantuml');

const asciidocContent = ` == PlantUML :plantuml-server-url: {plantuml-server-public} <1> [plantuml]

alice -> bob bob ..> alice

`;

plantuml.register(asciidoctor.Extensions); console.log(asciidoctor.convert(asciidocContent)); <2>

const registry = asciidoctor.Extensions.create(); plantuml.register(registry); console.log(asciidoctor.convert(asciidocContent, {'extension_registry': registry})); <3>

.... <1> it's possible to configure different URL for PlantUML server using Asciidoctor attribute <2> usage with global extension registry <3> usage with custom registry

=== Using in browser

Install dependencies::

$ yarn add asciidoctor.js asciidoctor-plantuml

Create file with following content and open in in browsert:: + [source,html] [subs="verbatim,attributes"] .plantuml.html ....

<script src="node_modules/asciidoctor.js/dist/browser/asciidoctor.js"></script> <script src="node_modules/asciidoctor-plantuml/dist/browser/asciidoctor-plantuml.js"></script> <script> const asciidocContent = ` == PlantUML :plantuml-server-url: {plantuml-server-public} <1> [plantuml] ---- alice -> bob bob ..> alice ---- `;

var asciidoctor = Asciidoctor(); var plantuml = AsciidoctorPlantuml;

plantuml.register(asciidoctor.Extensions); console.log(asciidoctor.convert(asciidocContent)); <2>

const registry = asciidoctor.Extensions.create(); plantuml.register(registry); console.log(asciidoctor.convert(asciidocContent, {'extension_registry': registry})); <3> </script>

.... <1> it's possible to configure different URL for PlantUML server using Asciidoctor attribute <2> usage with global extension registry <3> usage with custom registry

=== Output

Regardless of global or custom registry usage, produced HTML output will look like

[source,html] [subs="verbatim,attributes"]

PlantUML

diagram
----
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].