markdown-preview.nvim is now mdkite.nvim, and live-server.nvim is now kitehost.nvim (v2.0)
A while ago lervag pointed out (#34) that my markdown-preview.nvim has the same name as iamcco's much older markdown-preview.nvim. With both installed, lazy.nvim treats them as one plugin, and iamcco's buffer-local commands hide mine in markdown buffers. I said I'd rename it, so here it is, together with the server plugin it runs on, whose name was shared with other plugins too:
- markdown-preview.nvim is now mdkite.nvim: https://github.com/selimacerbas/mdkite.nvim
- live-server.nvim is now kitehost.nvim: https://github.com/selimacerbas/kitehost.nvim
Nothing breaks if you leave your config alone for now. GitHub redirects the old repo URLs, and the old require and commands keep working through 2.x. They print a deprecation warning once per session and go away in 3.0.
To switch, update the spec:
{
"selimacerbas/mdkite.nvim",
dependencies = { "selimacerbas/kitehost.nvim" },
opts = {},
}
require("markdown_preview") becomes require("mdkite"), and the commands are now one :MdKite with subcommands (:MdKite, :MdKite stop, :MdKite refresh, :MdKite toggle). kitehost works the same way: :KiteHost start, :KiteHost status, :KiteHost stop. After updating, :Lazy clean removes the old copies.
If you haven't used them: mdkite renders the whole buffer in your browser and updates as you type over Server-Sent Events, with scroll sync. Mermaid diagrams come out as SVGs you can zoom, pan and export, and math goes through KaTeX. It's Lua plus a page in your browser, so there's nothing to npm install.
kitehost is the piece some of you might want on its own. It's a small local web server for Neovim, written in pure Lua on vim.uv, with no Node or Python behind it. Run :KiteHost start on a file or folder (with Telescope installed you get a picker for the path and port), and the browser reloads every time you save. A stylesheet change is swapped in place without a full reload, and a folder with no index.html gets a directory listing. Starting again on the same port points the running server at the new path, so your open tab keeps working. It can also start on its own when you open an HTML file, and it can show running servers in your statusline. It binds to 127.0.0.1 by default; if you open it to your network, set a token. Other plugins can use it as a library too, which is how mdkite runs on top of it.
Other changes in 2.0:
- kitehost 2.0 is also a security release. It checks the Host header, so a DNS rebinding page can't read your local server, and it closes a few ways around the token on protected paths. The details are in the advisories on the repo, plus one on mdkite for an old CORS issue that was fixed in 1.10. mdkite 2.0 requires kitehost 2.0.
- kitehost now needs Neovim 0.10 or newer, like mdkite. On 0.8 or 0.9, pin kitehost v1.5.0, which keeps the old names. CI runs both on Linux, macOS and Windows.
- mdkite 2.1 previews dotted filetypes that have a markdown part (like
rzk.markdown) and adds afiletypesoption for things like quarto. Thanks to ddxtanx for the PR.
Coming up: separate previews per buffer (#33) and an offline mode for the browser assets. Bug reports and ideas are welcome on either repo, and thanks again to lervag for raising the name clash.
The new paragraph leads with what people would use kitehost for, a live-reloading local server for plain HTML and CSS work. The library angle comes last, since that matters mostly to plugin authors.