Skip to content

Use properties lexer for Scala Steward HOCON snippets#12

Merged
mprpic merged 1 commit into
mprpic:mainfrom
kubukoz:scala-steward-syntax-highlight
May 29, 2026
Merged

Use properties lexer for Scala Steward HOCON snippets#12
mprpic merged 1 commit into
mprpic:mainfrom
kubukoz:scala-steward-syntax-highlight

Conversation

@kubukoz
Copy link
Copy Markdown
Contributor

@kubukoz kubukoz commented May 29, 2026

Summary

  • The Scala Steward config blocks (added in Add Scala Steward cooldown documentation #9) were tagged ```hocon, but Pygments has no HOCON lexer, so they fell back to plain language-text with no highlighting.
  • Switching the fence to ```properties gives the closest available highlighting (key, =, quoted strings) without needing a custom lexer.
  • Properties is line-based and won't visually distinguish {/}/[/] as structural braces, but it's a clear improvement over no highlighting.

Test plan

  • uv run --with zensical zensical build succeeds
  • Built site/index.html shows language-properties with Pygments token spans on the Scala Steward blocks
  • diff <(sed '1,/^---$/d' docs/index.md) README.md is clean (files in sync)

🤖 Generated with Claude Code

Pygments has no HOCON lexer, so the blocks rendered as plain text. The
properties lexer is the closest fit (key = value, quoted strings) and
gives reasonable highlighting without a custom lexer.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@kubukoz
Copy link
Copy Markdown
Contributor Author

kubukoz commented May 29, 2026

In the meantime, I'll see if I can submit HOCON support to Pygments...

pygments/pygments#3148

Copy link
Copy Markdown
Owner

@mprpic mprpic left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix!

@mprpic mprpic merged commit d84eb8f into mprpic:main May 29, 2026
3 checks passed
@kubukoz kubukoz deleted the scala-steward-syntax-highlight branch May 29, 2026 20:25
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