Subcommands

List subcommands

Markdownreveal provides a couple of subcommands for convenience. If you want to list those commands, you can use the --help option:

markdownreveal --help

Show your presentation

If you want to visualize your presentation you need to use the subcommand show. This is the default when no subcommand is specified, which means that this:

markdownreveal presentation.md

Is equivalent to:

markdownreveal show presentation.md

This subcommand accepts options for changing the default host, port and configuring whether or not to display the warmup slide:

markdownreveal show --help

Share your presentation

If you want to share your presentation with somebody, or if you want to upload it to a server, you can use the zip subcommand:

markdownreveal zip presentation.md

This will create a ZIP file containing your presentation. Note that the presentation is a static webpage, so in order to view it you just need to open index.html with your web browser. You can also upload it to your own server if you prefer so.

GitHub pages

If you happen to be using GitHub to host your presentation code, then sharing could not be simpler. You can use the subcommand upload to upload your presentation to GitHub pages:

markdownreveal upload presentation.md

Warning

Note that executing this command will reset the branch gh-pages, so make sure your repository holds your presentation only or you are not using that branch.

Note

You can use the --remote option to change the default remote where the presentation will be uploaded to. See markdownreveal upload --help for more information.

Export to PDF

You can also export your presentation to PDF. To do so, however, you need Decktape or a Chromium/Chrome web browser.

Decktape

Decktape is a Node package, which you can install with:

npm install -g decktape

In order to export your presentation to PDF, use the pdf subcommand:

markdownreveal pdf presentation.md

You can use the --size option to change the default 16:9 aspect ratio. For example (for 4:3):

markdownreveal pdf --size 2048x1536 presentation.md

Warning

Use high-resolution sizes to avoid issues with the PDF layout. See https://github.com/astefanutti/decktape/issues/151 for more information.

Instead of the local Markdown file, you may also provide the URL where your presentation is being served (either the server where you uploaded it or the local server that is spawned when you run Markdownreveal locally and the presentation is opened in your browser).

markdownreveal pdf http://localhost:8123/

Markdownreveal will fetch the presentation from the URL and generate the PDF for you:

Chromium or Chrome

In order to use your web browser to create a PDF, you first need to load a special print stylesheet. To do so, include print-pdf in the query string (in example: http://localhost:8123/?print-pdf).

Then open the in-browser print dialog (CTRL + P) and configure the print settings:

  • Landscape
  • No margins
  • Enable background graphics

Clean local files

Markdownreveal downloads reveal.js and style files and saves them locally for future use. If you want to remove those files, you can make use of the clean subcommand:

markdownreveal clean