feat(markdown): add enhanced code blocks with syntax highlighting
- Add codeblock.go for custom Goldmark renderer - Add code block header with language icon, filename, copy button - Use Chroma for syntax highlighting with class-based output - Add GenerateChromaCSS for theme CSS generation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6e2959f619
commit
771ff7615a
4 changed files with 323 additions and 4 deletions
|
|
@ -6,7 +6,6 @@ import (
|
|||
|
||||
"github.com/yuin/goldmark"
|
||||
emoji "github.com/yuin/goldmark-emoji"
|
||||
highlighting "github.com/yuin/goldmark-highlighting/v2"
|
||||
"github.com/yuin/goldmark/extension"
|
||||
"github.com/yuin/goldmark/parser"
|
||||
"github.com/yuin/goldmark/renderer/html"
|
||||
|
|
@ -41,9 +40,7 @@ func getRenderer(codeTheme string) goldmark.Markdown {
|
|||
extension.GFM,
|
||||
extension.Typographer,
|
||||
emoji.Emoji,
|
||||
highlighting.NewHighlighting(
|
||||
highlighting.WithStyle(codeTheme),
|
||||
),
|
||||
NewCodeBlockExtension(codeTheme),
|
||||
),
|
||||
goldmark.WithParserOptions(
|
||||
parser.WithAutoHeadingID(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue