[ZDP] Re: Structured Text in Vars/DTML Methods
Fri, 05 Mar 1999 15:43:15 +0100
At 14:57 05/03/99 , Pavlos Christoforou wrote:
>The reason I did not include support for Structured Text was situations
>where one might want to include examples like:
>... this is an example::
><!--# var title-->
>last I checked Zope would not render the above correctly. If I do some
>hackery I might get it to work but then I still have the problem where one
>might mix html and dtml in non-example sections. I will play around with
>your read_raw() suggestion.
With read_raw it renders it perfectly. All HTML codes within examples are
HTML escaped, all other text is taken as is, exactly as it should be. You
could then use arbitrary HTML in your text (outside example blocks) to get
special effects like tables and links. Please use it.
>If you have any ideas let me know.
>I really want to have Structured Text support.
>PS Do you think is too much to ask for people to declare when an entry is
>in structured text? ie
><answer fmt='structured-text'>A beer</answer>
>I wanted to make the submission as easy as possible.
I really do think all submissions should be structured text, but making it
an option like that would be fine as well.
BTW, why does your FAQ DTD support multiple QUESTION and ANSWER tags? How
do you know which answer goes with which question? I don't think assuming
that if one follows the other they belong together.
I am asking this because I think we should also support unanswered
questions. So maybe the structure should be:
<ANSWER fmt="fmt spec">Because!</ANSWER>
<SECTION>Other Section title</SECTION>
<!-- note: no answer.. -->
Eg. your DTD would be:
<!DOCTYPE faq [
<!ELEMENT faq (entry*)>
<!ELEMENT entry (section, question, answer?, author?, email?, submitted?)>
<!ELEMENT section (#PCDATA)>
<!ELEMENT question (#PCDATA)>
<!ELEMENT answer (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT submitted (#PCDATA)>
fmt CDATA "structured-text">
Using this DTD, all FAQ entries MUST have a section and question, but
answer, author, email and submitted are optional. If fmt is not specified,
it defaults to structured-text, so we can override this by using <ANSWER
fmt="">, or maybe fmt="none". This allows for future additional formats.
M.J. Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:firstname.lastname@example.org http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149