reStructuredText rendering from commandline
Seem to be experiencing a mental block this morning... I would like to create an external script, call it reStr, obviously Pythonic, such that, on a command line - $ reStr some-text-file.txt > some-rendered-html.html will give me a file that users can view and publish from outside Zope. My question(s): 1) Has someone done anything similar? If so, any pointers/tips will be appreciated. 2) Does anyone know what modules I may need to import? Which functions I'd call? Would it be 'StructuredText'? Really am feeling stupid today. TIA.
check the implementation of the ZReST product or the reStructuredText package in Zope. -aj --On Dienstag, 30. September 2003 8:50 Uhr +0400 Samir Mishra <SamirMishra@cbuae.gov.ae> wrote:
Seem to be experiencing a mental block this morning...
I would like to create an external script, call it reStr, obviously Pythonic, such that, on a command line -
$ reStr some-text-file.txt > some-rendered-html.html
will give me a file that users can view and publish from outside Zope.
My question(s): 1) Has someone done anything similar? If so, any pointers/tips will be appreciated. 2) Does anyone know what modules I may need to import? Which functions I'd call? Would it be 'StructuredText'?
Really am feeling stupid today.
TIA.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Tue, Sep 30, 2003 at 08:50:19AM +0400, Samir Mishra wrote:
I would like to create an external script, call it reStr, obviously Pythonic, such that, on a command line -
$ reStr some-text-file.txt > some-rendered-html.html
will give me a file that users can view and publish from outside Zope.
docutils-0.3/tools/html.py Turns your restructured text file into html. -- Ng Pheng Siong <ngps@netmemetic.com> http://firewall.rulemaker.net -+- Manage Your Firewall Rulebase Changes http://sandbox.rulemaker.net/ngps -+- Open Source Python Crypto & SSL
On Tue, 30 Sep 2003, Ng Pheng Siong wrote:
docutils-0.3/tools/html.py
Turns your restructured text file into html. IMHO this HTML is a little bit poor. I had a view on it whether it might be usable as a replacement for the StructuredText stuff I use in the Debian Zope Book package but it is nearly unuseable because it uses poor formating. Where heading tags (<h1> or <h2>) would be apropriate, simple <p> tags are used followed by a <blockquote>.
Kind regards Andreas.
On Tue, Sep 30, 2003 at 08:38:53AM +0200, Andreas Tille wrote:
On Tue, 30 Sep 2003, Ng Pheng Siong wrote:
docutils-0.3/tools/html.py Turns your restructured text file into html.
IMHO this HTML is a little bit poor. I had a view on it whether it might be usable as a replacement for the StructuredText stuff I use in the Debian Zope Book package but it is nearly unuseable because it uses poor formating. Where heading tags (<h1> or <h2>) would be apropriate, simple <p> tags are used followed by a <blockquote>.
Above-mentioned html.py eventually invokes docutils.core.publish, which does the following: - self.reader.read(...) - self.apply_transforms(...) - self.writer.write(...) By visual inspection of ZReST in Zopes 2.6 and 2.7, class ZReST's render does the same three steps. I'd imagine the magic to improve the html output is in apply_transforms. Cheers. -- Ng Pheng Siong <ngps@netmemetic.com> http://firewall.rulemaker.net -+- Manage Your Firewall Rulebase Changes http://sandbox.rulemaker.net/ngps -+- Open Source Python Crypto & SSL
participants (4)
-
Andreas Jung -
Andreas Tille -
Ng Pheng Siong -
Samir Mishra