Using Marp over WSL (Windows Subsystem for Linux) #113
yhatt
announced in
Frequently Asked
Replies: 1 comment 1 reply
-
You don't need to set CHROME_PATh to a browser installed with WSL, you can use /mnt/c to access windows files and then access a browser installed in your computer. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you are trying to use Marp through WSL (Windows Subsystem for Linux), you might met some trouble.
I hope this post helps troubleshooting for WSL users, and feedbacks are welcome!
Summary
WSL1
For PDF/PPTX/image conversion, Marp over WSL1 will try to spawn Chrome (or Chromium-flavored browser Marp has supported) that has installed to Windows.
In the most case, your Windows has pre-installed the compatible Edge browser so no actions should need. 🙌
If you want to use Linux browser for some reason (e.g. render the text with fonts installed in Linux), you should specify a path to the browser binary manually.
WSL2
WSL2 is working with the virtualized environment unlike WSL1 and Windows and WSL Linux are not sharing local network. So Marp working on Linux cannot connect with the spawned browser in Windows.
Install a compatible browser into Linux
Follow https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps#install-google-chrome-for-linux to install Google Chrome into your Linux.
After install the browser, Marp just should work! 🙌
Turn on mirrored mode networking (Marp CLI v4 and later)
If you want to use Windows browser when converting, you have to set up WSL to use mirrored mode networking. Put
%USERPROFILE%\.wslconfig
as following:To apply changes, you may have to run
wsl --shutdown
and re-launch WSL. After than, Marp CLI on WSL 2 should be able to detect the browser from Windows automatically if there are no compatible browsers on Linux.Tips: Set the path to browser executable explicitly
Marp CLI
Set
--browser-path
option.Marp for VS Code + WSL extension
Open extension settings, and set the path to executable in "Markdown > Marp: Chrome Path" (
markdown.marp.chromePath
).Beta Was this translation helpful? Give feedback.
All reactions