-
If so, which technology should I use? |
Beta Was this translation helpful? Give feedback.
Answered by
yhatt
Jul 28, 2024
Replies: 1 comment 1 reply
-
Marp CLI has been designed for server side JavaScript runtimes such as Node.js, and you cannot use CLI in the client-side JavaScript (on the web browser). You can use Marp Core to convert Markdown into HTML on the client JS. Probably you may have to bundle the package to target for web browsers, by using JavaScript bundler (e.g. Webpack, Vite, etc). Implementing perfect conversion for PDF, PPTX, and other formats on only client JavaScript is extremely difficult, because Marp CLI is depending on Puppeteer (provides API for controlling browser process itself). |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
yhatt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Marp CLI has been designed for server side JavaScript runtimes such as Node.js, and you cannot use CLI in the client-side JavaScript (on the web browser).
You can use Marp Core to convert Markdown into HTML on the client JS. Probably you may have to bundle the package to target for web browsers, by using JavaScript bundler (e.g. Webpack, Vite, etc).
Implementing perfect conversion for PDF, PPTX, and other formats on only client JavaScript is extremely difficult, because Marp CLI is depending on Puppeteer (provides API for controlling browser process itself).