Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customizing Pandoc's Slidy CSS?

I'm using the amazing Pandoc to convert from Markdown to the Slidy slideshow format. I'd like to edit the Slidy CSS but I can't for the life of me figure out where the CSS file is that's getting used. I've found a bunch of slidy.css files here and there and tried modifying them, but Pandoc's Slidy output never changes.

Does anyone know where slidy.css is by default on OSX? Thanks!

like image 494
incandescentman Avatar asked Jul 03 '12 23:07

incandescentman


2 Answers

Specify additional css files with pandoc -t slidy --css my.css .... This doesn't require modifying pandoc's default slidy templates.

(This is in John MacFarlane's earlier comment. I'm just posting it as an answer for higher visibility.)

like image 173
David Röthlisberger Avatar answered Oct 28 '22 20:10

David Röthlisberger


By default pandoc uses the CSS and javascript files from the slidy website. If you want to use local versions, create a directory, say myslidy, with subdirectories scripts and styles. Put slidy.js.gz in scripts and slidy.css in styles. Then call pandoc with the following options:

pandoc -s -t slidy -V slidy-url=myslidy

Pandoc will then link to your local CSS file. If you'd like to include all of this in the HTML file itself, so it doesn't depend on the external myslidy directory, then add the option --self-contained.

Another option is to keep using the slidy script from the slidy website, but substitute your own CSS file. To do that, you'd have to create a custom slidy template with a different stylesheet link. To get your own copy of the default template, do

pandoc -D slidy > my.slidy

Edit the CSS link in this file, and call pandoc with

pandoc -s -t slidy --template my.slidy
like image 33
John MacFarlane Avatar answered Oct 28 '22 20:10

John MacFarlane