Lean Slides

Lean Slides is a tool to automatically generate reveal.js slides from Markdown comments in the Lean editor.

LeanSlides

See Demo.lean for more details.

Dependencies

Lean Slides works by combining together several tools:

Note that LeanSlides may have issues with older versions of pandoc. A manual intervention using

#set_pandoc_options "-V" "revealjs-url=\"https://unpkg.com/reveal.js@^4/\""

may fix the issues in such cases.

Usage

To use Lean Slides, first install all the dependencies listed above.

Lean Slides can be added to an existing Lean repository by inserting the following line in the lakefile:

require Ā«lean-slidesĀ» from git "https://github.com/0art0/lean-slides"@"master"

In any file that imports LeanSlides, type

#slides +draft Test /-!
  <Markdown text>
-/

Run lake run lean-slides/serve-slides from the command line to start the HTTP server for the slides.

Any slides that are not in draft mode should now be rendered.

The port used by Lean Slides can be modified through an environment variable with the name LEANSLIDES_PORT.

Features

Lean Slides turns comments written in the above format into reveal.js slides which are rendered in the infoview as a Widget.

The tool also features a code action to go in and out of draft mode.

The generated reveal.js slides render mathematics by default using KaTeX.