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
💡 You can downgrade/upgrade WSL version for any Linux distribution at any time.
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 you should not need extra actions. 🙌
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.
Thus, WSL2 requires to install the compatible browser into your Linux.
Install browser to Linux (Chrome/Chromium/Edge)
The conversion process is only using "headless" Chrome, so no need to install any X server. Just installing a compatible Chromium-flavored browser should be OK.
If you're using Windows 11, following Linux GUI apps preview on WSL may be the easiest to install the compatible browser.
Set the path to browser executable
In WSL2, Marp CLI v1.5.1 and later will try to detect installed Chrome/Chromium in Linux, but you can specify the path to chromium-flavored browser manually if you met some trouble.
Marp CLI
Set
CHROME_PATH
env when running.You also can set the env beforehand via
export CHROME_PATH=xxx
of course. Setting up in a shell startup script such as.bashrc
may be useful.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