|
Subject: Re: rst2html.py.CGI ? Newsgroups: gmane.text.docutils.user Date: 2004-11-17 19:56:28 GMT (4 years, 32 weeks, 6 days, 2 hours and 4 minutes ago) Johannes Busse wrote: > - is there a cgi-wrapper around? I would like > to put rst2html.py.cgi into the cgi-bin directory > of an apache2, an reconfigure apace like this: > > Action reStructuredText /cgi-bin/rst2html.py.cgi > AddHandler reStructuredText .rst You don't want that. On my 670 MHz system, rst2html.py takes 0.7 seconds to start up, and it processes about 10 KB of input data per second. That's certainly too slow for a server. I'd suggest you use a script which processes all changed reST files to HTML, which you run everytime a reST file has changed. You can take <http://docutils.sourceforge.net/sandbox/davidg/infrastructure/docutils-update> as an example of how to do this. > - are there some serious security issues? > Obviously the import-document function should be > handled with care. Should it be allowed only for URLs? This is unsolved, AFAIK. In my wiki, I solved the problem by overriding the built-in `open` function with an exception-throwing function while the reStructuredText parser is running, but that's ugly. David, what do you think? Add an option prohibiting file/URL access? Might be useful, I guess. > - rst2xml is not only a parser. In fact it > performs *three* jobs: > > - tokenize structured text > - build an internal document tree > - transform it to formats like html, latex etc. > > For my opinion python is a wonderful language to support the first two > steps. Nevertheless: to transform and serialize the internal tree to > html or LaTeX the language XSLT seems to be much more flexible. Is > there some work done yet to replace the internal docutils-transformer > with xslt stylesheets? No, none yet. I think XSLT would allow less flexibility. There is some logic in the current writers, and I'm not sure if that could be done by XSLT. But it's worth mentioning that David Pries wrote an XSLT stylesheet for Docutils' XML output. (But you probably already knew that.) > In fact I am working on the following (opensource-) project: > > - parse a set of structured text documents > - chunk this text corpus: every element with an (unique) > id will become one single topic > - build an XML Topic Map (XTM), which models the structure of the text > corpus by means of roles and associations > - define some XTM-queries, which recombine and serialize a set of > Topics template based to a new document. I don't know XTM, so I can't say much about that. > [...] > > - extend the rst-format with some XTM-specific markup. Therefore we > have to embed XML (or XML- equivalent stuff) into rst. Mmmh. Intuitively I'd say: Use the built-in possibilities of reST (like, say, the "class" directive) or write new directives and/or roles which extend reST in the way you want (maybe you don't need to use XML directly). But it's difficult to say without concrete examples. -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 |
|
|