Differences between revisions 1 and 10 (spanning 9 versions)
Revision 1 as of 2002-07-16 02:02:16
Size: 400
Editor: ipd54b5a02
Comment:
Revision 10 as of 2004-02-18 19:58:17
Size: 1726
Editor: dsl254-010-130
Comment: More official way, described at ASPN.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
ReStructuredText is a complete rewrite of StructuredText by David Goodger. #pragma section-numbers off

= ReStructuredText (reST) =

ReStructuredText is a complete rewrite of StructuredText by David Goodger.

It is distributed as part of DocUtils. [http://docutils.sourceforge.net/ (project page)] [http://sourceforge.net/project/showfiles.php?group_id=38414 (download)]
Line 5: Line 11:
  * [http://docutils.sourceforge.net/spec/rst/introduction.html An Introduction to ReStructuredText]
  * [http://docutils.sourceforge.net/docs/rst/quickstart.html A ReStructuredText Primer]
  * [http://docutils.sourceforge.net/spec/rst/reStructuredText.html ReStructuredText Markup Specification]
  * [http://docutils.sourceforge.net/spec/rst/introduction.html An Introduction to ReStructuredText] - goals & history
  * [http://docutils.sourceforge.net/docs/rst/quickstart.html A ReStructuredText Primer] - how to write reST text
  * [http://docutils.sourceforge.net/spec/rst/reStructuredText.html ReStructuredText Markup Specification] - details on writing reST text
  * [http://www.ocf.berkeley.edu/~bac/rest_tutorial.html Brett Cannon's PyCon Tutorial]

{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 MoinMoin:RestSample for an example. This of course only works when you use the current CVS version, and when docutils is installed.

== Reading reST, Writing HTML ==

There's surprisingly little on the web and in the documentation about how to read reST, and output HTML.

IanBicking has contributed this code, which reads a source text (in reST), and writes HTML:

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

"It may feel wrong, but it works, and works reliably."

There's a more "official" way, that feels less dirty, [http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/193890 described at ASPN.]
 
== Discussion ==

  (none)

ReStructuredText (reST)

ReStructuredText is a complete rewrite of StructuredText by David Goodger.

It is distributed as part of DocUtils. [http://docutils.sourceforge.net/ (project page)] [http://sourceforge.net/project/showfiles.php?group_id=38414 (download)]

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.

Reading reST, Writing HTML

There's surprisingly little on the web and in the documentation about how to read reST, and output HTML.

IanBicking has contributed this code, which reads a source text (in reST), and writes HTML:

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

"It may feel wrong, but it works, and works reliably."

There's a more "official" way, that feels less dirty, [http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/193890 described at ASPN.]

Discussion

  • (none)

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

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