我正在尝试运行这个简单的例子:
pandoc -t slidy -s habits.txt -o habits.html
habits.txt
如下所示:
% Habits
% John Doe
% March 22, 2005
# In the morning
## Getting up
- Turn off alarm
- Get out of bed
## Breakfast
- Eat eggs
- Drink coffee
# In the evening
## Dinner
- Eat spaghetti
- Drink wine
适用于Mac OS X 10.10.5,包含Safari 9.0.1(10601.2.7.2),Chrome 46.0.2490.86(64位)和Pandoc 1.15.2。
生成的html文件在Safari中具有计数器,帮助和目录的幻灯片正确呈现,但在Chrome中则不行。在Chrome中,它只是一个带有标题的平面HTML,其中会有单独的幻灯片标题。
任何想法如何解决这个问题?
这是html:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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" />
<meta name="author" content="John Doe" />
<meta name="date" content="2005-03-22" />
<title>Habits</title>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" type="text/css" media="screen, projection, print"
href="http://www.w3.org/Talks/Tools/Slidy2/styles/slidy.css" />
<script src="http://www.w3.org/Talks/Tools/Slidy2/scripts/slidy.js"
charset="utf-8" type="text/javascript"></script>
</head>
<body>
<div class="slide titlepage">
<h1 class="title">Habits</h1>
<p class="author">
John Doe
</p>
<p class="date">March 22, 2005</p>
</div>
<div id="in-the-morning" class="titleslide slide section level1"><h1>In the morning</h1></div><div id="getting-up" class="slide section level2">
<h1>Getting up</h1>
<ul>
<li>Turn off alarm</li>
<li>Get out of bed</li>
</ul>
</div><div id="breakfast" class="slide section level2">
<h1>Breakfast</h1>
<ul>
<li>Eat eggs</li>
<li>Drink coffee</li>
</ul>
</div>
<div id="in-the-evening" class="titleslide slide section level1"><h1>In the evening</h1></div><div id="dinner" class="slide section level2">
<h1>Dinner</h1>
<ul>
<li>Eat spaghetti</li>
<li>Drink wine</li>
</ul>
</div>
</body>
</html>
答案 0 :(得分:3)
Coworker发现:如果在服务器上托管并通过常规网址访问,则在Chrome中将正常呈现habit.html,但在从本地磁盘读取时则不会。这是诊断:
在slidy.js ln 1275上的chrome中遇到此错误:
Uncaught SecurityError:无法在'History'上执行'pushState':A 带URL的历史状态对象 'file:///Users/brettleibowitz/Desktop/slidy.html#(1)'不能 在原文'null'的文档中创建。