Codeslide Pandoc Filter Example

Codeslide Filter Example

This document demonstrates how the codeslide.lua filter can be used to embed interactive Python slides directly into your Markdown documents.

Basic Slide

A simple Python code block will be converted into an interactive slide.

Slide with Target

You can specify a target attribute to provide a goal for the user. Codeslide will check if the output matches this target.

JavaScript Support

The filter also supports JavaScript code blocks.

const greeting = "Hello"
const target = "World"
greeting

Multi-line Code

The filter correctly handles multi-line code blocks and encodes them for the URL.

Usage

To generate an HTML file from this Markdown using the filter, run:

pandoc examples/filter.md --lua-filter codeslide.lua -s -o examples/filter.html