tasos@kadena.io isa@kadena.io
September 13, 2023
Create Kadena-themed presentations from markdown using pandoc
./gen-watch.sh
source.md
index.html
in a browserOptionally: deploy to github pages.
Running ./gen.sh
will rebuild the target index.html
.
Running ./gen-watch.sh
will watch the current directory for changes to .md
or .slidy
files and run gen.sh
when any change is detected.
Running ./gen-standalone.sh
will create a standalone index.html with all resources inlined, which can be shared as-is.
Pandoc supports some keyboard shortcuts while presenting, like s
for smaller font size, b
for larger, k
to disable click-to-forward, c
for a table of contents, etc.
Press h
while on the presentation to show a detailed help screen.
Aside from those you can also press v
to hide the video background.
The header of the source markdown file includes the following variables that can be set. Refer to source.md
contents for an example.
Name | Description |
---|---|
title |
Presentation title. Ends up in title slide, page title |
title-prefix |
Presentation prefix for html page title |
author |
Ends up in title slide, page meta author |
date |
Ends up in title slide, page meta date |
The following optional metadata can be used to customize the presentation theme.
Name | Description |
---|---|
background |
image background for presentation if video is missing or slide_bg_is_video is false |
logosig |
“signature” logo at bottom right of each slide |
icons |
List of image sources to show as icons over the title on the title slide. |
video |
List of {.src, .type} video sources for the background of the title slide (or presentation) |
video_playback_rate |
custom playback rate for the video |
slide_bg_is_video |
true to use the video as presentation background, false to use image instead |
In case you need to tweak the generated html or stylesheets:
The js slideshow library used is slidy
.
The template file which generates the html is assets/kadena.slidy
.
CSS stylesheets can be tweaked under assets/styles/
.
If you want to pick different colors or tones, please consult the Color System.
If you need to make sure your index.html
is up to date with your source, you can use a pre-commit hook like this:
A sample is provided under /pre-commit.sample
which you can copy to .git/hooks/pre-commit
Deploying this to Github pages is straightforward.
main
and click Save
.Your presentation will be deployed to the URL:
https://<GitHub Username>.github.io/<Repo Name>
If you have moved index.html
to a subfolder:
/.github/workflows/static.yml
jobs.deploy.steps.Upload artifact
step (should have a comment “Upload entire repository”.)path
with the path to your document root.The full pandoc markdown reference can be found here.
Slides are separated by H1 headings # My next Slide
or three dashes ---
.
Code blocks can have syntax highlighting, e.g.:
` ` ` javascript
console.log("very nice");
` ` `
Produces:
Note: the backticks above had to be spaced for font rendering purposes. Do not include spaces between backticks in your code.
If you need line numbers in code blocks, use this invocation:
` ` ` {.javascript .numberLines}
console.log("very");
console.log("nice");
` ` `
Produces:
Note: the backticks above had to be spaced for font rendering purposes. Do not include spaces between backticks in your code.
To split a slide in two or more columns, you can use this markdown:
:::::::::::::: {.columns}
::: {.column width="80%"}
## large content to the left
:::
::: {.column width="20%"}
small content to the right
:::
::::::::::::::
Produces:
small content to the right
The usual markdown for a ruler ---
denotes “new slide” in pandoc
You can insert a horizontal ruler / HR by using the html tag: <hr />