【问题标题】:Using pandoc's slidy offline使用 pandoc 的 slidy 离线
【发布时间】:2013-07-11 21:47:34
【问题描述】:

我正在使用 Pandoc 从 Markdown 转换为 Slidy 幻灯片格式。但我需要离线使用 slidy,所以我将我从他们的网站 http://www.w3.org/Talks/Tools/Slidy2/slidy.zip 下载的 slidy 脚本的副本放在文件夹“Slidy2”下,然后我使用命令

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

要链接我本地的 slidy 副本,pandoc 会生成以下 html 代码

...
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" type="text/css" media="screen, projection, print"
    href="Slidy2/styles/slidy.css" />
<script src="Slidy2/scripts/slidy.js.gz"
    charset="utf-8" type="text/javascript"></script>
</head>
...

但 slidy 根本不起作用。

在滑动页面中,提到了以下选项:

1. Use relative URIs depending on your local setup to access the appropriate files. 
   Use the same directory structure as on the W3C server, ie, ".../2005/Talks/...".

2. Run a Web server on your machine so that the directory above can be accessed via
   http://localhost/Talks/Tools/Slidy2 and use the URIs of the form   
   "/Talks/Tools/Slidy2/styles/slidy.css", "/Talks/Tools/Slidy2/scripts/slidy.js".

我不知道可能是什么问题。

【问题讨论】:

    标签: slideshow offline pandoc


    【解决方案1】:

    尝试使用 --self-contained 选项生成自给自足的 HTML 代码。您的 HTML 代码不完整。它缺少&lt;html&gt;, &lt;body&gt; 元素

    【讨论】:

    • 我不会粘贴所有的 html 代码,只粘贴带有 slidy 链接的部分。我对 --self-contained 有疑问,因为 --mathjax 不起作用。
    【解决方案2】:

    我不知道到底是什么问题,但是将加载 slidy 脚本的压缩版本 src="Slidy2/scripts/slidy.js.gz" 的行更改为未压缩版本 src="Slidy2/scripts/slidy.js" 的行可以解决问题。

    【讨论】:

      猜你喜欢
      • 2012-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-10
      • 2021-09-08
      • 2011-06-17
      • 2012-07-11
      • 2015-02-03
      相关资源
      最近更新 更多