Skip to content

fix: use bloblang syntax highlighting instead of coffeescript#184

Merged
JakeSCahill merged 11 commits intomainfrom
fix/bloblang-syntax-highlighting
Apr 2, 2026
Merged

fix: use bloblang syntax highlighting instead of coffeescript#184
JakeSCahill merged 11 commits intomainfrom
fix/bloblang-syntax-highlighting

Conversation

@JakeSCahill
Copy link
Copy Markdown
Contributor

Summary

Fixes Bloblang code blocks to use bloblang syntax highlighting instead of coffeescript.

Changes

  • Updated bloblangExample.js helper to use [,bloblang] instead of [,coffeescript]
  • Bumped version to 4.15.8

Impact

All future generated Bloblang documentation will use correct syntax highlighting:

[,bloblang]
----
root.title = this.title.capitalize()
----

Instead of:

[,coffeescript]
----
root.title = this.title.capitalize()
----

Testing

Regenerated Bloblang partials in rp-connect-docs to verify the fix works correctly.

🤖 Generated with Claude Code

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for docs-extensions-and-macros ready!

Name Link
🔨 Latest commit 1a6f466
🔍 Latest deploy log https://app.netlify.com/projects/docs-extensions-and-macros/deploys/69ceb593b38d050008729659
😎 Deploy Preview https://deploy-preview-184--docs-extensions-and-macros.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 991c63e7-19c2-4dbf-a24b-dafb159c328f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request contains a minor version bump and a formatter update. The package version in package.json was incremented from 4.15.7 to 4.15.8. Additionally, the Bloblang example formatter in tools/redpanda-connect/helpers/bloblangExample.js was updated to change the language identifier in code block headers from coffeescript to bloblang for both conditional and unconditional cases.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • paulohtb6
  • Feediver1
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the primary change: replacing coffeescript syntax highlighting with bloblang in generated code blocks.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about fixing bloblang syntax highlighting and includes relevant examples and testing information.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bloblang-syntax-highlighting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JakeSCahill JakeSCahill force-pushed the fix/bloblang-syntax-highlighting branch 5 times, most recently from 635bdc9 to 4be95f2 Compare April 2, 2026 11:49
Changes:
- Fixed syntax highlighting: replaced 'coffeescript' with 'bloblang'
- Added Parameters section with clean AsciiDoc table format
- Fixed HTML entity escaping using triple braces in templates
- Extracted summary text as lead-in prose (not embedded as comments)

Bloblang change detection in PR summaries:
- Added detection of new/removed Bloblang methods and functions
- PR summary now includes Writer Action Items section for Bloblang changes
- Provides instructions on how to manually add includes to guide pages
- Shows counts in total summary and per-release breakdowns

This gives writers visibility into Bloblang changes without automatically
modifying guide pages, preserving manual control over documentation structure.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@JakeSCahill JakeSCahill force-pushed the fix/bloblang-syntax-highlighting branch from 4be95f2 to 9444048 Compare April 2, 2026 11:53
Removed decorative emojis from:
- Main headings (Redpanda Connect Documentation Update)
- Multi-release update label
- Version headings
- Writer Action Items
- Detailed Changes
- Summary list items
- Subsection headings

Kept ⚠️ only for critical warnings:
- Breaking Changes Detected
- Missing Descriptions
- Removed Connectors
- Removed Fields
- Changed Default Values

Reduced emoji count from 27 to 5 instances.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/redpanda-connect/report-delta.js`:
- Around line 167-170: The mapping currently assumes each entry is an object and
accessing m.name/f.name will throw for null/undefined items; update the four
expressions (oldMethods, newMethods, oldFunctions, newFunctions) to guard
against null items by either filtering out falsy entries before mapping or using
optional chaining when accessing the name (e.g. (oldIndex['bloblang-methods'] ||
[]).filter(Boolean).map(m => m.name).filter(Boolean) or .map(m =>
m?.name).filter(Boolean)), so that null/undefined entries cannot cause a crash
during diff generation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d3b86649-9c84-42d0-a5fa-f038cff66822

📥 Commits

Reviewing files that changed from the base of the PR and between 7353919 and 9444048.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • package.json
  • tools/redpanda-connect/helpers/bloblangExample.js
  • tools/redpanda-connect/helpers/hasOptionalParams.js
  • tools/redpanda-connect/helpers/index.js
  • tools/redpanda-connect/pr-summary-formatter.js
  • tools/redpanda-connect/report-delta.js
  • tools/redpanda-connect/templates/bloblang-function.hbs
✅ Files skipped from review due to trivial changes (2)
  • package.json
  • tools/redpanda-connect/helpers/hasOptionalParams.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/redpanda-connect/helpers/bloblangExample.js

JakeSCahill and others added 3 commits April 2, 2026 13:49
Added ensurePeriod helper that automatically adds a period to
descriptions that don't already have terminal punctuation.

This ensures consistent formatting even if source data is missing
periods. Works alongside the existing bloblangExample helper which
ensures lead-ins end with colons.

Part of version 4.15.8.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…partials

Removed all emojis from PR summary output for cleaner, professional
formatting.

Added automatic deletion of Bloblang method/function partials when
they are removed from the source data. The automation now:
- Reads existing partials from the output directory
- Compares with current data
- Deletes partials for removed methods/functions
- Logs deletions to console

PR summary already includes Writer Action Items for removed Bloblang
methods/functions, telling writers which includes to delete from
guide pages.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds comprehensive deprecation tracking and reporting for Bloblang
methods and functions across templates, delta reports, and PR summaries.

Template changes:
- Add deprecation warning block to bloblang-function.hbs template
- Display warning when status equals "deprecated"
- Include description in warning block using ensurePeriod helper
- Fix superfluous whitespace (only 1 blank line after title)

Delta detection:
- Track newly deprecated Bloblang methods and functions in report-delta.js
- Compare status field between old and new versions
- Add deprecatedBloblangMethods and deprecatedBloblangFunctions arrays
- Include counts in summary and details in output

PR summary formatting:
- Add Bloblang stats to summary section (new, removed, deprecated)
- Add Writer Action Items section for Bloblang changes
- Include deprecated methods/functions with version information
- Add instructions for updating guide pages
- Support both single-version and multi-version PR summaries

This ensures writers are notified when Bloblang methods or functions
are deprecated and can add appropriate notices to documentation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
tools/redpanda-connect/pr-summary-formatter.js (1)

879-955: Consider extracting shared Bloblang instruction rendering.

The "Update Bloblang Guide Pages" section (lines 879-955) duplicates the same logic and text as the multi-version equivalent (lines 386-455). If this pattern continues to grow, consider extracting a helper function to reduce duplication.

This is a minor maintainability concern and acceptable to defer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/redpanda-connect/pr-summary-formatter.js` around lines 879 - 955, The
Bloblang guide rendering block duplicates the same logic/text used elsewhere
(see the multi-version block) — extract a helper (e.g.,
renderBloblangGuideSection or renderBloblangEntries) that accepts stats and
diffData.details and produces the lines array entries for new/removed/deprecated
methods/functions and the "How to add includes" footer; replace the current
inline block guarded by hasBloblangChanges with a call to that helper and reuse
it in the other multi-version location to eliminate duplication (refer to
symbols: hasBloblangChanges, stats.newBloblangMethods,
stats.removedBloblangFunctions, stats.deprecatedBloblangMethods,
diffData.details.newBloblangFunctions, and the lines array).
tools/redpanda-connect/generate-rpcn-connector-docs.js (1)

476-490: Consider protecting hand-authored files from deletion.

The deletion pass removes all .adoc files in Bloblang partials directories that aren't in the current data set. If anyone manually creates a file in bloblang-functions/ or bloblang-methods/ (e.g., a custom partial or documentation override), it will be silently deleted.

If hand-authored files are a realistic scenario, consider adding a whitelist mechanism or a naming convention (e.g., prefix with _) to exclude certain files from deletion.

💡 Example safeguard using a naming convention
       for (const file of existingFiles) {
+        // Skip files starting with underscore (convention for hand-authored)
+        if (file.startsWith('_')) continue;
         const name = file.replace('.adoc', '');
         if (!currentNames.has(name)) {
           const filePath = path.join(outRoot, file);
           fs.unlinkSync(filePath);
           console.log(`Deleted removed ${folder} partial: ${file}`);
         }
       }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/redpanda-connect/generate-rpcn-connector-docs.js` around lines 476 -
490, The deletion loop removes any .adoc in outRoot not present in currentNames,
risking removal of hand-authored files; update the logic in the block that
builds existingFiles / the for loop (referencing existingFiles, currentNames,
outRoot, folder and fs.unlinkSync) to skip files that follow a safe naming
convention (e.g., names starting with '_' or in a whitelist array), or check
against a configurable whitelist set before calling fs.unlinkSync, and log
skipped files so manual partials are preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/redpanda-connect/report-delta.js`:
- Around line 181-184: The Map constructions for oldMethodsMap, newMethodsMap,
oldFunctionsMap and newFunctionsMap can throw if any entry is null/undefined;
update each expression to safely handle missing entries by first falling back to
an empty array then filtering out falsy items (or items without a .name) before
mapping—e.g., replace (oldIndex['bloblang-methods'] || []).map(...) with
(oldIndex['bloblang-methods'] || []).filter(Boolean).map(m => [m.name, m]) or
equivalent guards so .name is only accessed on valid objects.

---

Nitpick comments:
In `@tools/redpanda-connect/generate-rpcn-connector-docs.js`:
- Around line 476-490: The deletion loop removes any .adoc in outRoot not
present in currentNames, risking removal of hand-authored files; update the
logic in the block that builds existingFiles / the for loop (referencing
existingFiles, currentNames, outRoot, folder and fs.unlinkSync) to skip files
that follow a safe naming convention (e.g., names starting with '_' or in a
whitelist array), or check against a configurable whitelist set before calling
fs.unlinkSync, and log skipped files so manual partials are preserved.

In `@tools/redpanda-connect/pr-summary-formatter.js`:
- Around line 879-955: The Bloblang guide rendering block duplicates the same
logic/text used elsewhere (see the multi-version block) — extract a helper
(e.g., renderBloblangGuideSection or renderBloblangEntries) that accepts stats
and diffData.details and produces the lines array entries for
new/removed/deprecated methods/functions and the "How to add includes" footer;
replace the current inline block guarded by hasBloblangChanges with a call to
that helper and reuse it in the other multi-version location to eliminate
duplication (refer to symbols: hasBloblangChanges, stats.newBloblangMethods,
stats.removedBloblangFunctions, stats.deprecatedBloblangMethods,
diffData.details.newBloblangFunctions, and the lines array).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89c4651e-2c4c-4acd-967c-febca5892575

📥 Commits

Reviewing files that changed from the base of the PR and between 7353919 and 21abd92.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • package.json
  • tools/redpanda-connect/generate-rpcn-connector-docs.js
  • tools/redpanda-connect/helpers/bloblangExample.js
  • tools/redpanda-connect/helpers/ensurePeriod.js
  • tools/redpanda-connect/helpers/hasOptionalParams.js
  • tools/redpanda-connect/helpers/index.js
  • tools/redpanda-connect/pr-summary-formatter.js
  • tools/redpanda-connect/report-delta.js
  • tools/redpanda-connect/templates/bloblang-function.hbs
✅ Files skipped from review due to trivial changes (2)
  • package.json
  • tools/redpanda-connect/helpers/ensurePeriod.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/redpanda-connect/helpers/bloblangExample.js

JakeSCahill and others added 4 commits April 2, 2026 14:42
Updates the bloblang-function.hbs template to ensure descriptions
appear after (not inside) deprecation warning blocks.

Before:
```
[WARNING]
====
This method is deprecated...

Description text here.
====
```

After:
```
[WARNING]
====
This method is deprecated...
====

Description text here.
```

This makes deprecation notices clearer and keeps descriptions
accessible regardless of deprecation status.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates bloblangExample helper to automatically convert Markdown-style
headings in example summaries to AsciiDoc format.

Conversions:
- ##### Heading -> ==== Heading (H5 -> H4)
- #### Heading -> === Heading (H4 -> H3)
- ### Heading -> == Heading (H3 -> H2)

This fixes "section title out of sequence" build warnings that occur
when benthos/connect source data contains Markdown headings in example
summary fields.

Prevents need for manual fixes when regenerating partials.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ries

- Add toSentenceCase helper to convert category names to sentence case
- Create templates for methods.adoc and functions.adoc overview pages
- Auto-generate overview pages during rpcn-connector-docs generation
- Preserve acronyms (SQL, JSON) and product names (GeoIP) in categories
- Apply sentence case to category headings in methods.adoc

Examples:
- 'String Manipulation' -> 'String manipulation'
- 'JSON Web Tokens' -> 'JSON web tokens'
- 'Object & Array Manipulation' -> 'Object & array manipulation'
- 'SQL' -> 'SQL' (preserved)
- 'GeoIP' -> 'GeoIP' (preserved)
**Safety improvements:**
- report-delta.js: Filter null/undefined entries before accessing .name property
  to prevent crashes during diff generation (lines 167-170, 181-184)
- generate-rpcn-connector-docs.js: Skip hand-authored files (starting with _)
  in deletion loop to prevent accidental removal (lines 479-490)

**Code quality:**
- pr-summary-formatter.js: Extract renderBloblangChanges() helper function
  to eliminate duplication between multi-version and single-version summary
  rendering (previously duplicated ~70 lines of identical logic)

All tests pass (14 suites, 324 tests)
@JakeSCahill JakeSCahill requested a review from a team April 2, 2026 15:56
JakeSCahill and others added 2 commits April 2, 2026 18:02
Replace non-standard ^*^ footnote syntax with simple (optional) suffix
in parameter names. This is clearer and avoids the complexity of AsciiDoc
footnote rendering.

Before:
  | `name`^*^
  ^*^ Optional parameter

After:
  | `name` (optional)

Benefits:
- Simpler, more direct
- No footnote rendering issues
- Easier to read at a glance
- Follows common documentation patterns
- Change TODO markers to AsciiDoc comments (//) in templates
- Remove :status: attribute from connector frontmatter (all connectors are stable)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@JakeSCahill JakeSCahill merged commit 9bba072 into main Apr 2, 2026
19 checks passed
@JakeSCahill JakeSCahill deleted the fix/bloblang-syntax-highlighting branch April 2, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants