Skip to content

Apply common build logic to a slideshow project using Pandoc and reveal.js

License

Notifications You must be signed in to change notification settings

m2ci-msp/gradle-pandoc-reveal-plugin

Repository files navigation

CI License: Apache-2.0

Gradle Pandoc reveal.js plugin

Gradle plugin to apply common build logic to a slideshow project. Compilation from Markdown to HTML5 using Pandoc and reveal.js.

Prerequisites

Java must be installed.

This plugin requires Gradle v6.2 or higher.

Usage

See here for usage instructions.

When applying the plugin, the compileReveal task must be configured with a valid markdown source file:

compileReveal {
  markdownFile = file('src/source.md')

  // optionally, YAML header in separate file:
  headerFile = file('src/header.yaml')

  // optionally, additional assets:
  assetFiles = files('some/asset.txt', tasks.findByName('assetProducingTask')) +
    fileTree('src').include('assets/**')

  // optionally, enable ToC and maybe set depth (default: 1)
  tableOfContents = true
  tableOfContentsDepth = 2
  // note that the ToC title heading will be empty; set `toc-title` to the desired heading in the YAML header file...

  // optionally, filters and/or environment variables for Pandoc exec, e.g.,:
  pandocFilters = ['mermaid-filter']
  pandocEnvironment = ['MERMAID_FILTER_FORMAT': 'svg']
}

Note that Pandoc filters such as mermaid-filter must be installed separately.

The generated slideshow will be created in compileReveal.destDir (default: layout.buildDirectory.dir('slides'))