Titles in reStructuredText

24 views
Skip to first unread message

Nic Young

unread,
Dec 30, 2012, 6:44:25 PM12/30/12
to blogofil...@googlegroups.com
I am attempting to write a simple static "Projects" page in blogofile. I am attempting to write the page in reST with the "filter chain='rst'". Here is what the page looks like:

<%self:filter chain="rst">  
------------                                                                               
Projects
------------

These are a list of projects that I am currently working on or have completed.          

------------                                                                            

                                                                                        
Title 1
~~~~~                                                                              


------------
                                                                                        
Title 2
~~~~~
              
</%self:filter>

The issue is, when this is compiled in to html it is doing the following:

<h1>Projects</h1>
...
<h1>Title 1</h1>
...
<h2>Title 2</h2>

When I really want both "Title 1" and "Title 2" wrapped in <h2> tags. How can I go about accomplishing this? Why is the reST compiler rendering the page in this manner?

Doug Latornell

unread,
Dec 31, 2012, 1:32:46 PM12/31/12
to blogofil...@googlegroups.com, Nic Young
I think that you will find that the first heading actually has a class="title" attribute on it; i.e.

<h1 class="title">Projects</h1>

I have pretty much the same thing on http://douglatornell.ca/projects/ which is rendered via the rst filter.

I have a vague memory of digging into that, and I think I concluded that its just what the docutils HTML writer does. The highest level heading is rendered as <h1 class="title">, the next as <h1>, then <h2>, and so on. So, if you want to style you Project headings differently from Title 1 and Title 2, you can do so via h1.title vs. h1 CSS selectors.

Nic Young

unread,
Dec 31, 2012, 1:35:23 PM12/31/12
to blogofil...@googlegroups.com, Nic Young, d...@douglatornell.ca
I figured it was a docutils configuration. I ended up just changing my page over to markdown as that seems better supported with blogofile.
Reply all
Reply to author
Forward
0 new messages