最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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.

Share Improve this question asked Jan 29, 2014 at 6:45 JaredJared 3,5703 gold badges28 silver badges29 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

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.

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
发布评论

评论列表(0)

  1. 暂无评论