UNPKG

@redpanda-data/docs-extensions-and-macros

Version:

Antora extensions and macros developed for Redpanda documentation.

17 lines (15 loc) 599 B
const buildConfigYaml = require('./buildConfigYaml.js'); const handlebars = require('handlebars'); /** * Handlebars helper “advancedConfig”. Omits only deprecated. * * Usage in template: * {{advancedConfig this.type this.name this.config.children}} */ module.exports = function advancedConfig(type, connectorName, children) { if (typeof type !== 'string' || typeof connectorName !== 'string' || !Array.isArray(children)) { return ''; } const yamlText = buildConfigYaml(type, connectorName, children, /*includeAdvanced=*/ true); return new handlebars.SafeString(yamlText); }