diff --git a/local-antora-playbook.yml b/local-antora-playbook.yml index 692973d..38631d5 100644 --- a/local-antora-playbook.yml +++ b/local-antora-playbook.yml @@ -30,6 +30,7 @@ asciidoc: - '@asciidoctor/tabs' - './macros/glossary' - './macros/config-ref' + - './macros/bloblang-snippet' - './macros/helm-ref' - './macros/rp-connect-components' - './asciidoc-extensions/add-line-numbers-highlights' diff --git a/macros/bloblang-snippet.js b/macros/bloblang-snippet.js new file mode 100644 index 0000000..2d38a24 --- /dev/null +++ b/macros/bloblang-snippet.js @@ -0,0 +1,201 @@ +module.exports.register = function (registry) { + registry.block(function () { + var self = this + self.named('bloblang_snippet') + self.onContext(['paragraph','open','literal']) + self.process(function (parent, reader, attrs) { + const input = attrs['input'] || '{}'; + const metadata = attrs['metadata'] || '{}'; + const wasmUrl = attrs['wasm_url'] || '/blobl.wasm'; + const instanceId = `bloblang-${Math.random().toString(36).slice(2, 11)}`; + + // Read block content (e.g., mapping) + const mapping = reader.getLines().join('\n'); + + const html = ` +
+
+ + +
+
+
+ Bloblang mapping +
+
+
+
+
+ Output +
"Output will appear here..."
+
+ +
+
+ + `; + return this.createBlock(parent, 'pass', html); + }); + }); +}; diff --git a/package-lock.json b/package-lock.json index d9b2c30..6b95e1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@redpanda-data/docs-extensions-and-macros", - "version": "4.1.0", + "version": "4.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@redpanda-data/docs-extensions-and-macros", - "version": "4.1.0", + "version": "4.2.0", "license": "ISC", "dependencies": { "@asciidoctor/tabs": "^1.0.0-beta.6", diff --git a/package.json b/package.json index dd6dcc8..246f1ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@redpanda-data/docs-extensions-and-macros", - "version": "4.1.0", + "version": "4.2.0", "description": "Antora extensions and macros developed for Redpanda documentation.", "keywords": [ "antora", @@ -50,7 +50,8 @@ "./macros/glossary": "./macros/glossary.js", "./macros/rp-connect-components": "./macros/rp-connect-components.js", "./macros/config-ref": "./macros/config-ref.js", - "./macros/helm-ref": "./macros/helm-ref.js" + "./macros/helm-ref": "./macros/helm-ref.js", + "./macros/bloblang-snippet": "./macros/bloblang-snippet.js" }, "files": [ "extensions",