Differences between revisions 5 and 6
Revision 5 as of 2004-02-18 02:24:24
Size: 1200
Editor: dsl254-010-130
Comment: Wanted to use reST for a blogging program, but...
Revision 6 as of 2004-02-18 04:35:12
Size: 1656
Editor: dsl081-228-065
Comment: blogging pessimism uncalled for
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:

Of course, it's very easy to take a full HTML document and extract the body. It may feel wrong, but it works, and works reliably. PyDS uses reST successfully for blogging (though I don't know the specifics of its integration). Here's a little recipe:

{{{
#!python
html = docutils.core.publish_string(
           source=text,
           writer_name='html')
html = html[html.find('<body>')+6:html.find('</body>')].strip()
}}}

-- IanBicking

ReStructuredText is a complete rewrite of StructuredText by David Goodger.

More information:

{i} MoinMoin contains an (incomplete) bridge to the docutils's parser, you can try this by using "#format rst" as the first line of a wiki page. See RestSample for an example. This of course only works when you use the current CVS version, and when docutils is installed.

Discussion

I really wanted to use ReStructuredText for a blogging program. It would take a string of ReStructuredText, and then turn that into an HTML fragment. However, reST seems extremely resistant to giving you anything but a full HTML document. It's probably possible to get a fragment, but it'd take longer to figure out how than to make my own miniature "structured text"-like language.

-- LionKimbro

Of course, it's very easy to take a full HTML document and extract the body. It may feel wrong, but it works, and works reliably. PyDS uses reST successfully for blogging (though I don't know the specifics of its integration). Here's a little recipe:

   1 html = docutils.core.publish_string(
   2            source=text,
   3            writer_name='html')
   4 html = html[html.find('<body>')+6:html.find('</body>')].strip()

-- IanBicking

reStructuredText (last edited 2015-01-10 12:31:31 by WolfgangMaier)

Unable to edit the page? See the FrontPage for instructions.