Jared
Jared

Reputation: 3570

Self-Contained reveal.js file without relative reveal.js folder using Pandoc

I am having trouble producing a self-contained reveal.js slideshow with Pandoc when the reveal.js folder is not relative to the markdown file.

A simple Markdown file, Tester.md:

# Title Slide

# Second Slide
More stuff happening here

# Some more stuff
Hello

The reveal.js folder is located at "c:/Users/Jared/Documents/reveal.js".

Running

pandoc -s -S -t revealjs Tester.md -o TesterReveal.html -V revealjs-url:c:/Users/Jared/Documents/reveal.js

creates an HTML file that links to the appropriate reveal.js folder and everything works just fine.

However, if I set --self-contained Pandoc returns an error.

pandoc -s -S -t revealjs Tester.md -o TesterReveal.html -V revealjs-url:c:/Users/Jared/Documents/reveal.js --self-contained

pandoc.exe: Failed to retrieve c:/Users/Jared/Documents/reveal.js/css/reveal.min.css
InvalidUrlException "c:/Users/Jared/Documents/reveal.js/css/reveal.min.css" "Invalid scheme"

Setting --self-contained works fine if the reveal.js folder is relative to Tester.md.

So I imagine the combination of --self-contained and -V revealjs-url:c:/Users/Jared/Documents/reveal.js is the culprit.

Any ideas how to keep the reveal.js folder in its own place and still have --self-contained work properly. I feel that copying the reveal.js folder into every presentation I do is not a good practice.

Upvotes: 2

Views: 4159

Answers (3)

waechtertroll
waechtertroll

Reputation: 41

Sorry for the necromancy, but I was experiencing similar problems. I solved it by finding out my pandoc user data directory:

pandoc --version

downloading the latest reveal.js, unzipping it into the user data directory, and renaming it to reveal.js (without the trailing version string).
Now I can create self-contained slideshows from any working directory without passing url parameters. This works for other formats that need scripts and stylesheets as well.

Upvotes: 4

PHY
PHY

Reputation: 1

I was having a similar problem using --self-contained to embed a css file within html output. On a whim I tried using \\ as the path delimiter instead of / and it worked! You might try:

pandoc -s -S -t revealjs Tester.md -o TesterReveal.html -V revealjs-url:c:\\Users\\Jared\\Documents\\reveal.js

Upvotes: 0

Jared
Jared

Reputation: 3570

Not thrilled with this solution but it works. For each presentation I create a symbolic link (using Windows) inside that folder to the reveal.js folder that sits elsewhere on my computer.

mklink /D reveal.js C:\Users\Jared\Documents\reveal.js

Gets the job done and makes pandoc happy.

Upvotes: 1

Related Questions