mdpls: Markdown Preview Language Server

July 21, 2022 ยท View on GitHub

Markdown, please!

mdpls is a language server that provides a live HTML preview of your markdown in your browser.

mdpls is powered by aurelius, which also powers vim-markdown-composer.

Installation

mdpls requires stable Rust, which can easily be installed and updated via rustup.

cargo install --git https://github.com/euclio/mdpls

The mdpls binary will be installed to .cargo/bin in your home directory.

Usage

mdpls works with your favorite editor's LSP plugin. Consult your plugin's documentation for information on how to configure a new language server.

Like most language servers, mdpls operates over stdin and stdout.

Configuration

SettingTypeDescriptionDefault
markdown.preview.autobooleanOpen the markdown preview automatically.true
markdown.preview.browserarray or stringThe program and arguments to use for opening the preview window. If not specified, the user's default browser will be used. The preview URL will be appended to this program as an argument.None
markdown.preview.codeThemestringhighlight.js style to use for syntax highlighting in code blocks.github
markdown.preview.serveStaticbooleanServe static files like images (this should only be use with trusted documents)false
markdown.preview.rendererarray or stringThe program to use to render the markdown to html. If not specified, the builtin markdown renderer will be used.None

Commands

The language server also provides commands for interacting with the browser preview.

CommandDescription
Open PreviewOpens the markdown preview.