Giter VIP home page Giter VIP logo

marp-cli's Issues

Code block does not get rendered while starting a marp server with default theme

Hello, for some weird reason, my code block is no longer working in my browser. It was working a few weeks ago. Would you be able to give me some pointer?

My markdown presentation

---
marp: true
theme: default
---


# Normal

Welcome

---

# Code Block

` ` `js
// apologies for the triple backticks written as so, it's so that it can be previewed properly
console.log('hello');
` ` `

I run the following

npx @marp-team/marp-cli -s ./docs

and I got a blank code block like so

Screenshot from 2019-12-03 00-21-05

workarounds I have tried so far

  • Change theme to uncover and it works, however I can't use that theme because i need a sizeable realestate for my actual code block
  • run the cli with --html and add
<script defer src="https://cdn.jsdelivr.net/npm/@marp-team/marp-core/lib/browser.js"></script>

into the code block but it doesn't help

Thank you 🙏

Detect the title of deck from first slide when title option is not passed

It would be good to fill the title for converted HTML automatically from the heading of title slide when --title option (and title global directive) is not passed.

We make this plan from TODO comment in Marp CLI meta plugin.

// TODO: Add rule to fill meta from content of slide deck when directives are not defined.

The other similar tool also has a plan for auto-filling of the title: jxnblk/mdx-deck#103 (v3)

output html does not copy local assets

I use this command to convert a set of markdown files to html files:

marp --input-dir=./slides --output=./dist

However, local assets such as images and videos do not copy to dist directory. Is there possibility that marp could autodect referenced local assets and copy to dist directory?Just like what webpack do? Otherwise, I should manually copy that assets to dist.

PDF rendering has broken recently

I did a little work to narrow this down, but sometime after this commit 3fe441cf7a406416300735b0f5de4a6e48a6ff69 the PDF rendering started hanging (at least in the docker container). Building the Docker container from this commit, still works.

On HEAD, adding --pdf to the command line causes the container to just hang while rendering.

docker run --rm -v $PWD:/home/marp/app/ marpteam/marp-cli:latest target.md --theme-set spkane.css --pdf --allow-local-files
[  INFO ] Converting 1 markdown...
[  WARN ] Insecure local file accessing is enabled for conversion of target.pdf.

Building from an commit about a month or two older results in a working PDF render:

docker run --rm -v $PWD:/home/marp/app/ 46c6ff46a3d9 target.md --theme-set spkane.css --pdf --allow-local-files
[  INFO ] Converting 1 markdown...
[  WARN ] Insecure local file accessing is enabled for conversion of target.pdf.
[  INFO ] target.md => target.pdf

Watch mode does not work

When marp-cli was executed in watch mode, an error was output and stopped.
I use macOS Mojave (10.14.6)

% npx @marp-team/marp-cli -w slides.md 
[  INFO ] Converting 1 markdown...
[ ERROR ] Failed converting Markdown. (Provided options.stopPort(40000is less than options.startPort (52000))

Convert slide deck to PowerPoint (pptx) that consists of rendered images

By using officegen, we might convert from Marpit / Marp Markdown into PowerPoint slide that consists of pre-rendered images.

It's very useful for mixing a traditional presentation deck and the deck made by Marp. In addition, it could use PowerPoint's presenter tool with Marpit's presenter notes.

Exporting PowerPoint deck was mentioned in the old Marp app by yhatt/marp#23. We'll make it wake up.

I suppose it would have to start working after than implemented #71.

ToDo

  • Implement #71
  • Allow --pptx option and pptx extension in -o option (-o foobar.pptx)

⚠️ People would expect re-editable contents in converted pptx. But it's still super difficult to convert into them with keeping the exact slide design, and there is no solution in FLOSS.

Adobe Acrobat can convert the exported PDF into pptx that includes re-editable contents, and keeps the design to some extent.

Cannot change serif font in pdf output and vscode preview

Serif Chinese font isn't a good choice in slides, so I tried this, but font didn't change.

---
marp: true
theme: gaia
---
<style>
.slide {
  font-family: 'Microsoft YaHei', 'SimHei', sans-serif !important;
}
</style>

<!-- class: lead gaia -->
# 标题
## Title

I didn't try it with html output because html version without <style> worked well with a sans serif font.
So is there any way to change font without editing theme files?

btw Microsoft YaHei might not be a good default font because it is not a free font. Sarasa Gothic may be a good alternative.
screenshot

`--preview` option does not work in macOS Catalina

--preview option does not open Chrome window in macOS Catalina. Carlo seems to be failing a resolution of Chrome.

$ npx @marp-team/marp-cli ~/marp/deck.md --preview
[  INFO ] Converting 1 markdown...
[  INFO ] ../../../marp/deck.md => ../../../marp/deck.html
[  INFO ] [Watch mode] Start watching...
[  INFO ] [Preview] (EXPERIMENTAL) Opening file:///Users/yhatt/marp/deck.html...
^C(node:12987) UnhandledPromiseRejectionWarning: Error: Command failed: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump  | grep -i 'google chrome canary\?.app$' | awk '{$1=""; print $0}'
    at checkExecSyncError (child_process.js:629:11)
    at execSync (child_process.js:666:13)
    at darwin (/Users/yhatt/.npm/_npx/12987/lib/node_modules/@marp-team/marp-cli/node_modules/carlo/lib/find_chrome.js:33:7)
    at findChrome (/Users/yhatt/.npm/_npx/12987/lib/node_modules/@marp-team/marp-cli/node_modules/carlo/lib/find_chrome.js:222:24)
    at Object.launch (/Users/yhatt/.npm/_npx/12987/lib/node_modules/@marp-team/marp-cli/node_modules/carlo/lib/carlo.js:594:42)
    at Preview.<anonymous> (/Users/yhatt/.npm/_npx/12987/lib/node_modules/@marp-team/marp-cli/lib/marp-cli.js:1:40980)
    at Generator.next (<anonymous>)
    at /Users/yhatt/.npm/_npx/12987/lib/node_modules/@marp-team/marp-cli/lib/marp-cli.js:1:2090
    at new Promise (<anonymous>)
    at __awaiter (/Users/yhatt/.npm/_npx/12987/lib/node_modules/@marp-team/marp-cli/lib/marp-cli.js:1:1864)
(node:12987) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:12987) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

According to GoogleChrome/chrome-launcher#146 (comment), macOS Catalina was changed the output of lsregister but Carlo's Chrome finder is not following this (Carlo might be inactive: GoogleChromeLabs/carlo#163).

Fragmented list don’t export animations in PowerPoint

(I posted this in Marp VSCode but was told it belonged here instead)

When I used the Fragmented unordered list and export to PPTX, the "fragmented" / animation part doesn't work--that is, all the items appear at once. The fragmented effect works fine in HTML, but not in PPTX
Markdown example:

Title
* item 1
* item 2

My system
OS: Windows 10 Pro version 1803 (build 17134.885)
VSCode: 1.37.1
Marp extension: 0.9.0

Consider migration CI for Windows into GitHub Actions

Marp team's primary CI won't change from CircleCI, but I think a new bulit-in CI/CD for GitHub Actions is easier to maintain than Azure Pipelines, that is the current secondary CI for Marp team for running tests and builds in Windows environment.

In fact, GitHub Actions is using Azure Pipelines backend.

ToDo

  • Wait until enabled GitHub Actions for Marp team (-Nov, 13)
  • Set up GitHub Actions
    • Test in Windows environment
    • Create Windows binary via pkg
    • Upload packaged asset of standalone binary for Windows to GitHub release page

CircleCI has started supporting Windows environment too. It provides only to user of performance plan, and not yet provided free plan to OSS projects. We might re-migrate to CircleCI when Windows environment in CircleCI could use in OSS project in future.

Cannot find module 'twemoji.npm.js'

I had an error when convert my Markdown to HTML.

$ npx @marp-team/marp-cli KotlinUpdates.md
Cannot find module '/Users/yasuyuki/.npm/_npx/40753/lib/node_modules/@marp-team/marp-cli/node_modules/twemoji/dist/twemoji.npm.js'. Please verify that the package.json has a valid "main" entry

My markdown is here: https://github.com/eyasuyuki/KotlinUpdates

marp-cli with server and and preview option

On Linux (Ubuntu 18.04.), I am having some problems with the preview mode. Apparently, the program uses grep internally, resulting in some unwanted behavior, see CLI output below.

$ marp --server --preview ./MarpTest 
[  INFO ] [Server mode] Start server listened at http://localhost:8080/ ...
[  INFO ] [Preview] (EXPERIMENTAL) Opening http://localhost:8080...
grep: /XXX/XXX/.local/share/applications/zotero.desktop: No such file or directory
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:1022:11)
    at Pipe.onread (net.js:628:25)

During the installation, npm returns the following warning messages

/usr/local/bin/marp -> /usr/local/lib/node_modules/@marp-team/marp-cli/marp-cli.js
- [email protected] node_modules/@marp-team/marp-cli/node_modules/arrify
- markdown-it-katex node_modules/@marp-team/marp-cli/node_modules/markdown-it-katex
/usr/local/lib
└─┬ @marp-team/[email protected] 
  ├─┬ @marp-team/[email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├── @marp-team/[email protected] 
  ├─┬ [email protected]
  │ └── [email protected] 
  └─┬ [email protected] 
    ├─┬ [email protected] 
    │ └─┬ [email protected]
    │   └── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    └── [email protected] 

npm WARN optional Skipping failed optional dependency /@marp-team/marp-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]

Export PDF with presenter notes (Handouts)

Is there a way to export a PDF with Presenter Notes from VS Code?

This closed PR had a feature like it. Is exporting to PPT (via the CLI) the only way to get speaker notes to display?

"r.emulateMediaType is not a function" error when exporting images

I am running into an error when converting markdown into images using --image or --images flag. This can be reproduced with the following test.md file:

# Title

content

I am running marp-cli using the official Docker image:

$ docker run --rm -v $PWD:/build -w /build marpteam/marp-cli --image png test.md
[  INFO ] Converting 1 markdown...
[ ERROR ] Failed converting Markdown. (r.emulateMediaType is not a function)

Version:

$ docker run --rm marpteam/marp-cli --version
@marp-team/marp-cli v0.16.2 (w/ @marp-team/marp-core v0.15.2)

At the same time, conversion to PDF works fine.

The issue was not present in marpteam/marp-cli:v0.15.1 Docker image.

Failed to find `.md` file in non-ASCII directory

marp-cli failed to glob markdown files within non-ASCII directory. Thus marp --server . exits.

Way to reproduce

% grep marp-cli yarn.lock 
"@marp-team/marp-cli@^0.10.0":
  resolved "https://registry.yarnpkg.com/@marp-team/marp-cli/-/marp-cli-0.10.2.tgz#111be76a2df5f3c228f08dc3627eadbe23fbf3e8"

% pwd
/Users/seiya.yazaki/work/github.com/saiya/presentations/190913 RDBMS 実践
# ↑ It contains non-ASCII character in directory name

% ls *.md
-rw-r--r-- 1 seiya.yazaki staff 1.6K  6 24 15:07  slide.md

% yarn marp --server .
yarn run v1.17.0
$ '/Users/seiya.yazaki/work/github.com/saiya/presentations/190913 RDBMS 実践/node_modules/.bin/marp' --server .
Usage:
  marp [options] <files...>
  marp [options] -I <dir>

Basic Options:
  --version, -v      Show versions                                        [真偽]
  --help, -h         Show help                                            [真偽]
    .... snip ....

Expected result

yarn marp --server . should start server, not showing help.

Workaround

Use ASCII directory name:

% pwd
/Users/seiya.yazaki/work/github.com/saiya/presentations/190913 RDBMS Advanced

% ls *.md
-rw-r--r-- 1 seiya.yazaki staff 1.6K  6 24 15:07  slide.md

% yarn marp --server .
yarn run v1.17.0
$ '/Users/seiya.yazaki/work/github.com/saiya/presentations/190913 RDBMS Advanced/node_modules/.bin/marp' --server .
[  INFO ] [Server mode] Start server listened at http://localhost:8080/ ...

Navigate twice when hitting space bar after clicked next button on OSC

A focus ring will be kept on the clicked next button on OSC, so space bar brings unexpected twice navigation.

It is same for the other buttons. For example, slide cannot navigate with space bar after clicked previous button. Buttons for bespoke OSC plugin should not keep focus ring.

Generated PPTX is creating Master Slides, not Slides (as I was hoping)

The PPTX output is awesome, but I am having an issue with 2 features. If this is explained somewhere, can you please point me to it.

1- The generated slides are actually creating unique Master Slides and then the slide on the front end is using that Master Slide Template (for example, Slide 1 is using Master Slide 1 and Slide 2 is using Master Slide 2). I was hoping that it would generate a regular slide. There is probably a good reason for this. The secondary issue with this, is if we actually apply a Master Theme to the Slide Deck, the elements of the Master Theme sit on top of the text/table/etc generated by MARP.

  1. Somewhat related to number 1 (as in this is the PPTX generated content). The Slide contents are not editable after the fact. It is some sort of uneditable background image. Even on the Master Slide, I can't edit the contents. Is there a switch or something to output editable text. Going to reboot my machine to see if there is something just not acting right.

By the way, don't take this as negatives. I freaking love the project. Thank you for all of your effort.

Convert to HTML without list animation

Hello @yhatt,

Could it be possible to provide a flag to stop the one-by-one appearance of bullets/lists in html format? I basically want to have my entire list appear at once without having to press 'next' multiple times.

Thanks!

Preview Error: Unknown permission type: clipboardRead

Hi, I have trouble with marp. It works fine last week, but it throw errors as follows this week. Please help. Thanks.

My env info:
npm: 6.9.0
node: 10.16.0
marp-cli: @marp-team/marp-cli v0.16.2 (w/ @marp-team/marp-core v0.15.2)
browser: Chrome canary Version 81.0.3991.0 (Official Build) canary (64-bit)

npx @marp-team/marp-cli foo.md --preview
[  INFO ] Converting 1 markdown...
[  INFO ] foo.md => foo.html
[  INFO ] [Watch mode] Start watching...
[  INFO ] [Preview] (EXPERIMENTAL) Opening
          file:///Users/zhaozhiming/Documents/foo...
(node:36765) UnhandledPromiseRejectionWarning: Error: Protocol error (Browser.grantPermissions): Unknown permission type: clipboardRead
.......
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:36985) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:36985) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

marp-cli binary

V0.12.0: Program open the window and closed directly under windows10 (64)

`--engine ./engine.js` doesn't render code blocks well

I have the following files.

  • engine.js

    const { Marp } = require('@marp-team/marp-core');
    module.exports = opts => new Marp(opts);
    

    Note: I've also tested module.exports = opts => new Marp();, but there seems no difference.

  • sample.md

    # test
    
    ` ` ` <- We cannot use triple backquoations in clode blocks so I use ` ` ` here instead
    console.log('Hello World!');
    ` ` `
    
  • package.json

    ...
    "devDependencies": {
      "@marp-team/marp-cli": "0.14.1",
      "@marp-team/marp-core": "0.13.1",
      "@marp-team/marpit": "1.4.0",
    ...
    

When I use --engine @marp-team/marp-core, it works well.
Interestingly, when I use --engine ./engine.js, it doesn't render the code block well as follows.

image

Revert CSS hack for Chrome scaling

Now we have already enabled Chrome's BGPT feature in all conversions. (#176 (comment)) Probably removing CSS hack for scaling (#15) makes no problems.

translateZ hack might still cause the glitch at remaining space in scaled slide.

We would remove these hacks if Chrome became to generate property trees by default. Until then we have to choice between to allow glitch on Chrome or to force enabling Chrome option.

Originally posted by @yhatt in #15 (comment)


The same workaround is still applicable in glitched <video> tag on Chromium (marp-team/marpit#205 (comment)). We should apply this in Marpit framework.

Presenter view for HTML

Will there ever be an option to have a presenter view in the HTML slide show, or to have a “pen” to draw on the slides?

Sorry if this is in the wrong project again—let me know if there’s a better place.

Change port number for sending reload signal in watch mode

portfinder's breaking reported in #134 was an unexpected trouble, but it tells us to prevent using port number > 40000. That has a good reason exaplined at http-party/node-portfinder#82 (comment).

Marp CLI is using 52000 port resolved by portfinder. We think it would be deprecated soon. So we have to change the base port for sending signals.

ToDo

  • Change base port number for sending reload signal in watch mode to < 40000
  • Update description of Docker Hub to change binding port

Lose img via marp command

using following command

npx @marp-team/marp-cli slides.md -o slides.pdf

image could be successfully viewed in VS code with following syntax
img

after execute the command above, the pdf shows a img thumbnail instead of the image itself.

like this

image

but once you upload you image to some web host, it works, seems the problem here is Marp Cli doesn't support local images

Fallback to Microsoft Edge if not installed Chrome

Microsoft has started rolling out new Edge browser based on Chromium. It will gradually be made available on Windows Update.

This fact is lucky for Marp CLI. PDF/PPTX conversion and preview mode has to install an extra Chrome/Chromium browser. Currently, it also works with Edge by setting CHROME_PATH environment variable.

It means the most of Windows 10 user will get the compatible browser without to do anything by user. If Marp CLI was supported fallback to Edge, installing extra browser won't be needed when converting Markdown into PDF/PPTX.

Safari prevents moving slide after too many navigations

When presenting slide deck HTML in Safari, too many navigations per 30 seconds bring SecurityError.

[Error] SecurityError: Attempt to use history.replaceState() more than 100 times per 30.000000 seconds
	replaceState (yhatt-marp-cli-example.netlify.com:39:8347)
	(anonymous function) (yhatt-marp-cli-example.netlify.com:39:8347)
	(anonymous function) (yhatt-marp-cli-example.netlify.com:39:500)
	reduce
	s (yhatt-marp-cli-example.netlify.com:39:2575)
	(anonymous function) (yhatt-marp-cli-example.netlify.com:39:2664)
	(anonymous function) (yhatt-marp-cli-example.netlify.com:39:500)
	reduce
	u (yhatt-marp-cli-example.netlify.com:39:628)
	u
	(anonymous function) (yhatt-marp-cli-example.netlify.com:39:5580)

It's a restriction for security by Safari so we can only follow this. However, we can handle this error with wrapping by try to avoid prevention of remaining works.

Animated gifs aren't being exported to pptx

When I'm adding animated gif to my presentation like this:

---
<!--
_class:
-->

<style scoped>
section img{
    position: absolute;
    right: 0;
    bottom: 0;
}
</style>

![bg left:30% fit](images/VM.png)

# Django

- А где логика?

![](images/7VE.gif)

They are being displayed correctly in html, but not in PPTX/PDF, there they are just static images.

HTML not interpreted with CLI

I use HTML tags in my presentation to include an image and show it on the right side. Everything works fine while using the marp editor, but when I would like to build it with the CLI version, the HTML tags are not evaluated. Not in server or preview mode and not with allow-local-files and not with pdf or html output.

The pdf gets render correctly only when using the Export to pdf method in the marp editor itself.

Would be great if you could give me a hint. Here are some screenshots of the problem:

image
Marp editor with html tag

marp --pdf --allow-local-files Abstrakteklassen.md

Marp CLI build command

image
Rendered PDF

Output warning if detected blocking local resources while rendering by Chrome

I've received many feedbacks about rendering the local image file, "Image does not see on rendered PDF". In most cases, a cause is lacking --allow-local-files option.

Accessing the local content is often targeted as a vulnerability, so the user must express intention by the option. However, Marp CLI has not explained this while converting.

It's good to tell that it might lack --allow-local-files option if detected blocking access to the local file. Of course, we should keep in mind that it's just a hint and must keep not to recommend.

How to detect

We don't yet try for detection, but I wonder if Chrome outputs any warnings with its reason when blocked loading image. We should listen to Chrome error through Puppeteer, and detect local file access.

Can marpcli's server render user's local images?

Hello.
I'm ganariya who studies in Akita University.

I'd like to use marp-cli to make a slide by markdown.
And I tired to use image syntax

But, If I use

marp --html --server --watch --allow-local-files

above server funtion, image cannot reveal.

However, If I export pdf, I can see image on the pdf.

Can marp-cli's server render user's local images?

Thank you.

PDF renders do not include the mounted CSS themes or background images.

The current release no longer renders an external CSS theme properly. I am not sure when this broke, but I'd guess sometime in the last few months.

It is possible that Puppeter and Chromium are out of sync again in marp-cli, but the last time that happened the rendering completely hung. The initial time this happened was here: #73

--allow-local-files may not be accepted local files depending on the environment

It was reported in marp-team/marp-vscode#64. (marp-team/marp-vscode#64 (comment))

We cannot yet identify this cause. The following is a list of concerns that might be possible to be a cause.

  • The base URI of converting file specified by <base> HTML element would have wrong encoding
  • Something cannot parse special characters like spaces, parentheses, and so on (Similar to #95)
  • Marp CLI may fail handling on-demand files (DropBox, OneDrive, Google Drive etc)

Convert slide deck to multiple images

As I have been pointed out at #68, it is great to get converting the slide deck into multiple images. We want to provide the easiest way to create sequence images.

ToDo

  • Refactor Converter to support multiple output
  • Consider option to output sequence images (--images?)
  • Output only specified page(s) via --page option (In another PR)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.