I would like to write a 2-column website (html) with reStructuredText and rst2html5.
I have tried like this
.. container:: right
Right text
.. container:: left
Left text
and it works well (with css "float").
However, rst2html5 could not compile a .rst with a section within a container directive with a message (SEVERE/4) Unexpected section title or transition..
.. container:: right
========
Section1
========
Right text
.. container:: left
Left text
I guess/think the rst2html5 behavior is completely valid for the rst specification.
I would like to get .html from .rst with rst2html5 like this.
<div class="right">
<h1>Section1</h1>
<p>Right text</p>
</div>
<div class="left">
<p>Left text</p>
</div>
Is it allowed to include sections within container or something like that? (I think it is not allowed, right?) or How can I get a similar html output to above from .rst (with rst2html5)?
I read this thread, but could not manage to get 2-column html.
Any comments would be appreciated. Thanks in advance.
I think trying to make the ReST to handle the two columns is the wrong way. ReST does not care about layout and should not care about layout. That should be done by the site design, and classes.
Here is a question on that issue: flow 2 columns of text automatically with CSS It looks like the CSS3: columns property is being quite widely supported now.
And you are right, Docutils doesn't sections headers in containers. Containers are a type of body elements, and only allowed inside sections. http://docutils.sourceforge.net/docs/ref/doctree.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With