implementing structured text alternative w/in Zope
Hi, I'm a programmer but new to Zope. I'm developing a text markup language like Structured Text that better suits my needs outside the Zope/Python world. Would I be able to incorporate it within Zope, i.e., so I could edit the new format in the edit window and have it displayed as HTML by the server, handled as a Zope object, etc.? I'd like to do it as transparently as (on the lowest level) possible, but if it turns out I have to do it as a feature of a product, that will be OK. Any tips for either scenario much appreciated. Thanks in advance, --tb __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/
Toby Bologna schrieb:
Hi,
I'm a programmer but new to Zope. I'm developing a text markup language like Structured Text that better suits my needs outside the Zope/Python world. Would I be able to incorporate it within Zope, i.e., so I could edit the new format in the edit window and have it displayed as HTML by the server, handled as a Zope object, etc.?
I'd like to do it as transparently as (on the lowest level) possible, but if it turns out I have to do it as a feature of a product, that will be OK. Any tips for either scenario much appreciated.
Of course you can do that with Zope. You'll find quite a few examples of new markup languages for Zope if you browse the Products list on zope.org. You definitely will have to write a product for this. You need a basic method or document object (like DTMLMethod). Writing or adapting the over-the-web edit screens is simple. The harder part will be the parser that generates the HTML for you. But I guess you know how to do this. There is one thing that might be trickier than you'd expect: If you want to have the same security features as in DTML or ZPT (i.e. checking for every method call and attribute if the viewer has the permissions to execute/view them) you will have to implement much of that on your own in the language parser. Note that if you keep it as simple as structured text you won't need to care about the security issue. In structured text you don't call other code or attributes ... The document object will have to implement a __call__() (or index_html()) method for it. This method has to take the code (that is stored in a property of the object) and render it. Then you just "return" the result at the end. It's really not that difficult, and if you take a similar product and look at the code it is relatively easy to understand. Be sure that you read the Zope Developers Guide on zope.org first! Joachim
--On Freitag, 7. März 2003 19:20 +0100 Joachim Werner <joe@iuveno.de> wrote:
Toby Bologna schrieb:
Hi,
I'm a programmer but new to Zope. I'm developing a text markup language like Structured Text that better suits my needs outside the Zope/Python world. Would I be able to incorporate it within Zope, i.e., so I could edit the new format in the edit window and have it displayed as HTML by the server, handled as a Zope object, etc.?
Check out the integration of reStructuredText in Zope 2.7. -aj
I'm a programmer but new to Zope. I'm developing a text markup language like Structured Text that better suits my needs outside the Zope/Python world. Would I be able to incorporate it within Zope, i.e., so I could edit the new format in the edit window and have it displayed as HTML by the server, handled as a Zope object, etc.?
I'd like to do it as transparently as (on the lowest level) possible, but if it turns out I have to do it as a feature of a product, that will be OK. Any tips for either scenario much appreciated.
Remember that in the grand scheme of things, most everything in Zope is a Product. And practically everything can be manipulated by a product. Especially with what you intend to do: not too long ago was ZPT an add-on product, as well as STX. DTML and ZSQLMethods are implemented as products. So you're not really losing anything by doing it that way. If what you're doing is really useful and general, perhaps it will be added to the Zope distribution sometime in the future, but you needn't count on that.' --jcc
Toby Bologna wrote at 2003-3-7 07:42 -0800:
I'm a programmer but new to Zope. I'm developing a text markup language like Structured Text that better suits my needs outside the Zope/Python world. Would I be able to incorporate it within Zope, i.e., so I could edit the new format in the edit window and have it displayed as HTML by the server, handled as a Zope object, etc.?
Sure, you would define your own content class. Have a look at ZWiki. It supports several dozens of text formats. It would be easy to add new ones ;-) Dieter
participants (5)
-
Andreas Jung -
Dieter Maurer -
J Cameron Cooper -
Joachim Werner -
Toby Bologna