admin管理员组文章数量:1421287
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
本文标签: javascriptSelfContained revealjs file without relative revealjs folder using PandocStack Overflow
版权声明:本文标题:javascript - Self-Contained reveal.js file without relative reveal.js folder using Pandoc - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745346826a2654523.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论