You will need cargo in order to build the maxdown command-line tool.
In case you are using Homebrew, it should be as easy as brew install rust.
If you use vim-plug, add this line to your Vim configuration file:
Plug 'pmeinhardt/maxdown', {'do': ':MaxdownCompile'}If you have a different way of managing your Vim plugins, make sure you add the project directory to your runtimepath and build the command-line tool:
cargo build --release --lockedOr from within Vim:
:MaxdownCompile
The plugin does not define any mappings by default. You can invoke :MaxdownPreview from within a Markdown buffer or define a custom mapping.
For instance:
autocmd FileType markdown nnoremap <buffer> <localleader>m <Plug>MaxdownPreviewThis will create a normal-mode mapping to preview the current markdown buffer.
When the ql Vim plugin is loaded, previews on macOS will look more neat (no [DEBUG] in the title):
Plug 'pmeinhardt/ql', {'do': ':QuickLookCompile'}To compile to WebAssembly, use wasm-pack:
wasm-pack build <options> -- --features wasmE.g. to build the web preview app, run:
wasm-pack build --target web -- --features wasm
cd web && python3 -m http.server 3000Then:
open "http://localhost:3000/?src=https://raw.githubusercontent.com/pmeinhardt/maxdown/main/README.md"- markdown-rs: https://github.com/wooorm/markdown-rs
- github-markdown-css: https://github.com/sindresorhus/github-markdown-css