delphinus/md-render.nvim
À propos
A Markdown rendering engine for Neovim — rich formatting, tables, images, video, Mermaid diagrams
Design et médiasWhat you can do
- Markdown, fully rendered — inline formatting, tables, GitHub / Obsidian callouts, <details>, and code blocks highlighted by treesitter. Callouts, <details>, and truncated code blocks and tables fold and expand with <CR> or a click
- Images and video — PNG, JPEG, WebP, GIF, and MP4 / WebM / MOV, local or from the web, drawn inline with the Kitty graphics protocol
- Diagrams — Mermaid and PlantUML fences rendered as images
- Zoom — <CR> or a click on an image, a video, or a diagram enlarges it to fill the editor. A Mermaid diagram is drawn again at that size, so its text stays sharp
Progression mesurée des étoiles
- in 24h
- 0
- in 7 days
- +2
- in 15 days
- +4
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
Originalmd-render.nvim
A Markdown renderer for Neovim that runs entirely in the terminal. It shows a Markdown buffer — images, video, and diagrams included — in a floating window, a tab, a split beside the source, in place of the source, or as a less-like pager, and leaves the buffer you edit untouched.
Features
- Markdown, fully rendered — inline formatting, tables, GitHub / Obsidian callouts,
<details>, and code blocks highlighted by treesitter. Callouts,<details>, and truncated code blocks and tables fold and expand with<CR>or a click - Images and video — PNG, JPEG, WebP, GIF, and MP4 / WebM / MOV, local or from the web, drawn inline with the Kitty graphics protocol
- Diagrams — Mermaid and PlantUML fences rendered as images
- Zoom —
<CR>or a click on an image, a video, or a diagram enlarges it to fill the editor. A Mermaid diagram is drawn again at that size, so its text stays sharp - Links — click to open, hover to see the full URL, OSC 8 hyperlinks
- Japanese and other CJK text — JIS X 4051 line breaking, optional BudouX phrase breaking, and no stray spaces between joined lines
- Scaled headings (experimental, Kitty only) — headings drawn larger with the text sizing protocol
- Picker previews — for telescope.nvim and snacks.nvim
- Library API — use the rendering engine from your own plugin
https://github.com/user-attachments/assets/1ec8f1fc-bcbd-4333-8751-0372ff1bd73a
Requirements
- Neovim 0.12 or later
- For images and video: a terminal that supports the Kitty graphics protocol, such as WezTerm, Kitty, or Ghostty
- Optional:
ffmpeg(video, animated GIF),mmdc(Mermaid),plantuml(PlantUML),curl(web images), budoux.lua (CJK phrase breaking), nvim-web-devicons or mini.icons (icons). See:help md-render-dependencies
Installation
With lazy.nvim:
{
"delphinus/md-render.nvim",
version = "*",
dependencies = {
{ "nvim-tree/nvim-web-devicons", version = "*" }, -- optional
{ "delphinus/budoux.lua", version = "*" }, -- optional
},
keys = {
{ "<leader>mp", "<Plug>(md-render-preview)", desc = "Markdown preview (toggle)" },
{ "<leader>mt", "<Plug>(md-render-preview-tab)", desc = "Markdown preview in tab (toggle)" },
},
}
The plugin sets no key mappings of its own. For vim.pack and mini.deps, see :help md-render-installation.
Quick start
To see every feature, open the showcase bundled with the plugin in the pager, or run :MdRender demo:
git clone https://github.com/delphinus/md-render.nvim
nvim +"MdRender pager" md-render.nvim/assets/showcase.md
| Command | Shows the current Markdown buffer |
|---|---|
:MdRender |
in a floating window |
:MdRender tab |
in a new tab |
:MdRender split |
in a split beside the source; edits and the cursor follow live |
:MdRender toggle |
in place of the source, in the same window |
:MdRender pager |
full screen; q quits Neovim |
In a preview:
| Key | Action |
|---|---|
<CR> |
Enlarge the image, or fold / expand the block, under the cursor |
| click | Enlarge an image, fold / expand a block, or open a link |
za |
Fold / expand the block under the cursor |
q / <Esc> |
Close the floating window or tab |
Documentation
Everything else is in the help: all commands and options, rendering width, the experimental features, picker integration, the Lua API, highlight groups, and troubleshooting.
:help md-render.txt(doc/md-render.txt)- Japanese:
:help md-render.jax(doc/md-render.jax)
Development
make test runs the tests. See tests/README.md for the other test layers.
License
MIT — see LICENSE.
lua/md-render/vendor/ is third-party code kept verbatim under its own license:
a copy of Neovim's vim.async (Apache-2.0), which gives Neovim 0.12 the async
runtime 0.13 has built in. See its README.
Explorer des projets similaires
Chargement…