Summary
Two related improvements to fenced code blocks that authors commonly expect from modern doc tools:
- Filename/title annotation —
```go title="main.go" renders a filename label above the block
- Line highlighting —
```go {3,5-8} highlights specific lines to draw attention
Proposed behaviour
Filename title
```go title="cmd/root.go"
package main
```
Renders a label bar above the code block showing the filename.
Line highlighting
```go {2,4-6}
line 1
line 2 ← highlighted
line 3
line 4 ← highlighted
line 5 ← highlighted
line 6 ← highlighted
```
Implementation notes
- Both are implemented as a custom goldmark code block renderer (extending the existing Chroma integration in
internal/parser/highlight.go)
- Parse extra attributes from the opening fence info string
- Title: inject a
<div class="code-title"> before the <pre> block
- Line highlighting: wrap highlighted lines in
<span class="highlight-line">, style with CSS
- No new dependencies needed
Summary
Two related improvements to fenced code blocks that authors commonly expect from modern doc tools:
```go title="main.go"renders a filename label above the block```go {3,5-8}highlights specific lines to draw attentionProposed behaviour
Filename title
Renders a label bar above the code block showing the filename.
Line highlighting
Implementation notes
internal/parser/highlight.go)<div class="code-title">before the<pre>block<span class="highlight-line">, style with CSS