A set of macros for Asciidoctor.js to integrate lohrfink decision tables in your AsciiDoc based documentation!
Install the dependencies:
npm i asciidoctor asciidoctor-lfet
Create a file named lfet.js with following content and run it:
const asciidoctor = require('@asciidoctor/core')()
const lfet = require('asciidoctor-lfet')
const input = 'dt::smallestDecisionTable.lfet[]'
lfet.register(asciidoctor.Extensions) // <1>
console.log(asciidoctor.convert(input, { safe: 'safe' }))
const registry = asciidoctor.Extensions.create()
lfet.register(registry) // <2>
console.log(asciidoctor.convert(input, { safe: 'safe', extension_registry: registry }))
<1> Register the extension in the global registry
<2> Register the extension in a dedicated registry
dt::example$smallestDecisionTable.lfet[]
R01 | R02 | ||
---|---|---|---|
C01 | Condition 1 | Y | N |
A01 | Action 1 | X | - |
A02 | Action 2 | - | X |