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 bination 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.
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 bination 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.
3 Answers
Reset to default 4Sorry 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.
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 puter.
mklink /D reveal.js C:\Users\Jared\Documents\reveal.js
Gets the job done and makes pandoc happy.
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