Convert Figma logo to code with AI

webpro logoreveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file

3,699
416
3,699
19

Top Related Projects

67,545

The HTML Presentation Framework

12,681

A simple, in-browser, markdown-driven slideshow tool.

11,331

♠️ React MDX-based presentation decks

32,981

A markdown parser and compiler. Built for speed.

7,595

The entrance repository of Markdown presentation ecosystem

Quick Overview

Reveal-md is a tool that allows you to create and serve Markdown-based presentations using the Reveal.js framework. It simplifies the process of creating beautiful, interactive slideshows by leveraging the power of Markdown syntax and the features of Reveal.js.

Pros

  • Easy to use: Write presentations in Markdown, which is simpler than HTML
  • Customizable: Supports Reveal.js themes and configuration options
  • Live preview: Includes a server with live reload for easy development
  • Export options: Can export presentations to static HTML or PDF

Cons

  • Limited layout control: Complex layouts may require custom HTML/CSS
  • Learning curve: Users need to understand Markdown and some Reveal.js concepts
  • Dependency on Reveal.js: Changes in Reveal.js may affect functionality

Code Examples

  1. Basic slide creation:
# Title Slide

---

## Second Slide

- Bullet point 1
- Bullet point 2

---

## Third Slide

  1. Adding speaker notes:
## Slide with Notes

This is visible on the slide.

Note: This is only visible in speaker view.
  1. Using vertical slides:
## Main Slide

----

### Vertical Slide 1

----

### Vertical Slide 2

Getting Started

  1. Install reveal-md:

    npm install -g reveal-md
    
  2. Create a Markdown file (e.g., presentation.md) with your slides.

  3. Run the presentation:

    reveal-md presentation.md
    
  4. Open a browser and go to http://localhost:1948 to view your presentation.

Competitor Comparisons

67,545

The HTML Presentation Framework

Pros of reveal.js

  • More customizable and flexible for advanced users
  • Extensive plugin ecosystem for additional features
  • Better suited for complex presentations with custom layouts

Cons of reveal.js

  • Steeper learning curve, especially for non-technical users
  • Requires more manual setup and configuration

Code Comparison

reveal.js:

<div class="reveal">
  <div class="slides">
    <section>Slide 1</section>
    <section>Slide 2</section>
  </div>
</div>

reveal-md:

# Slide 1

---

# Slide 2

Key Differences

  • reveal.js uses HTML structure for slides, while reveal-md uses Markdown
  • reveal-md simplifies the process of creating presentations, making it more accessible for beginners
  • reveal.js offers more granular control over slide layout and design
  • reveal-md focuses on content creation with minimal setup, ideal for quick presentations
  • reveal.js is better suited for complex, highly customized presentations
  • reveal-md excels in simplicity and ease of use, especially for those familiar with Markdown

Both projects are based on the reveal.js framework, with reveal-md serving as a wrapper that simplifies the creation process using Markdown syntax. The choice between the two depends on the user's needs, technical expertise, and desired level of customization.

12,681

A simple, in-browser, markdown-driven slideshow tool.

Pros of remark

  • More lightweight and focused solely on Markdown-to-slideshow conversion
  • Offers a simpler API for customization and extension
  • Provides a browser-based live preview mode

Cons of remark

  • Less feature-rich out of the box compared to reveal-md
  • Requires more manual setup for advanced features
  • Limited built-in themes and styling options

Code Comparison

reveal-md:

const revealMd = require('reveal-md');

revealMd('slides.md', {
  theme: 'black',
  highlightTheme: 'monokai'
});

remark:

const remark = require('remark');
const html = require('remark-html');

remark()
  .use(html)
  .process('# Your Markdown Here', (err, file) => console.log(String(file)));

Both projects aim to convert Markdown to slideshows, but they differ in approach and features. reveal-md is built on top of the popular Reveal.js library, offering a more comprehensive set of features and styling options out of the box. It's ideal for users who want a quick setup with minimal configuration.

remark, on the other hand, is more lightweight and focused. It provides a simpler API for customization, making it a good choice for developers who want more control over the conversion process and are willing to implement additional features themselves.

While reveal-md offers a CLI tool for easy usage, remark is primarily used as a library in JavaScript projects. The choice between the two depends on the specific needs of the project and the level of customization required.

11,331

♠️ React MDX-based presentation decks

Pros of mdx-deck

  • Supports React components and JSX syntax in slides
  • Offers a more flexible and customizable presentation structure
  • Provides a development environment with hot reloading

Cons of mdx-deck

  • Steeper learning curve for users unfamiliar with React
  • Requires more setup and configuration compared to reveal-md
  • Limited built-in themes and styling options

Code Comparison

reveal-md:

# Slide 1
Content for slide 1

---

# Slide 2
Content for slide 2

mdx-deck:

import { Head, Notes } from 'mdx-deck'

# Slide 1
Content for slide 1

---

<Head>
  <title>My Presentation</title>
</Head>

# Slide 2
Content for slide 2

<Notes>Speaker notes for slide 2</Notes>

The code comparison shows that reveal-md uses a simpler Markdown syntax for creating slides, while mdx-deck allows for more complex structures and React components within the presentation. mdx-deck's approach offers greater flexibility but requires more familiarity with React and JSX.

Both tools serve the purpose of creating presentations from Markdown files, but they cater to different user preferences and skill levels. reveal-md is more straightforward for users who prefer pure Markdown, while mdx-deck is better suited for developers comfortable with React and seeking more advanced customization options.

32,981

A markdown parser and compiler. Built for speed.

Pros of marked

  • More versatile: Can be used for general Markdown parsing and rendering, not limited to presentations
  • Highly customizable: Offers extensive options for parsing and rendering Markdown
  • Lightweight and fast: Designed for efficiency and performance

Cons of marked

  • No built-in presentation features: Requires additional tools or frameworks for creating slideshows
  • Less opinionated: May require more setup and configuration for specific use cases

Code comparison

marked:

import { marked } from 'marked';

const html = marked.parse('# Heading\n\nSome **bold** text.');
console.log(html);

reveal-md:

import revealMd from 'reveal-md';

revealMd('slides.md', {
  theme: 'black',
  highlightTheme: 'monokai'
});

Key differences

  • Purpose: marked is a general-purpose Markdown parser, while reveal-md is specifically for creating presentations
  • Functionality: reveal-md includes features for slideshows and presentations out of the box
  • Ease of use: reveal-md is more straightforward for creating presentations, while marked requires additional setup for similar functionality
  • Flexibility: marked offers more control over Markdown parsing and rendering, but reveal-md provides a simpler solution for presentations
7,595

The entrance repository of Markdown presentation ecosystem

Pros of Marp

  • Supports multiple output formats (HTML, PDF, PPTX)
  • Offers a live preview feature for real-time editing
  • Provides a CLI tool for easy conversion and presentation

Cons of Marp

  • Less customization options compared to reveal-md
  • Smaller community and ecosystem
  • Limited animation and transition effects

Code Comparison

Marp:

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

# Slide 1
Content for slide 1

---

# Slide 2
Content for slide 2

reveal-md:

# Slide 1
Content for slide 1

---

# Slide 2
Content for slide 2

Key Differences

  • Marp uses YAML front matter for configuration, while reveal-md relies on command-line options or separate configuration files
  • Marp's syntax is more opinionated, with specific directives for themes and layouts
  • reveal-md offers more flexibility in terms of customization and plugin support

Use Cases

  • Marp: Quick and simple presentations with minimal setup
  • reveal-md: More complex presentations requiring advanced features and customization

Community and Support

  • reveal-md has a larger user base and more active development
  • Marp has a dedicated team but a smaller community

Performance

  • Both tools are lightweight and perform well for most use cases
  • reveal-md may have a slight edge for larger presentations due to its modular architecture

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from Markdown files.

Installation

npm install -g reveal-md

Usage

reveal-md slides.md

This starts a local server and opens any Markdown file as a reveal.js presentation in the default browser.

Docker

You can use Docker to run this tool without needing Node.js installed on your machine. Run the public Docker image, providing your markdown slides as a volume. A few examples:

docker run --rm -p 1948:1948 -v <path-to-your-slides>:/slides webpronl/reveal-md:latest
docker run --rm -p 1948:1948 -v <path-to-your-slides>:/slides webpronl/reveal-md:latest --help

The service is now running at http://localhost:1948.

To enable live reload in the container, port 35729 should be mapped as well:

docker run --rm -p 1948:1948 -p 35729:35729 -v <path-to-your-slides>:/slides webpronl/reveal-md:latest /slides --watch

Features

Markdown

The Markdown feature of reveal.js is awesome, and has an easy (and configurable) syntax to separate slides. Use three dashes surrounded by two blank lines (\n---\n). Example:

# Title

- Point 1
- Point 2

---

## Second slide

> Best quote ever.

Note: speaker notes FTW!

Code section

Syntax highlighting
```js
console.log('Hello world!');
```
Highlight some lines

You can highlight one line, multiple lines or both.

```python [1|3-6]
n = 0
while n < 10:
  if n % 2 == 0:
    print(f"{n} is even")
  else:
    print(f"{n} is odd")
  n += 1
```

Theme

Override theme (default: black):

reveal-md slides.md --theme solarized

See available themes.

Override reveal theme with a custom one. In this example, the file is at ./theme/my-custom.css:

reveal-md slides.md --theme theme/my-custom.css

Override reveal theme with a remote one (use rawgit.com because the url must allow cross-site access):

reveal-md slides.md --theme https://rawgit.com/puzzle/pitc-revealjs-theme/master/theme/puzzle.css

Highlight Theme

Override highlight theme (default: zenburn):

reveal-md slides.md --highlight-theme github

See available themes.

Custom Slide Separators

Override slide separator (default: \n---\n):

reveal-md slides.md --separator "^\n\n\n"

Override vertical/nested slide separator (default: \n----\n):

reveal-md slides.md --vertical-separator "^\n\n"

Custom Slide Attributes

Use the reveal.js slide attributes functionality to add HTML attributes, e.g. custom backgrounds. Alternatively, add an HTML id attribute to a specific slide and style it with CSS.

Example: set the second slide to have a PNG image as background:

# slide1

This slide has no background image.

---

<!-- .slide: data-background="./image1.png" -->

# slide2

This one does!

reveal-md Options

Define options similar to command-line options in a reveal-md.json file that must be located at the root of the Markdown files. They'll be picked up automatically. Example:

{
  "separator": "^\n\n\n",
  "verticalSeparator": "^\n\n"
}

Reveal.js Options

Define Reveal.js options in a reveal.json file at the project root. They'll be picked up automatically. Example:

{
  "controls": true,
  "progress": true
}

Speaker Notes

Use the speaker notes feature by using a line starting with Note:.

YAML Front matter

Set Markdown (and reveal.js) options specific to a presentation with YAML front matter:

---
title: Foobar
separator: <!--s-->
verticalSeparator: <!--v-->
theme: solarized
revealOptions:
  transition: 'fade'
---

Foo

Note: test note

<!--s-->

# Bar

<!--v-->

Live Reload

Using -w option changes to markdown files will trigger the browser to reload and thus display the changed presentation without the user having to reload the browser.

reveal-md slides.md -w

Custom Scripts

Inject custom scripts into the page:

reveal-md slides.md --scripts script.js,another-script.js
  • Don't use absolute file paths, files should be in adjacent or descending folders.
  • Absolute URL's are allowed.

Custom CSS

Inject custom CSS into the page:

reveal-md slides.md --css style.css,another-style.css
  • Don't use absolute file paths, files should be in adjacent or descending folders.
  • Absolute URL's are allowed.

Custom Favicon

If the directory with the markdown files contains a favicon.ico file, it will automatically be used as a favicon instead of the default favicon.

Pre-process Markdown

reveal-md can be given a markdown preprocessor script via the --preprocessor (or -P) option. This can be useful to implement custom tweaks on the document format without having to dive into the guts of the Markdown parser.

For example, to have headers automatically create new slides, one could have the script preproc.js:

// headings trigger a new slide
// headings with a caret (e.g., '##^ foo`) trigger a new vertical slide
module.exports = (markdown, options) => {
  return new Promise((resolve, reject) => {
    return resolve(
      markdown
        .split('\n')
        .map((line, index) => {
          if (!/^#/.test(line) || index === 0) return line;
          const is_vertical = /#\^/.test(line);
          return (is_vertical ? '\n----\n\n' : '\n---\n\n') + line.replace('#^', '#');
        })
        .join('\n')
    );
  });
};

and use it like this

reveal-md --preprocessor ./preproc.js slides.md

Print to PDF

There are (at least) two options to export a deck to a PDF file.

1. Using Puppeteer

Create a (printable) PDF from the provided Markdown file:

reveal-md slides.md --print slides.pdf

The PDF is generated using Puppeteer. Alternatively, append ?view=print to the url from the command-line or in the browser (make sure to remove the #/ or #/1 hash). Then print the slides using the browser's (not the native) print dialog. This seems to work in Chrome.

By default, paper size is set to match options in your reveal.json file, falling back to a default value 960x700 pixels. To override this behaviour, you can pass custom dimensions or format in a command line option --print-size:

reveal-md slides.md --print slides.pdf --print-size 1024x768   # in pixels when no unit is given
reveal-md slides.md --print slides.pdf --print-size 210x297mm  # valid units are: px, in, cm, mm
reveal-md slides.md --print slides.pdf --print-size A4         # valid formats are: A0-6, Letter, Legal, Tabloid, Ledger

In case of an error, please try the following:

  • Analyze debug output, e.g. DEBUG=reveal-md reveal-md slides.md --print
  • See reveal-md help for Puppeteer arguments (puppeteer-launch-args and puppeteer-chromium-executable)
  • Use Docker & DeckTape:

2. Using Docker & DeckTape

The first method of printing does not currently work when running reveal-md in a Docker container, so it is recommended that you print with DeckTape instead. Using DeckTape may also resolve issues with the built-in printing method’s output.

To create a PDF of a presentation using reveal-md running on your localhost using the DeckTape Docker image, use the following command:

docker run --rm -t --net=host -v $OUTPUT_DIR:/slides astefanutti/decktape $URL $OUTPUT_FILENAME

Replace these variables:

  • $OUTPUT_DIR is the folder you want the PDF to be saved to.
  • $OUTPUT_FILENAME is the name of the PDF.
  • $URL is where the presentation can be accessed in your browser (without the ?view=print suffix). If you are not running reveal-md in Docker, you will need to replace localhost with the IP address of your computer.

For a full list of export options, please see the the DeckTape github, or run the Docker container with the -h flag.

Static Website

This will export the provided Markdown file into a stand-alone HTML website including scripts and stylesheets. The files are saved to the directory passed to the --static parameter (default: ./_static):

reveal-md slides.md --static _site

This should copy images along with the slides. Use --static-dirs to copy directories with other static assets to the target directory. Use a comma-separated list to copy multiple directories.

reveal-md slides.md --static --static-dirs=assets

Providing a directory will result in a stand-alone overview page with links to the presentations (similar to a directory listing):

reveal-md dir/ --static

By default, all *.md files in all subdirectories are included in the generated website. Provide a custom glob pattern using --glob to generate slides only from matching files:

reveal-md dir/ --static --glob '**/slides.md'

Additional --absolute-url and --featured-slide parameters could be used to generate OpenGraph metadata enabling more attractive rendering for slide deck links when shared in some social sites.

reveal-md slides.md --static _site --absolute-url https://example.com --featured-slide 5

Disable Auto-open Browser

To disable auto-opening the browser:

reveal-md slides.md --disable-auto-open

Directory Listing

Show (recursive) directory listing of Markdown files:

reveal-md dir/

Show directory listing of Markdown files in current directory:

reveal-md

Custom Port

Override port (default: 1948):

reveal-md slides.md --port 8888

Custom Template

Override reveal.js HTML template (default template):

reveal-md slides.md --template my-reveal-template.html

Override listing HTML template (default template):

reveal-md slides.md --listing-template my-listing-template.html

Scripts, Preprocessors and Plugins

Related Projects & Alternatives

  • Slides is a place for creating, presenting and sharing slide decks.
  • Sandstorm Hacker Slides is a simple app that combines Ace Editor and RevealJS.
  • Tools in the Plugins, Tools and Hardware section of Reveal.js.
  • Org-Reveal exports Org-mode contents to Reveal.js HTML presentation.
  • DeckTape is a high-quality PDF exporter for HTML5 presentation frameworks.
  • GitPitch generates slideshows from PITCHME.md found in hosted Git repos.

Articles About reveal-md

Thank You

Many thanks to all contributors!

License

MIT

NPM DownloadsLast 30 Days