Skip to content

Commit e71a655

Browse files
committed
switch to html5
1 parent 69e24fa commit e71a655

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+447
-489
lines changed

THANKS

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ Nico Di Rocco
127127
Nicolas Duhamel
128128
Nicolas Perriault
129129
Nicolas Steinmetz
130+
nkr
130131
Paolo Melchiorre
131132
Paul Asselin
132133
Pavel Puchkin

pelican/readers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import docutils.core
1212
import docutils.io
1313
from docutils.parsers.rst.languages import get_language as get_docutils_lang
14-
from docutils.writers.html4css1 import HTMLTranslator, Writer
14+
from docutils.writers.html5_polyglot import HTMLTranslator, Writer
1515

1616
from pelican import rstdirectives # NOQA
1717
from pelican.cache import FileStampDataCacher
@@ -178,8 +178,8 @@ class RstReader(BaseReader):
178178
"""Reader for reStructuredText files
179179
180180
By default the output HTML is written using
181-
docutils.writers.html4css1.Writer and translated using a subclass of
182-
docutils.writers.html4css1.HTMLTranslator. If you want to override it with
181+
docutils.writers.html5_polyglot.Writer and translated using a subclass of
182+
docutils.writers.html5_polyglot.HTMLTranslator. If you want to override it with
183183
your own writer/translator (e.g. a HTML5-based one), pass your classes to
184184
these two attributes. Look in the source code for details.
185185

pelican/tests/output/basic/author/alexis-metaireau.html

+6-8
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,15 @@ <h1 class="entry-title"><a href="/this-is-a-super-article.html">This is a super
4141
<p>In <a href="/category/yeah.html">yeah</a>.</p>
4242
<p>tags: <a href="/tag/foo.html">foo</a> <a href="/tag/bar.html">bar</a> <a href="/tag/foobar.html">foobar</a> </p>
4343
</footer><!-- /.post-info --><p>Some content here !</p>
44-
<div class="section" id="this-is-a-simple-title">
44+
<section id="this-is-a-simple-title">
4545
<h2>This is a simple title</h2>
4646
<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
4747
<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
4848
<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
49-
<pre class="literal-block">
50-
&gt;&gt;&gt; from ipdb import set_trace
51-
&gt;&gt;&gt; set_trace()
52-
</pre>
49+
<pre class="literal-block">&gt;&gt;&gt; from ipdb import set_trace
50+
&gt;&gt;&gt; set_trace()</pre>
5351
<p>→ And now try with some utf8 hell: ééé</p>
54-
</div>
52+
</section>
5553
</article>
5654
</aside><!-- /#featured -->
5755
<section id="content" class="body">
@@ -78,12 +76,12 @@ <h1><a href="/oh-yeah.html" rel="bookmark"
7876
<p>tags: <a href="/tag/oh.html">oh</a> <a href="/tag/bar.html">bar</a> <a href="/tag/yeah.html">yeah</a> </p>Translations:
7977
<a href="/oh-yeah-fr.html" hreflang="fr">fr</a>
8078

81-
</footer><!-- /.post-info --> <div class="section" id="why-not">
79+
</footer><!-- /.post-info --> <section id="why-not">
8280
<h2>Why not ?</h2>
8381
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
8482
YEAH !</p>
8583
<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
86-
</div>
84+
</section>
8785

8886
<a class="readmore" href="/oh-yeah.html">read more</a>
8987
</div><!-- /.entry-content -->

pelican/tests/output/basic/category/bar.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ <h1 class="entry-title"><a href="/oh-yeah.html">Oh yeah !</a></h1>
3838
<p>tags: <a href="/tag/oh.html">oh</a> <a href="/tag/bar.html">bar</a> <a href="/tag/yeah.html">yeah</a> </p>Translations:
3939
<a href="/oh-yeah-fr.html" hreflang="fr">fr</a>
4040

41-
</footer><!-- /.post-info --><div class="section" id="why-not">
41+
</footer><!-- /.post-info --><section id="why-not">
4242
<h2>Why not ?</h2>
4343
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
4444
YEAH !</p>
4545
<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
46-
</div>
46+
</section>
4747
</article>
4848
</aside><!-- /#featured -->
4949
<section id="extras" class="body">

pelican/tests/output/basic/category/misc.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ <h1><a href="/unbelievable.html" rel="bookmark"
8080
</footer><!-- /.post-info --> <p>Or completely awesome. Depends the needs.</p>
8181
<p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a>
8282
<a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p>
83-
<div class="section" id="testing-sourcecode-directive">
83+
<section id="testing-sourcecode-directive">
8484
<h2>Testing sourcecode directive</h2>
8585
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
8686
</pre></div></td></tr></table></div>
87-
</div>
88-
<div class="section" id="testing-another-case">
87+
</section>
88+
<section id="testing-another-case">
8989
<h2>Testing another case</h2>
9090
<p>This will now have a line number in 'custom' since it's the default in
91-
pelican.conf, it will …</p></div>
91+
pelican.conf, it will …</p></section>
9292
<a class="readmore" href="/unbelievable.html">read more</a>
9393
</div><!-- /.entry-content -->
9494
</article></li>

pelican/tests/output/basic/category/yeah.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,15 @@ <h1 class="entry-title"><a href="/this-is-a-super-article.html">This is a super
4141
<p>In <a href="/category/yeah.html">yeah</a>.</p>
4242
<p>tags: <a href="/tag/foo.html">foo</a> <a href="/tag/bar.html">bar</a> <a href="/tag/foobar.html">foobar</a> </p>
4343
</footer><!-- /.post-info --><p>Some content here !</p>
44-
<div class="section" id="this-is-a-simple-title">
44+
<section id="this-is-a-simple-title">
4545
<h2>This is a simple title</h2>
4646
<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
4747
<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
4848
<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
49-
<pre class="literal-block">
50-
&gt;&gt;&gt; from ipdb import set_trace
51-
&gt;&gt;&gt; set_trace()
52-
</pre>
49+
<pre class="literal-block">&gt;&gt;&gt; from ipdb import set_trace
50+
&gt;&gt;&gt; set_trace()</pre>
5351
<p>→ And now try with some utf8 hell: ééé</p>
54-
</div>
52+
</section>
5553
</article>
5654
</aside><!-- /#featured -->
5755
<section id="extras" class="body">
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<feed xmlns="http://www.w3.org/2005/Atom"><title>A Pelican Blog - Alexis Métaireau</title><link href="/" rel="alternate"></link><link href="/feeds/alexis-metaireau.atom.xml" rel="self"></link><id>/</id><updated>2013-11-17T23:29:00+00:00</updated><entry><title>This is a super article !</title><link href="/this-is-a-super-article.html" rel="alternate"></link><published>2010-12-02T10:14:00+00:00</published><updated>2013-11-17T23:29:00+00:00</updated><author><name>Alexis Métaireau</name></author><id>tag:None,2010-12-02:/this-is-a-super-article.html</id><summary type="html">&lt;p class="first last"&gt;Multi-line metadata should be supported
2+
<feed xmlns="http://www.w3.org/2005/Atom"><title>A Pelican Blog - Alexis Métaireau</title><link href="/" rel="alternate"></link><link href="/feeds/alexis-metaireau.atom.xml" rel="self"></link><id>/</id><updated>2013-11-17T23:29:00+00:00</updated><entry><title>This is a super article !</title><link href="/this-is-a-super-article.html" rel="alternate"></link><published>2010-12-02T10:14:00+00:00</published><updated>2013-11-17T23:29:00+00:00</updated><author><name>Alexis Métaireau</name></author><id>tag:None,2010-12-02:/this-is-a-super-article.html</id><summary type="html">&lt;p&gt;Multi-line metadata should be supported
33
as well as &lt;strong&gt;inline markup&lt;/strong&gt;.&lt;/p&gt;
44
</summary><content type="html">&lt;p&gt;Some content here !&lt;/p&gt;
5-
&lt;div class="section" id="this-is-a-simple-title"&gt;
5+
&lt;section id="this-is-a-simple-title"&gt;
66
&lt;h2&gt;This is a simple title&lt;/h2&gt;
77
&lt;p&gt;And here comes the cool &lt;a class="reference external" href="http://books.couchdb.org/relax/design-documents/views"&gt;stuff&lt;/a&gt;.&lt;/p&gt;
88
&lt;img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /&gt;
99
&lt;img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /&gt;
10-
&lt;pre class="literal-block"&gt;
11-
&amp;gt;&amp;gt;&amp;gt; from ipdb import set_trace
12-
&amp;gt;&amp;gt;&amp;gt; set_trace()
13-
&lt;/pre&gt;
10+
&lt;pre class="literal-block"&gt;&amp;gt;&amp;gt;&amp;gt; from ipdb import set_trace
11+
&amp;gt;&amp;gt;&amp;gt; set_trace()&lt;/pre&gt;
1412
&lt;p&gt;→ And now try with some utf8 hell: ééé&lt;/p&gt;
15-
&lt;/div&gt;
16-
</content><category term="yeah"></category><category term="foo"></category><category term="bar"></category><category term="foobar"></category></entry><entry><title>Oh yeah !</title><link href="/oh-yeah.html" rel="alternate"></link><published>2010-10-20T10:14:00+00:00</published><updated>2010-10-20T10:14:00+00:00</updated><author><name>Alexis Métaireau</name></author><id>tag:None,2010-10-20:/oh-yeah.html</id><content type="html">&lt;div class="section" id="why-not"&gt;
13+
&lt;/section&gt;
14+
</content><category term="yeah"></category><category term="foo"></category><category term="bar"></category><category term="foobar"></category></entry><entry><title>Oh yeah !</title><link href="/oh-yeah.html" rel="alternate"></link><published>2010-10-20T10:14:00+00:00</published><updated>2010-10-20T10:14:00+00:00</updated><author><name>Alexis Métaireau</name></author><id>tag:None,2010-10-20:/oh-yeah.html</id><content type="html">&lt;section id="why-not"&gt;
1715
&lt;h2&gt;Why not ?&lt;/h2&gt;
1816
&lt;p&gt;After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
1917
YEAH !&lt;/p&gt;
2018
&lt;img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /&gt;
21-
&lt;/div&gt;
19+
&lt;/section&gt;
2220
</content><category term="bar"></category><category term="oh"></category><category term="bar"></category><category term="yeah"></category></entry></feed>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<rss version="2.0"><channel><title>A Pelican Blog - Alexis Métaireau</title><link>/</link><description></description><lastBuildDate>Sun, 17 Nov 2013 23:29:00 +0000</lastBuildDate><item><title>This is a super article !</title><link>/this-is-a-super-article.html</link><description>&lt;p class="first last"&gt;Multi-line metadata should be supported
2+
<rss version="2.0"><channel><title>A Pelican Blog - Alexis Métaireau</title><link>/</link><description></description><lastBuildDate>Sun, 17 Nov 2013 23:29:00 +0000</lastBuildDate><item><title>This is a super article !</title><link>/this-is-a-super-article.html</link><description>&lt;p&gt;Multi-line metadata should be supported
33
as well as &lt;strong&gt;inline markup&lt;/strong&gt;.&lt;/p&gt;
4-
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Thu, 02 Dec 2010 10:14:00 +0000</pubDate><guid isPermaLink="false">tag:None,2010-12-02:/this-is-a-super-article.html</guid><category>yeah</category><category>foo</category><category>bar</category><category>foobar</category></item><item><title>Oh yeah !</title><link>/oh-yeah.html</link><description>&lt;div class="section" id="why-not"&gt;
4+
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Thu, 02 Dec 2010 10:14:00 +0000</pubDate><guid isPermaLink="false">tag:None,2010-12-02:/this-is-a-super-article.html</guid><category>yeah</category><category>foo</category><category>bar</category><category>foobar</category></item><item><title>Oh yeah !</title><link>/oh-yeah.html</link><description>&lt;section id="why-not"&gt;
55
&lt;h2&gt;Why not ?&lt;/h2&gt;
66
&lt;p&gt;After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
77
YEAH !&lt;/p&gt;
88
&lt;img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /&gt;
9-
&lt;/div&gt;
9+
&lt;/section&gt;
1010
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Wed, 20 Oct 2010 10:14:00 +0000</pubDate><guid isPermaLink="false">tag:None,2010-10-20:/oh-yeah.html</guid><category>bar</category><category>oh</category><category>bar</category><category>yeah</category></item></channel></rss>

0 commit comments

Comments
 (0)