String templating API functions

Overview

This section describes functions exported to the namespace of Lua frames by the main Doxyrest string templating engine. More…

-- functions

function emit(s)
function generateFile(targetFileName, frameFileName, ...)
function getCol()
function getLine()
function getLineText()
function includeFile(fileName, ...)
function includeFileWithIndent(indent, fileName, ...)
function passthrough(offset, length)
function trimOutput()

Detailed Documentation

This section describes functions exported to the namespace of Lua frames by the main Doxyrest string templating engine.

Functions

function emit(s)

Emits s, i.e. appends string s to the output.

function generateFile(targetFileName, frameFileName, ...)

Processes a frame located in the file frameFileName and writes the output to the file targetFileName. All the variables and functions declared up to this point remain accessible from Lua code in the frame. It’s also possible to pass extra arguments to the frame by passing more values after the frameFileName argument [1].

function getCol()

Returns current column number in the emitted output.

function getLine()

Returns current line number in the emitted output.

function getLineText()

Returns text of the current line in the emitted output.

function includeFile(fileName, ...)
function includeFileWithIndent(indent, fileName, ...)

Processes a frame located in the file fileName and appends the results is appended to the current output. All the variables and functions declared up to this point remain accessible from Lua code in the frame. It’s also possible to pass extra arguments to the frame by passing more values after the fileName argument [1]. includeFileWithIndent function also injects extra indent before each and every line generated as a result of processing the frame fileName.

function passthrough(offset, length)

Emits the original text from the current string template frame. The arguments offset and length define the region of the frame to emit. Normally, you never have to manually call this function, as the string template engine inserts calls to passthrough(...) in necessary locations automatically.

function trimOutput()

Removes all trailing spaces from the current line in the emitted output.


Footnotes