Re: [Zope] ZWiki/Structured Text formatting surprise
Hi,
Just noticed that (_.None,_, gets rendered as (.None,, in a structrued text wiki. Not useful :/
Hm, in a structuredtextdtml Wiki (such as the Zope edu Wiki) this works. See the SandBox there http://www.zope.org/Wikis/zope-edu/SandBox. So I can't reproduce it now.
I've got around this by doing ('_'.None,_, but that's not really the right idea.
Does anyone know of the proper way of escaping this?
Won't the !_.None help? Rik
On Tue, Jun 27, 2000 at 10:42:01PM +0200, Rik Hoekstra wrote:
Just noticed that (_.None,_, gets rendered as (.None,, in a structrued text wiki. Not useful :/
Hm, in a structuredtextdtml Wiki (such as the Zope edu Wiki) this works. See the SandBox there http://www.zope.org/Wikis/zope-edu/SandBox. So I can't reproduce it now.
You are only testing _.None, not _.None,_, which is the problem, see below. I changed your test to include the other underscore to illustrate the point.
I've got around this by doing ('_'.None,_, but that's not really the right idea.
Does anyone know of the proper way of escaping this?
The ZWiki tries to render anything between '_' (underscore) charaters as underlined. So _.None,_ indeed gets rendered as <u>.None,</u>. Nowhere is the ZWiki trying to interpret this as a WikiName. Indeed, the only thing I can thus think of (apart from quoting the underscores), is quoting the whole sentence, '_.None,_'. This may be desirable in this case, as it supposedly is a code example anyway. Doubly underscoring the line (and live with the underlining), doesn't work, BTW. I updated the above SandBox to illustrate. -- Martijn Pieters | Software Engineer mailto:mj@digicool.com | Digital Creations http://www.digicool.com/ | Creators of Zope http://www.zope.org/ | ZopeStudio: http://www.zope.org/Products/ZopeStudio -----------------------------------------------------
Martijn Pieters wrote:
On Tue, Jun 27, 2000 at 10:42:01PM +0200, Rik Hoekstra wrote:
Just noticed that (_.None,_, gets rendered as (.None,, in a structrued text wiki. Not useful :/
Hm, in a structuredtextdtml Wiki (such as the Zope edu Wiki) this works. See the SandBox there http://www.zope.org/Wikis/zope-edu/SandBox. So I can't reproduce it now.
You are only testing _.None, not _.None,_, which is the problem, see below. I changed your test to include the other underscore to illustrate the point.
I've got around this by doing ('_'.None,_, but that's not really the right idea.
Does anyone know of the proper way of escaping this?
The ZWiki tries to render anything between '_' (underscore) charaters as underlined. So _.None,_ indeed gets rendered as <u>.None,</u>. Nowhere is the ZWiki trying to interpret this as a WikiName.
Indeed, the only thing I can thus think of (apart from quoting the underscores), is quoting the whole sentence, '_.None,_'. This may be desirable in this case, as it supposedly is a code example anyway. Doubly underscoring the line (and live with the underlining), doesn't work, BTW.
I updated the above SandBox to illustrate.
Why not put a space in there, after the comma? As in: (_.None, _, foo) Likewise, I tried this in the Sandbox. Works for me. :)
Bill Anderson wrote:
Why not put a space in there, after the comma? As in: (_.None, _, foo)
Likewise, I tried this in the Sandbox. Works for me. :)
I'd prefer to see a generic way of escaping structured text formatting. Maybe this is something for StructuredTextNG? Chris
Chris Withers wrote:
Bill Anderson wrote:
Why not put a space in there, after the comma? As in: (_.None, _, foo)
Likewise, I tried this in the Sandbox. Works for me. :)
I'd prefer to see a generic way of escaping structured text formatting.
Maybe this is something for StructuredTextNG?
Chris
Of course. But in the interim... Bill -- "Linux: the operating system with a CLUE... Command Line User Environment". seen in a posting on comp.software.testing
Chris Withers wrote:
Bill Anderson wrote:
Why not put a space in there, after the comma? As in: (_.None, _, foo)
I suggest that, since this appeared in a code snippit to begin with, it should have been written as: blah blah '(_.None,_,foo)' blah blah in which case, the '_'s shouldn't have had any effect. (If they did, it's a bug). Note that the StructuredText underlining feature is widely considered a missfeature and probably won't be supported in StructuredTextNG.
Likewise, I tried this in the Sandbox. Works for me. :)
I'd prefer to see a generic way of escaping structured text formatting.
Maybe this is something for StructuredTextNG?
Maybe. I'd really prefer that this not be necessary. Maybe someone should add this escaping feature to the StructuredText Wiki at http://www.zope.org/Members/jim/StructuredTextWiki/StructuredTextNG. If you do, please suggest an escaping syntax. Please think hard to come up with an escaping syntax that I don't hate. ;) Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jim Fulton wrote:
I suggest that, since this appeared in a code snippit to begin with, it should have been written as:
blah blah '(_.None,_,foo)' blah blah
I don't format my code like that ;-)
Note that the StructuredText underlining feature is widely considered a missfeature and probably won't be supported in StructuredTextNG.
Hmm, it could be useful though...
I'd prefer to see a generic way of escaping structured text formatting.
Maybe this is something for StructuredTextNG?
Maybe. I'd really prefer that this not be necessary.
I think escapign is always going to be necessary for something like this... ;-)
If you do, please suggest an escaping syntax. Please think hard to come up with an escaping syntax that I don't hate. ;)
How about extending ! beyond just escaping WikiNames? ! escapes structured text if it directly precedes a formatting character. !! actually puts a ! if it does indeed need to proceed a formatting character. cheers, Chris PS: Off to the wiki now ;-)
Chris Withers wrote:
Jim Fulton wrote:
I suggest that, since this appeared in a code snippit to begin with, it should have been written as:
blah blah '(_.None,_,foo)' blah blah
I don't format my code like that ;-)
I'm not sure what the ';)' refers to, but single quotes are the correct way to indicate literal code in structured text. (snip)
If you do, please suggest an escaping syntax. Please think hard to come up with an escaping syntax that I don't hate. ;)
How about extending ! beyond just escaping WikiNames?
I *really* **really** hate the ! wiki name escape.
! escapes structured text if it directly precedes a formatting character. !! actually puts a ! if it does indeed need to proceed a formatting character.
I really don't like this. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jim Fulton wrote:
blah blah '(_.None,_,foo)' blah blah
I'm not sure what the ';)' refers to, but single quotes are the correct way to indicate literal code in structured text.
Sorry, that'll teach me to answer email at 20 to midnight :( I see the point now...
How about extending ! beyond just escaping WikiNames?
I *really* **really** hate the ! wiki name escape.
Why?
! escapes structured text if it directly precedes a formatting character. !! actually puts a ! if it does indeed need to proceed a formatting character.
I really don't like this.
Hmmm, I would write 'Why?' again, but I think that'd be flame-bating ;-) I think there should be some form of escaping, ! seems the most compact and unobtrusive ,or maybe ^ or some such... Ideas welcomely recieved :-) Chris
Chris Withers wrote:
Jim Fulton wrote:
(snip)
How about extending ! beyond just escaping WikiNames?
I *really* **really** hate the ! wiki name escape.
Why?
A goal of structured text is that it should be readable in it's original form. The conventions used should mimic the kinds of things we do in email, to the extent possible. The bang ascape totally violates this.
! escapes structured text if it directly precedes a formatting character. !! actually puts a ! if it does indeed need to proceed a formatting character.
I really don't like this.
Hmmm, I would write 'Why?' again, but I think that'd be flame-bating ;-)
Not at all.
I think there should be some form of escaping, ! seems the most compact and unobtrusive ,or maybe ^ or some such...
Ideas welcomely recieved :-)
I can't think of any. I'm open to suggestions, but I reserve the right to hate the suggestions. :) While I'm open to escaping, I'd also really like to think harder about the formatting conventions so as to make escaping unnecessary. If we need to escape, we've probably done something wrong. I actually think that the otion of in-line code is useful as a typographic feature and should really eliminate the need for escaping in most if not all cases. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jim Fulton wrote:
Chris Withers wrote:
Jim Fulton wrote:
I suggest that, since this appeared in a code snippit to begin with, it should have been written as:
blah blah '(_.None,_,foo)' blah blah
I don't format my code like that ;-)
I'm not sure what the ';)' refers to, but single quotes are the correct way to indicate literal code in structured text.
That seems to be a rather inappropriate character to quote code with. You can't quote any of the vast reams of code which uses quotes, such as: REQUEST.set('id', 'value') or any other similar code. As an aside, I just tried, in http://www.zope.org/Wikis/zope-edu/SandBox, quoting the code: <dtml-call "REQUEST.set('id', 'value')"> It didn't work, so I then tried <dtml-call "REQUEST.set(id, value)"> which also didn't work, but it did work if I quoted it by escaping the following paragraph using the :: syntax. This indicated that the 'some code' functionality is in some way broken, since it doesn't happen before executing any dtml which might be on the page. Cheers, Stephen -- Stephen Harrison stephen@nipltd.com New Information Paradigms www.nipltd.com
Stephen Harrison wrote:
Jim Fulton wrote:
Chris Withers wrote:
Jim Fulton wrote:
I suggest that, since this appeared in a code snippit to begin with, it should have been written as:
blah blah '(_.None,_,foo)' blah blah
I don't format my code like that ;-)
I'm not sure what the ';)' refers to, but single quotes are the correct way to indicate literal code in structured text.
That seems to be a rather inappropriate character to quote code with.
You can't quote any of the vast reams of code which uses quotes, such as:
REQUEST.set('id', 'value')
or any other similar code.
I'm open to a different quoting convention. Note that for basic Python code, you can simply switch the quotes, as in: 'REQUEST.set("id", "value")' but, of course, this doesn't work for DTML.
As an aside, I just tried, in http://www.zope.org/Wikis/zope-edu/SandBox, quoting the code:
<dtml-call "REQUEST.set('id', 'value')">
It didn't work, so I then tried
<dtml-call "REQUEST.set(id, value)">
which also didn't work,
This is due to the fact that StructuredText has a bug in the handling of inline code. It failes to HTML-quote the contents. This can be fixed, but you still can't quote: <dtml-var "REQUEST.set('id', 'value')">
but it did work if I quoted it by escaping the following paragraph using the :: syntax.
This doesn't "escape" the following paragraph, it makes it a literal example. StructuredText *does* properly quote non-inline examples.
This indicated that the 'some code' functionality is in some way broken, since it doesn't happen before executing any dtml which might be on the page.
Yup. This is not a fatal flaw in itself, as it can be fixed. Still, the DTML bit above is problemantic. A number of people have complained about the use os single quotes for in-line code. One possibel alternative is to use ``code''. See http://www.zope.org/Members/jim/StructuredTextWiki/CustomizingTheDocumentPro... Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (6)
-
Bill Anderson -
Chris Withers -
Jim Fulton -
Martijn Pieters -
Rik Hoekstra -
Stephen Harrison