Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the first slide convertible into image #68

Merged
merged 16 commits into from
Feb 2, 2019
Merged

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Feb 1, 2019

Make the first slide convertible into PNG and JPEG image by Puppeteer.

# Convert the first slide into PNG image
marp slide-deck.md --image png
marp slide-deck.md -o slide.png

# Convert the first slide into JPEG image
marp slide-deck.md --image jpeg
marp slide-deck.md --image jpg
marp slide-deck.md -o slide.jpg

It would be useful for creating Open Graph image that can specify with image global directive and --og-image option. This purpose is very similar to mdx-deck's screenshot command.

You might think to want to convert from the whole of slide deck into multiple images, like decktape's --screenshots option. We have to refactor the conversion logic to support outputting multiple files in order to realize that. So it is not yet supported in this PR.

ToDo

  • Add tests
  • Update README.md

@yhatt
Copy link
Member Author

yhatt commented Feb 1, 2019

We filled tests about images.

When you are using macOS with Hi-DPI environment like Retina display, the output image converted via stable Chrome 72 would be cropped by a half resolution, and only remaining the left upper area. This bug is already fixed in Chrome Canary 74, so we have to mention this in the documentation.

Stable Chrome (72) Chrome Canary (74)
marp-cli marp-cli-canary

@yhatt yhatt changed the title [WIP] Convert the first slide into image [WIP] Make the first slide convertible into image Feb 1, 2019
@yhatt yhatt changed the title [WIP] Make the first slide convertible into image Make the first slide convertible into image Feb 1, 2019
@yhatt yhatt merged commit 6786e57 into master Feb 2, 2019
@yhatt yhatt deleted the convert-to-image branch February 2, 2019 01:03
@yhatt yhatt mentioned this pull request Feb 4, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant