Skip to content

fix(content): use text+lp fences for line protocol syntax examples - #7705

Merged
jstirnaman merged 4 commits into
masterfrom
fix/line-protocol-fence
Aug 25, 2026
Merged

fix(content): use text+lp fences for line protocol syntax examples#7705
jstirnaman merged 4 commits into
masterfrom
fix/line-protocol-fence

Conversation

@jstirnaman

@jstirnaman jstirnaman commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What changed

Why

Line protocol examples need syntax-aware rendering and validation. The former js and sh labels incorrectly represented line protocol as executable JavaScript or shell code, and the new lp support prevents malformed examples from silently reaching the docs.

Impact

Docs rendering now gives lp fences dedicated syntax markup. CI rejects malformed lp fences unless they are explicitly exempted. No runtime dependency or product behavior changes.

Verification

  • yarn test:lint-codeblocks (65 passing)
  • yarn test:render-regression (12 passing)
  • yarn build:agent:instructions
  • yarn validate:agent-instructions
  • Pre-commit and pre-push hooks passed.

Closes #7678
Closes #5821

@jstirnaman
jstirnaman requested a review from a team as a code owner August 25, 2026 18:15
@jstirnaman
jstirnaman requested review from sanderson and removed request for a team August 25, 2026 18:15
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Vale Style Check Results

Metric Count
Errors 0
Warnings 4
Warnings (4)
File Line Rule Message
content/AGENTS.md 11 Google.Colons ': D' should be in lowercase.
content/AGENTS.md 12 InfluxDataDocs.Spelling Did you really mean 'Shortcodes'?
content/AGENTS.md 12 Google.Colons ': D' should be in lowercase.
content/AGENTS.md 291 Google.Colons ': S' should be in lowercase.

Check passed

@github-actions github-actions Bot added product:shared Shared content across products product:v1-enterprise InfluxDB Enterprise v1 product:v2 InfluxDB v2 (Cloud TSM, OSS) product:v2-cloud InfluxDB Cloud (TSM) product:v3-distributed InfluxDB 3 Cloud Serverless, Cloud Dedicated, Clustered product:v3-monolith InfluxDB 3 Core and Enterprise (single-node / clusterable) labels Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🔗 Link Check Results — Link Check Bot

3 broken link(s) found — fix them before merging.

Metric Value
Files Checked 10
Total Links 4082
Errors 3
Warnings 10
Success Rate 99.191574%

Broken Links

Source File Broken URL Error Report
content/influxdb3/cloud-serverless/reference/syntax/line-protocol/_index.md /influxdb3/cloud-serverless/write-data/#timestamp-precision Fragment not found: #timestamp-precision Report
content/influxdb/v2/reference/syntax/line-protocol/_index.md /influxdb/v2/write-data/#timestamp-precision Fragment not found: #timestamp-precision Report
content/influxdb/cloud/reference/syntax/line-protocol/_index.md /influxdb/cloud/write-data/#timestamp-precision Fragment not found: #timestamp-precision Report
⚠️ 10 warning(s) (do not fail CI)
Source File URL Issue
content/enterprise_influxdb/v1/guides/write_data/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/example/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/influxdb/cloud/reference/syntax/line-protocol/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/influxdb/v2/reference/syntax/line-protocol/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/influxdb3/cloud-dedicated/reference/syntax/line-protocol/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/influxdb3/cloud-serverless/reference/syntax/line-protocol/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/influxdb3/cloud/reference/syntax/line-protocol/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/influxdb3/clustered/reference/syntax/line-protocol/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/influxdb3/core/reference/line-protocol/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…
content/influxdb3/enterprise/reference/line-protocol/_index.md https://support.influxdata.com/ Network error: SSL certificate not trusted. Use --insecure if site is trusted (e…

Full details: workflow run summary and artifact. Last updated: 2026-08-25 21:59:23 UTC

@jstirnaman

jstirnaman commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

## Known gap: lp fence has no syntax highlighting

Converting these blocks from js/sh to lp fixes the mislabeling (they were never valid JS/shell), but introduces a visual regression worth tracking.

What's lost: assets/styles/layouts/_syntax-highlighting.scss has a .language-js rule (originally added for Flux duration/time values, e.g. 1h30m) that colors a number token immediately followed by an identifier token:

// Javascript / Flux specific styles (duration and time values)
.language-js {
  .mi + .nx, .mf + .nx { color: $article-code-accent5; }
}

This incidentally colorized line protocol's integer/uinteger suffixes (12485903i, 1u) when those blocks were fenced js. Chroma has no lp lexer, so class=language-lp blocks render with zero token spans — confirmed via build output on this branch. Result: the float/integer/uinteger/boolean/timestamp/special-characters/comment field-value examples in content/shared/v3-line-protocol.md and content/shared/influxdb-v2/reference/syntax/line-protocol.md go from (wrongly-labeled but) colorized to flat, unhighlighted text.

Not a template bug — nothing breaks, no build/render error. lp fence support is new to this repo; this is the first real-world content landing on lp for these particular blocks, so there's no prior precedent being broken, just no highlighting gained either.

@jstirnaman
jstirnaman marked this pull request as draft August 25, 2026 18:30
@jstirnaman
jstirnaman marked this pull request as ready for review August 25, 2026 19:51
@jstirnaman

Copy link
Copy Markdown
Contributor Author

## Known gap: lp fence has no syntax highlighting

Converting these blocks from js/sh to lp fixes the mislabeling (they were never valid JS/shell), but introduces a visual regression worth tracking.

What's lost: assets/styles/layouts/_syntax-highlighting.scss has a .language-js rule (originally added for Flux duration/time values, e.g. 1h30m) that colors a number token immediately followed by an identifier token:

// Javascript / Flux specific styles (duration and time values)
.language-js {
  .mi + .nx, .mf + .nx { color: $article-code-accent5; }
}

This incidentally colorized line protocol's integer/uinteger suffixes (12485903i, 1u) when those blocks were fenced js. Chroma has no lp lexer, so class=language-lp blocks render with zero token spans — confirmed via build output on this branch. Result: the float/integer/uinteger/boolean/timestamp/special-characters/comment field-value examples in content/shared/v3-line-protocol.md and content/shared/influxdb-v2/reference/syntax/line-protocol.md go from (wrongly-labeled but) colorized to flat, unhighlighted text.

Not a template bug — nothing breaks, no build/render error. lp fence support is new to this repo; this is the first real-world content landing on lp for these particular blocks, so there's no prior precedent being broken, just no highlighting gained either.

Fixed with:

  • b776526 feat(line-protocol): add fences highlighting and validation
  • e691ae2 style(test): format line protocol regression check

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think there's a lot more we could do for syntax highlighting line protocol, but it's probably beyond this PR and may even be worth contributing to Chroma upstream. I think this is good enough for now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think there's a lot more we could do for syntax highlighting line protocol, but it's probably beyond this PR and may even be worth contributing to Chroma upstream. I think this is good enough for now.

My thoughts exactly. I considered starting the Chroma work, but it'll have to wait for now.

maximal and others added 4 commits August 25, 2026 16:56
#7678 and #5821 fixed the misleading `js`/`//` comment syntax in the
line protocol "Syntax" block, but relabeled it `python`, which is
still not what the block is (a placeholder grammar, not runnable
Python or JS). Split each occurrence into a `text` fence for the
placeholder syntax and a standalone `lp` fence for the real example,
matching this repo's line-protocol fence convention. Also fixed the
several other `js`/`sh`-tagged blocks in the same two shared files
that are real, standalone line protocol (not templates) to use `lp`,
since they were failing codeblock lint as invalid JavaScript.

PR #5821 targeted content/influxdb/v2/reference/syntax/line-protocol.md,
which is now a stub whose body is sourced from
content/shared/influxdb-v2/reference/syntax/line-protocol.md; applied
its intent to the shared file instead.

Co-authored-by: MaximAL <almaximal@gmail.com>
What changed
- Add a Hugo lp render hook with field-family highlighting and safe malformed-input fallback.
- Add a blocking lp code-block validator and unit, extractor, CLI, and Cypress coverage.
- Document lp fence validation and regenerate instruction adapters.

Why
Line protocol examples need syntax-aware rendering and CI validation while preserving escaped source text.

Impact
The linter now fails invalid lp fences unless they explicitly use lint="false".

Verification
- yarn test:lint-codeblocks
- yarn test:render-regression
- yarn build:agent:instructions
- yarn validate:agent-instructions
@jstirnaman
jstirnaman force-pushed the fix/line-protocol-fence branch from e691ae2 to de35d65 Compare August 25, 2026 21:57
@jstirnaman
jstirnaman merged commit db1e0cc into master Aug 25, 2026
23 of 25 checks passed
@jstirnaman
jstirnaman deleted the fix/line-protocol-fence branch August 25, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:shared Shared content across products product:v1-enterprise InfluxDB Enterprise v1 product:v2-cloud InfluxDB Cloud (TSM) product:v2 InfluxDB v2 (Cloud TSM, OSS) product:v3-distributed InfluxDB 3 Cloud Serverless, Cloud Dedicated, Clustered product:v3-monolith InfluxDB 3 Core and Enterprise (single-node / clusterable)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants