MPLS VSCode Client
March 23, 2025 ยท View on GitHub
A VSCode extension for the Markdown Preview Language Server (MPLS).
Features
- Connects to the Markdown Preview Language Server (
mpls) - Enables emoji support (via
--enable-emojiflag) - Enables footnotes support (via
--enable-footnotesflag) - Open Preview Command: Adds a command to open the Markdown preview
- Smart Server Management: Automatically shuts down the server when no Markdown files are open, and restarts it when needed
- Focus Tracking: Notifies the language server when you switch between Markdown files
Prerequisites
- MPLS (Markdown Preview Language Server) executable installed and available in your PATH
Installation
-
Clone the repository
git clone https://github.com/mhersson/mpls-vscode-client.git cd mpls-vscode-client -
Install dependencies and build
npm install npm run compile -
Create and install the VSIX package
npm install -g @vscode/vsce vsce package code --install-extension mpls-vscode-client-0.1.0.vsixor copy the directory to your VS Code extensions folder
- Windows:
%USERPROFILE%\.vscode\extensions - macOS/Linux:
~/.vscode/extensions
- Windows:
-
Restart VS Code
Usage
- Open any Markdown file in VSCode
- The MPLS server will start automatically
- To open the preview, use one of these methods:
- Click the preview button in the editor title area
- Open the command palette (Ctrl+Shift+P) and run "MPLS: Open Preview"
The server will automatically shut down when all Markdown files are closed and restart when needed.
Configuration
You can customize the extension behavior in VS Code settings:
// Path to the MPLS executable (if not in PATH)
"mpls.executablePath": "/path/to/your/mpls",
// Command arguments passed to mpls at startup
"mpls.optionalArguments": ["--no-auto", "--enable-emoji", "--enable-footnotes"]
// Whether to shut down the server when all Markdown files are closed
"mpls.shutdownWhenAllClosed": true
Troubleshooting
If you encounter issues:
- Check the Output panel in VSCode (View > Output) and select "MPLS - Markdown Preview Language Server" from the dropdown
- Verify that your
mplsexecutable is in your PATH or correctly configured in settings