From: Ben F. <ben...@be...> - 2015-01-07 05:21:48
|
Ben Finney <ben...@be...> writes: > But if the document has only one top-level section Sorry, I gave the wrong example. Here is an example that shows the behaviour: > the special case applies and I don't get the sections as I want: > > ===== > $ cat foo.txt > First Section > ============= > > Lorem ipsum, dolor sit amet. > > $ rst2pseudoxml < foo.txt > <document ids="first-section" names="first\ section" source="<stdin>" title="First Section"> > <title> > First Section > <paragraph> > Lorem ipsum, dolor sit amet. > ===== What I want is: ===== $ rst2pseudoxml < foo.txt <document source="<stdin>"> <section ids="first-section" names="first\ section"> <title> First Section <paragraph> Lorem ipsum, dolor sit amet. ===== In fact, I'm accessing this document programmatically using a custom Writer. How can I get the parsing result I want? -- \ “… a Microsoft Certified System Engineer is to information | `\ technology as a McDonalds Certified Food Specialist is to the | _o__) culinary arts.” —Michael Bacarella | Ben Finney |