Skip to content

v0.9.0 — Native Markdown Rendering

Latest

Choose a tag to compare

@cmorales95 cmorales95 released this 23 Feb 05:13
· 1 commit to main since this release

Highlights

This release replaces the treesitter injection + render-markdown.nvim approach with a native rendering engine built entirely on Neovim's overlay extmarks. This eliminates the column-gap artifacts on code cells caused by Neovim 0.11's injection.combined bounding-box bug.

Markdown Cell Rendering

  • Headings (H1–H6) with nerd-font icons (󰎤 󰎧 󰎪 ...) and treesitter heading highlight colors
  • Bold (**text**), italic (*text*), bold italic (***text***), and inline code (`text`) — markers are stripped, content is styled
  • Tables with full box-drawing borders (┌┬┐, ├┼┤, └┴┘), auto-sized columns computed from max content width across all rows
  • Fenced code blocks (```python) with treesitter syntax highlighting — code is parsed with vim.treesitter.get_string_parser() and rendered with proper language colors
  • Cell borders (top/bottom virtual lines) and # prefix hiding via overlay

Code Cell Rendering

  • Clean rendering with no visual artifacts — no column gap, no stale markdown decorations
  • Cell borders and marker concealment via overlay
  • Full Python syntax highlighting from the native treesitter parser

Technical Changes

  • render_markdown config defaults to false — the treesitter injection is now optional
  • All visual hiding uses virt_text_pos = "overlay" instead of conceallevel — no conflicts with other plugins
  • Multi-pass rendering in render_md_body(): classify → syntax highlight → table alignment → render
  • Language aliases for code blocks: py→python, js→javascript, ts→typescript, rb→ruby, rs→rust, sh→bash, etc.

New Highlight Groups

All customizable with vim.api.nvim_set_hl():

Group Default Purpose
JupytextBold { bold = true } Bold inline text
JupytextItalic { italic = true } Italic inline text
JupytextBoldItalic { bold = true, italic = true } Bold italic text
JupytextCode @markup.raw.markdown_inline Inline code
JupytextCodeBlock ColorColumn Fenced code block background
JupytextCodeFence Comment Code fence border lines