Table of Contents

asciidocjs Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" unknown

plugin Use asciidoc in DokuWiki

Last updated on
2023-09-24
Provides
Syntax
Repository
Source

Tagged with asciidoc, markup

Installation

:!: External requirements: This plugin can make use of the following additional component if it is installed separately:

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Examples/Usage

The plugin allows the write pages using asciidoc markup in DokuWiki. Therefore it supports two syntax elements:

Block-mode:
<asciidoc>

</asciidoc>

and

Whole or partial page:
//#--asciidoc--#//

With <asciidoc></asciidoc> it is possible to mix blocks formatted using asciidoc with other blocks resulting in a document which mixes DokuWiki and ascidoc syntax.

The marker //#--asciidoc--#// should only be used at the beginning of a document and only asciidoc markup should be used afterwards. Since this marker is a comment in asciidoc the resulting DokuWiki file is therefore a valid asciidoc file. There is no way to exit the asciidoc mode when this pattern is used.

A description of the AsciiDoc markup language can be found at AsciiDoc Language Documentation

Syntax

Basic syntax:

<asciidoc>...</asciidoc>


//#--asciidoc--#//


Wikilink:id[text]

Configuration and Settings

The Plugin has the following configuration options:

The AsciiDotor CSS file might interfere with the CSS file of the template. Its usage can be disabled.

The conversion between asciidoc and html5 can be done either in the browser or by the server. If the conversion in the browser is selected then the plugin will create a json script based on the asciidoc markup text and embeds this script in the html page. AsciiDoctor.js is used on the client side in the browser to convert the embedded asciidoc markup scripts to html, which is injected in the DOM of the browser.

The conversion from asciidoc to html5 is only possible on the server side if node.js is installed on the server. The plugin will then run node.js with AsciiDoctor.js to convert the asciidoc markup to html and sends then a pure html page to the browser.

The default command to run node.js is node. If needed the command to execute node.js can be adjusted in the configuration.

Node.js is needed to generate pdf pages with DW2PDF if the asciidocjs plugin is used. Manually erase the path to the node.js executable in the plugin configuration if node.js is not installed but the plugin DW2PDF is installed.

The asciidoc extension to use a Kroki server for the conversion of images is integrated but can be disabled. In addition a name of a Kroki-server can be given which will be used instead of https://kroki.io.

Development

The source code of the plugin is available at GitHub: https://github.com/hfr/dokuwiki-plugin-asciidocjs.

Changelog

ToDo/Wish List

Complete testing and validation is needed.

FAQ