feat(renderer): render mermaid diagrams and box callouts/code blocks#49
Merged
Conversation
Fix unwired lang-clojure/lang-toml feature flags and add YAML, Ruby, PHP, Lua, Kotlin, Scala, Make, SQL, and Dockerfile support. Several tree-sitter grammar crates were swapped for actively-maintained forks (tree-sitter-toml-ng, tree-sitter-sequel, tree-sitter-containerfile, tree-sitter-kotlin-ng) since the originals pin an incompatible tree-sitter version. Kotlin's highlight query is vendored locally since tree-sitter-kotlin-ng doesn't publish one.
- Add a best-effort ASCII-art renderer for simple mermaid graph/flowchart blocks (nodes, shapes, labeled edges), with a safe layered layout that never stalls on cycles and falls back to a plain code block for unsupported diagram types. - Render GitHub-style callouts and fenced code blocks as closed, word-wrapped boxes instead of open dashes/backticks. - Replace the circled-digit heading markers (①②③) with a repeated ▶ marker, since circled digits render illegibly small in many monospace fonts. - Fix width/alignment bugs across headings, tables, and callouts: box and padding math used raw char counts, which undercounts emoji (💡❗🔥) and CJK text and gets thrown off by embedded OSC 8 hyperlink escapes. Introduce a visible_width() helper (backed by unicode-width) used everywhere boxes are drawn. - Fix the CLI's -H/--header-highlight flag, which had inverted semantics versus its own help text and the library default, so full-width header highlighting was silently off unless passed.
Document the expanded language list and mermaid rendering, and refresh the demo content/gif to showcase boxed callouts, a syntax-highlighted code block, and a mermaid flowchart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.