karldw / markdown_intro_2021-06-29

Intro to Markdown for #econ_prosem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intro to Markdown

June 29, 2021

Sources

Generate slideshow

Render to html

The basic version is just Rscript -e "rmarkdown::render('markdown_talk.md')"

But you can watch for changes with inotifywait:

while inotifywait -e modify markdown_talk.md; do
    Rscript -e "rmarkdown::render('markdown_talk.md')"
done

Print to PDF

For some reason, reveal.js is a pain to print from html. Here I use decktape to render to PDF. (Using podman, an easier alternative to docker.)

Build the docker image if necessary (the official decktape docker image gave me permission errors):

mkdir tmp
podman build -t decktape -f decktape_container.dockerfile tmp
rmdir tmp

Run decktape. It has no idea when each HTML page is done loading or rendering, so you have to set pauses. (The default --pause of 1000ms is longer than necessary, but the default --load-pause of 0ms isn't long enough. Here I make both 500ms.)

podman run --rm -it -v .:/slides decktape --size 1920x1080 --pause 500 --load-pause 500 reveal markdown_talk.html markdown_talk.pdf

About

Intro to Markdown for #econ_prosem

License:MIT License


Languages

Language:JavaScript 52.7%Language:CSS 23.8%Language:HTML 13.7%Language:SCSS 9.7%Language:Dockerfile 0.1%Language:TeX 0.0%