• Stars
    star
    170
  • Rank 223,357 (Top 5 %)
  • Language
    JavaScript
  • License
    BSD 2-Clause "Sim...
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build presentation slides with Markdeep and present them right in your browser.

markdeep-slides

Build presentation slides with Markdeep and present them right in your browser.

  • Two modes:
    • Initially, you're in draft mode – with inline presenter notes, useful as a preview when building slides.
    • You can switch into presentation mode (shown to the right) – with your slides shown fullscreen and your presenter notes in a separate window.
    • You can also generate a PDF version of your slides by printing them to a PDF (use Chrome for this; more below).
  • Keyboard shortcuts for all relevant functions (see below).
  • Supports all features Markdeep has to offer – diagrams, math, inline videos, citations, admonitions, and all the standard Markdown stuff.
  • 3 built-in themes – but if you don't like any of them or want to adjust stuff: Style your slides with CSS! LaTeX and Beamer are great, but things can get tricky if you really want to make them your own.
  • The full power of CSS animations and JavaScript is at your fingertips – use it wisely.
  • Compatible with those little presenter gadgets.

πŸ’» Try out a demo presentation and take a look at its Markdeep source code.

Also, check out markdeep-thesis and markdeep-diagram-drafting-board!

Getting started

Setup

This repository contains copies of all dependencies (Markdeep, MathJax, and the webfonts used by the built-in themes) by design – it'll work offline (unless you include YouTube videos or something in your slides). You don't want to rely on wifi being available when and where you'll present – that's just asking for trouble.

πŸ“¦ Clone this repository or download a ZIP.

Then simply...

  1. navigate to demo.md.html,
  2. open it in your text editor and browser of choice, and
  3. start building your slides. Easy!

Shortcuts

Use the following keyboard shortcuts to steer your presentation. Press...

  • Space, ↓, β†’ or PgDn to go to the next slide,
  • ↑, ← or PgUp to go to the previous slide,
  • F, F5 or Esc to toggle fullscreen/presentation mode,
  • . to turn the screen black (and back again),
  • n to toggle a window with your presenter notes,
  • t to start or dismiss a timer counting up from zero seconds (shown in the presenter notes window), and
  • a slide number, e.g. 1 7, followed by Enter, to jump directly to that slide.

Options

At the bottom of demo.md.html, right before a bunch of essential JavaScript files are loaded, you'll find a set of options. Their default values (each of which is automatically applied if you omit the corresponding option) are:

<script>
markdeepSlidesOptions = {
    aspectRatio: 16 / 9,      // aspect ratio of your slides
    theme: 'simple',          // theme – "simple", "deepsea", "serif" or path of a stylesheet
    fontSize: 28,             // base font size, relative to slide display size
    diagramZoom: 1.0,         // markdeep diagram scaling factor
    totalSlideNumber: false,  // show total number of slides next to slide number?
    progressBar: true,        // show a presentation progress bar on each slide?
    breakOnHeadings: false,   // start a new slide not only on encountering "---", but also level 1 and 2 headings?
    slideChangeHook: (oldSlide, newSlide) => {},  // function executed whenever the current slide changes, receives old and new slide number
    modeChangeHook: (newMode) => {}               // function executed whenever the mode changes, receives new mode, e.g. "draft" or "presentation"
};
</script>

Modify them to your liking, but don't decrease the font size too much (nobody wants to read novel-length slides). Additionally, you can tweak some aspects of each theme by overriding CSS variables – take a look at the relevant file in markdeep-slides/themes/.

Exporting to PDF

It's best to use Chrome for generating a PDF version of your slides – it respects the page size that's automatically specified in CSS based on your chosen aspect ratio (unlike all other browsers). In Chrome's print window, set "Margins" to "None" and make sure to keep the "Background graphics" option enabled.

In my experience, once you've dialled in this print configuration, you can run Chrome headlessly for future exports (you may need to boost the --virtual-time-budget depending on the complexity of your slides):

chrome --headless --disable-gpu --print-to-pdf=demo.md.html.pdf --no-margins --virtual-time-budget=5000 demo.md.html

Examples

Here's a list of presentations that folks have built using this tool:

Contributing

Got an idea on how to improve something? Ran into unexpected behavior? Found a bug? (Maybe even fixed that bug?)

Please file an issue or send a pull request! I'll be glad to take a look at it.

I'd love to hear from you (or take a peek at your slides) if you've used this tool in practice.


Notes

  • Tested in recent versions of Chrome, Firefox and Safari. I don't have access to Edge/IE, so you're on your own there (although I suspect that folks interested in building their slides with Markdeep aren't using these browsers anyway). Not really made for mobile use, although scrolling through slides in draft mode works fine.
  • The included variant of MathJax has been heavily stripped down and only allows SVG as the output format. This was done to keep the size to a minimum and because SVG output looks best (other formats may be more accessible, but that doesn't matter in a presentation context).
  • To display the current date on your title slide (or anywhere), simply write <span class="current-date"></span> – markdeep-slides takes care of the rest.
  • CSS animations play back on page load in draft mode, but on slide change in presentation mode.
  • If your presenter gadget doesn't work here, please go to https://keycode.info and record 1. which keycodes each button sends, 2. what happened, 3. what you expected to happen and file an issue accordingly.

Making your own theme

  • If you're making your own themes, make sure that all font-sizes, margins, paddings, widths, heights and other sizes are defined in terms of rem, em, or %. This enables your elements to scale properly depending on screen size. So don't use px, pt, or mm.
  • Also don't use vw and vh as size units – depending on the aspect ratio of your display and your slides, your slides will be letterboxed, so 100vh might be larger than the width of your slides (the same goes for height). The actual slide width and height can be read from the CSS variables var(--slide-width) and var(--slide-height), respectively.
  • Use CSS variables to keep your theme configurable (take a look at the existing themes to see some examples).
  • If you want your slides to have a non-white background, set it on the body selector as opposed to the .slide selector. This prevents small gaps caused by rounding errors from showing up in exported PDFs.
  • Keep in mind that the presenter notes will inherit your theme's styles. You can override specific styles by targeting the .presenter-notes class.
  • Download any webfonts to your computer. Again, you don't want to rely on wifi being available when and where you'll present. I recommend using this tool to download webfonts from Google Fonts.

Known issues

If you know of an elegant way of fixing these, I'd very much appreciate a heads up.

  • When resizing the window in Safari in draft mode, the font size is not scaled accordingly. No idea why – it's defined in terms of vw units in CSS, so it should scale as the viewport width changes. It does in all other browsers, anyway.
  • When leaving fullscreen mode in Firefox using Esc, presentation mode often persists. No idea why – leaving it by pressing f fires the same event, so the same stuff should happen.
  • After refreshing while in fullscreen mode in Safari, the only way to exit fullscreen mode is clicking the green button – and even after that, presentation mode persists because the webkitfullscreenchange event does not fire in this situation. (Other browsers exit fullscreen mode upon refresh, making this a non-issue there.)
  • Firefox, when applying an invert() filter to two selectors referring to elements that may contain each other, applies the filter to both elements separately, i.e. the filter cancels itself out. Other browsers do the "right" thing. This affects code snippets with line numbers when using the deepsea theme.
  • When printing to PDF in Chrome, you need to scroll all the way to the top before opening the print dialog – if you don't, some background colors might be missing. When rendering the page in print mode using the developer tools (or in any other circumstance), this issue unsurprisingly does not occur.

License

You may use this repository's contents under the terms of the BSD 2-Clause "Simplified" License, see LICENSE.

However, the subdirectory markdeep-slides/lib/ contains third-party software with its own licenses:

  • Morgan McGuire's Markdeep is also licensed under the BSD 2-Clause "Simplified" License, see here.
  • Markdeep includes Ivan Sagalaev's highlight.js with its BSD 3-Clause License, see here.
  • MathJax is licensed under the Apache License 2.0, see here.
  • All included webfonts (IBM Plex Mono, Iosevka, Libre Franklin, Source Sans Pro, Source Serif Pro, Vollkorn) are licensed under the SIL Open Font License, see here.

More Repositories

1

aerialbot

A simple yet highly configurable Mastodon/Twitter bot that posts geotagged aerial imagery of a random location in the world.
Python
219
star
2

uji

A minimalist generative art thing – press the buttons and play with the sliders!
JavaScript
185
star
3

nyum

A simple Pandoc-powered static site generator for your recipe collection – it effortlessly turns a set of Markdown-formatted recipes into a lightweight, responsive, searchable website.
HTML
183
star
4

tixyz

A minimalist three-dimensional coding environment. Control 8x8x8 dots with a single JavaScript function.
JavaScript
157
star
5

markdeep-thesis

Write your (under)graduate thesis with Markdeep and typeset it right in your browser.
JavaScript
144
star
6

google-maps-at-88-mph

Google Maps keeps old satellite imagery around for a while – this tool collects what's available for a user-specified region in the form of a GIF.
Python
123
star
7

handwriting

A SQL implementation of an ancient handwriting recognition algorithm.
TeX
79
star
8

cellular-automata-posters

Simple Python script that generates cellular automata posters as PDF files.
Python
55
star
9

scriptable-widgets

A collection of Scriptable widgets I've built.
JavaScript
43
star
10

UnicodeMathML

JavaScript-based translation of UnicodeMath to MathML that can be integrated into arbitrary HTML or Markdeep documents. An interactive "playground" allows for experimentation with the syntax and insight into the translation pipeline.
JavaScript
41
star
11

earthacrosstime

Mastodon/Twitter bot that posts videos showcasing how random locations in the world have changed since 1984.
Python
40
star
12

markdeep-diagram-drafting-board

Draft Markdeep diagrams with a live-updating preview overlaid onto your source code.
HTML
29
star
13

apple-photos-export

An Apple Photos export script.
Python
21
star
14

ffmpeg-koraktor

An occasionally-growing selection of FFmpeg invocations that have proven handy in various situations.
18
star
15

tweakpane-plugin-infodump

Infodump plugin for Tweakpane, provides a text-displaying blade with basic Markdown support intended for long descriptions (i.e., infodumps).
JavaScript
16
star
16

hashing-indexes-tikz

LaTeX packages for drawing extendible hashing indexes and linear hashing indexes using TikZ.
TeX
14
star
17

ReAD

A PHP-based reading list for web articles. Maintains a searchable archive and computes lots of stats.
PHP
10
star
18

cropcircles

A tool for cropping circular center pivot irrigation fields from aerial imagery.
HTML
9
star
19

sundryautomata

Mastodon/Twitter bot that posts a randomly generated cellular automaton every 12 hours.
Python
9
star
20

gomati

A simple Google Maps tile downloader and stitcher.
Shell
8
star
21

brachiosaurus

An incredibly basic turtle drawing tool I've built for making generative art with my BrachioGraph pen plotter.
Python
8
star
22

snooker-commentary-generator

Just a silly little toy.
JavaScript
8
star
23

vol

Simple bash script for adjusting the system volume on macOS.
Shell
7
star
24

genuary2022

Code and SVG files underlying the plotter drawings I made for #GENUARY2022.
HTML
4
star
25

spell

Haskell implementation of Peter Norvig's spelling corrector.
Haskell
4
star
26

Tumblr-Themes

The source code of any Tumblr themes I've released to the Theme Garden.
HTML
4
star
27

scripts

Various scripts that don't really necessitate their own repositories
Shell
4
star
28

dotfiles

My dotfiles, plus various other configs.
Shell
3
star
29

cpi-video-creation

A quickly-thrown-together tool for making a series of videos.
Python
3
star
30

wikipediastats

A Haskell-powered Twitter bot that posts milestones and statistics of various Wikipedias.
Haskell
2
star
31

corridor

Simple text adventure game.
Prolog
1
star
32

doersino

1
star
33

acm-boobytraps

My Python 2.7 solution of the ACM Programming Contest problem "Booby Traps", along with a map generator and a LaTeX beamer slide and TikZ map visualization generator.
Python
1
star
34

leaflet-zoom2markers

Basic Leaflet control that zooms the map to show all markers.
JavaScript
1
star
35

leichter

A bare-bones weight tracking app with a simple and responsive web interface.
PHP
1
star
36

minecraft-server-utils

A few utility bash scripts that 1. start a vanilla Minecraft server on system boot, 2. keep an up-to-date incremental backup of the world and server files, as well as daily snapshots for the history books, and 3. optionally purge old snapshots whenever disk space runs low.
Shell
1
star