marp-team / marp-vscode

Marp for VS Code: Create slide deck written in Marp Markdown on VS Code
https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode
MIT License
1.55k stars 72 forks source link

Cannot export any types of slide files on marp-vscode working on vscode.dev or vscode server #452

Closed CodeNobu closed 1 month ago

CodeNobu commented 5 months ago

This is just an idea for future works for marp-vscode.

On my usecases, marp-vscode works on vscode.dev or vscode server. Unfortunately, current marp-vscode does not support exporting any slide files in pdf or pptx as well as html on vscode.dev or vscode server.

Not a few users might hope that marp-vscode can fully work on vscode.dev or vocode server because on those cases users are not limited to OS and deployment enviroments.

yhatt commented 5 months ago

VS Code Server already supports the export command, including PDF and PPTX. If installed Marp for VS Code as a workspace extension, the export can run through the tunneled vscode.dev web interface. Exporting some formats requires to install Chrome/Chromium into the server environment.

If installed Marp for VS Code as a web extension, that's easier said than done. To export into PDF, PPTX, and more format, the web extension must be able to run the full browser process inside the web page (not a browser that the user is opening vscode.dev). So the implementation may become too complex compared to the value or importance of the feature.

Investigations

CodeNobu commented 5 months ago

yhatt様

英語運用能力の都合上、日本語を併記して返信いたします。 ご丁寧に回答下さりありがとうございます。 ご助言いただきましたように、vscode server側に拡張機能としてmarp for vscodeをインストールをしていることを確認したうえで、かつ、marp for vacodeの設定からブラウザの絶対パスを指定(私の環境ではEdge)したところ、クライアントのブラウザからhttp://xxxxx(ローカルアドレス):8000でアクセスした環境であってもpdfでの出力ができることを確認できました。ありがとうございました。 ただ、クライアント側からvscodeのプレビューウィンドウを使ってスライドのプレビュー表示をすることは出来ておりません。これはセキュリティの使用上やむを得ないのでしょうか?

Due to my English ability, I will reply in Japanese. Thank you very much for your kind reply. As you suggested, after confirming that marp for vscode is installed as an extension on the vscode server side, and specifying the absolute path of the browser from the marp for vscode's settings (Edge in my environment), resulting in on the client side I was able to confirm that the output as a pdf is possibly generated on the server side storage even when accessed from a client's browser using http://xxxxx(local address):8000. However, we are not able to display a preview of the slides from the client side using the vscode preview window. Is this unavoidable for security use?

yhatt commented 5 months ago

Based on your description, it seems you are using code serve-web to launch VS Code Server, but in my environment, I can properly preview Markdown by following steps:

  1. Execute code serve-web to start the VS Code Server
  2. Access to the displayed URL http://127.0.0.1:8080?tkn=... by the browser
  3. Create a new Markdown file
  4. Open the Markdown preview in VS Code

Could you share more detailed steps or examples to reproduce your issue?

yhatt commented 1 month ago

It seems to be resolved the original issue so I'll close for housekeeping 🧹✨