Export generateIndex function
Consumers may want to reuse the logic from this extension without using the extension directly. For example, they may want to bind the functionality to a different phase in the generator lifecycle. To allow the logic to be reused, expose the generateIndex
function as an exported function of the main script.
There will thus be two ways to require this function:
const { generateIndex } = require('@antora/lunr-extension')
or
const generateIndex = require('@antora/lunr-extension/generate-index')
The second is an existing export mapping that resolves to the file that provides the generateIndex
function. However, this mapping needs to be tested.