This documentation covers a prerelease version of the software. Follow this link to view the documentation for the stable version (3.0) instead.

Docinfo Extension Example

Purpose

Add the sentence "Made with <3" in the footer.

sample-love-doc.adoc

= Title

== First section

This is a paragraph.

LoveFooterDocinfoProcessor

love-footer-docinfo-processor.js
export default function (registry) {
  registry.docinfoProcessor(function () {
    const self = this
    self.atLocation('footer')
    self.process(function () {
      return 'Made with <3'
    })
  })
}

Usage

import { Extensions, convertFile } from '@asciidoctor/core'
import registerLoveFooterDocinfoProcessor from './love-footer-docinfo-processor.js'

const registry = Extensions.create()
registerLoveFooterDocinfoProcessor(registry)

const html = await convertFile('sample-love-doc.adoc', { to_file: false, extension_registry: registry })
console.log(html)