<eazytext>
= title
== section1
1
== section2
2
</eazytext>
I get this parse tree:
wikipage:
paragraphs:
paragraphs:
paragraphs:
paragraphs:
paragraphs:
paragraph:
heading: `['=', <eazytext.ast.TextContents object at 0x104257350>]`
newline:
paragraph_separator:
newline:
paragraph:
heading: `['==', <eazytext.ast.TextContents object at 0x1042576d0>]`
newline:
paragraph_separator:
newline:
paragraph:
textlines:
(line 1)
textcontent: basictext :
newline:
paragraph_separator:
newline:
paragraph:
heading: `['==', <eazytext.ast.TextContents object at 0x104257bd0>]`
newline:
paragraph_separator:
newline:
paragraph:
textlines:
(line 1)
textcontent: basictext :
newline:
paragraph_separator:
newline:
paragraph_separator:
newline:
Identifying sections isn't that easy, since headings are very deep in the hierarchy, but text is near the top. I was hoping for something like this hierarchy:
wikipage:
section:
heading: "title"
paragraphs:
section:
heading: "section1"
paragraphs:
text: "1"
section:
heading: "section2"
paragraphs:
text: "2"
Then we could also generate a table of contents, etc...
Cheers,
Devin
I hope you will get a nice looking output now.
> Grouping sections :
>
> You want sections to be hierarchically organized (i.e) section-
> heading and section-text to be parsed as children nodes for a given
> section-node. Note that, HTML does not organize sections like that.
> Headings and paragraphs are not grouped into sections, also they are
> stored as siblings under the same parent node. So, it does not sound
> prudent to change the grammar.
I think the HTML designers realized this mistake. HTML5 and XHTML2 both organize content into sections:
http://www.w3.org/TR/html5/sections.html#the-section-element
Without a grouping element, styling and manipulation become much harder.
~ Devin