On Mon, 2007-04-02 at 15:24 +1000, Michael Lake wrote:
> Hi all
> 
> I have a problem I think when I use the markup package. This provides 
> markdown, 
> textile and restructuredtext markups. I have the following in views.py:
> 
> def testwiki:
> 
>      content = '''
> Restructured Text Test
> ======================
> 
> How de do.
> 
> Sub Heading
> -----------
> 
> Hi
> '''
> 
> return render_to_response("app/testwiki.html" , {'content': content})
> 
> In testwiki.html I have {{ content|restructuredtext}}
> 
> The page is displayed but there is no heading level 1 i.e. I'm missing 
> "Restructured 
> Text Test". If I place any character above the heading like 'a' then the 
> heading 
> shows fine. It also works fine if I have a H1 anywhere lower down. But If I 
> just wish 
> to have one H1 level Im in problems.
> 
> Maybe this is a restructured text parsing problem? Has anyone seen this?

This is normal Restructured Text behaviour, although I agree it's a bit
weird when you first see it. It's kind of a consequence of a ReST
feature combined with us (Django) diving into the middle of the output
processing pipeline to extract only what we need.

There is no specific way to specify the document title or subtitle. So
ReST uses the initial *unique* heading markup as the document title. The
restructured text template tag only returns the document "fragment"
after the markup has been performed. This does include the document
title, which is why you are "losing" the first heading.

This is in the ReST documentation
(http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html )
under "Document Structure", if you care.

Not sure what a good workaround would be that is always going to work.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to