1.0.0-rc.1 • Published 7 months ago

@korbiniankuhn/markdown-slides v1.0.0-rc.1

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Markdown-Slides

Generate HTML-Slides with from Markdown-Files

Features

  • ✨ Beautiful slides including a pretty title slide
  • 📱 Slides are fully response for mobile devices and small screens
  • 🌓 Light and Dark Mode
  • 🖨️ Print styles to create PDFs in the browser
  • ♿ HTML slides are accessible
  • 📖 Table of contents to jump to specific slides
  • 💡 Code highlighting with highlight.js
  • ➗ Equations with MathJax
  • 📈 Diagrams with Mermaid
  • #️⃣ Slide numbers will be generated automatically
  • 📅 Date of the build will be included as a versioning
  • 📚 Supports multiple markdown files to split your presentation in subslides
  • ➡️ Use space and arrow keys to navigate
  • 🎨 Easily override the Stuttgart Media University (HDM) theme with custom colors and logos
  • 🚀 Just deploy your slides with Gitlab or GitHub pages

Requirements for local builds

If you want to build the slides locally, Node or Docker is required.

How to use it

Create one (README.md) or more markdown files in the root of your directory (e.g. a git repository) and start typing.

To start a new slide use a comment <!-- slide -->.

Example:

# Lecture Title

@module[123456]
@semester[Summer 2025]

Korbinian Kuhn [kuhnko@](mailto:kuhnko@hdm-stuttgart.de)

<!-- slide -->

## Content

- What we will do
- What you will learn

Build the slides with:

sh master/build.sh

Serve slides (you can also open the index.html file locally, but you might run into CORS issues e.g. for MathJax):

npx http-server -c-1 public

CLI parameters

Convert current directory to slides into a output directory public:

npx @korbiniankuhn/markdown-slides

Whitelist certain files and directories:

npx @korbiniankuhn/markdown-slides --allowed-files .md images style.css script.js

CLI arguments:

ArgumentDescriptionDefaultRequired
-i, --inInput directory.false
-o, --outOutput directorypublicfalse
-l, --languageLanguageenfalse
--toc-numberingAdd numbering to headlinestruefalse
--allowed-filesWhitelist directories, files,or extensionsundefinedfalse
--ignored-filesBlacklist directories, files or extensions (dotfiles are always ignored)undefinedfalse

Markdown extensions

Slides

IdentifierDescription
<!-- slide -->Starts a new slide

Spacer

IdentifierDescription
:spacerMedium vertical spacer
:spacer{size=sm}Small vertical spacer
:spacer{size=md}Medium vertical spacer
:spacer{size=lg}Large vertical spacer
:spacer{size=xl}Extra-Large vertical spacer

Layout

IdentifierDescription
<!-- row -->Starts a row container
<!-- row:end -->Ends a row container
<!-- col -->Starts a col container
<!-- col:end -->Ends a col container

Example

<!-- row -->
<!-- col -->

Left

<!-- col:end -->
<!-- col -->

Right

<!-- col:end -->
<!-- row:end -->

Custom Theme

Look into the examples/custom-theme directory to overide the default theme:

Just provide these files in the root of your project:

  • logo-light.svg, logo-dark.svg, favicon.svg
  • style.css:
:root {
  --color-primary: blue;
}

MathJax

LaTex equations are converted to equations with MathJax, including all accessibility features:

Centered Math (\\[ ... \\]):

\ x = {-b \pm \sqrt{b^2-4ac} \over 2a} \

Inline Math (\\( ... \\)):

\( x = {-b \pm \sqrt{b^2-4ac} \over 2a} \)

MermaidJS

Mermaid is supported, fits in nicely with the colors of the theme and automatically reacts to the light or dark mode:

sequenceDiagram
    Alice->>John: Hello John, how are you?
    John-->>Alice: Great!
    Alice-)John: See you later!
1.0.0-alpha.2

7 months ago

1.0.0-alpha.1

7 months ago

1.0.0-rc.1

7 months ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago