(anonymous guest) (logged out)

Copyright (C) by the contributors. Some rights reserved, license BY-SA.

Sponsored by the Wiki Symposium and the Nuveon GmbH.

 

Add new attachment

Only authorized users are allowed to upload new attachments.

This page (revision-44) was last changed on 15-Dec-2007 14:57 by YaroslavStavnichiy  

This page was created on 12-Jan-2007 16:31 by RadomirDopieralski

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 7 changed one line
First, I need to handle inline comment enclosed in curly braces (this is a common notation in set theory, like {A, B}). So if I have four open curlies followed by four closes, how do I handle that? One provisional solution I'm considering is associating the extra close curlies with the ''inside'' of the span, so the regex for the closing markup is three closing curlies not followed by a fourth: {{\}\}\}(?!\})}} in Python syntax, for the coders out there. This would also provide an escape for three or more closing curlies inside a span: just follow those with three closing curlies followed by three opening ones, to open a new span.
First, I need to handle inline comment enclosed in curly braces (this is a common notation in set theory, like {A, B}). So if I have four open curlies followed by four closes, how do I handle that? One provisional solution I'm considering is associating the extra close curlies with the ''inside'' of the span, so the regex for the closing markup is three closing curlies not followed by a fourth: {{{\}\}\}(?!\})}}} in Python syntax, for the coders out there. This would also provide an escape for three or more closing curlies inside a span: just follow those with three closing curlies followed by three opening ones, to open a new span.
At line 266 changed one line
~}}} <-- one space is removed here
~}}} <-- the single space is removed here
At line 272 added 2 lines
Of course that makes it impossible to have a "{{{~}}}}}}" indented by a single space anywhere in the pre block -- but the only case where it matters that I can imagine is ascii-art.
At line 275 added 133 lines
I think using space in the escape pattern is a good suggestion Radomir. And it could still follow the "put one more than you need to get what see" pattern... so not entirely impossible for ascii-art! I don't see anything necessarily wrong with using space, we're going to have the same problem with whatever character is chosen. Perhaps there's more likely hood of a "collision", that's the only thing that concerns me right now, but otherwise I generally like the idea.
Actually, I have to add, just tested this in my parser and I really really like it. When you look at the plain text you have a good idea of what's happening. And I'm not so concerned about collision anymore because, after all, we are talking about new lines starting with one or more spaces followed by three closing curly brackets. It should be highly unlikely (and if there's a case where it's required then there's a workaround).
-- [MarkWharton], 2007-01-23
I'm wholeheartedly in favor of Mark's proposal. It has several subtle but significant advantages over a line-noise character. Most important, users are quite likely to stumble over the correct markup just by playing with it. "Hmm, what are the rules for this? If I add spaces, does it still count as the end of the block?" Second, in the (still very unlikely) event of a collision with actual content, the extent of the mangling to the content is to remove a single whitespace. And, of course, the fix is to simply add one more.
On a more meta note, I'm very pleased with the way this particular discussion has happened. We have three people who care about and understand the issues, and are doing their best to think through all the possibilities to find the best one. On top of that, we have many more who are reading and would point out a serious error and have the opportunity to contribute a brainstorm. The discussion is balanced between theoretical concerns of completeness and practical implementation experience, and keeps entirely to the subject at hand. Would that all controversies in Creole be addressed with such good process!
-- [Raph Levien], 2007-01-23
I think the advantage of a line-noise character is that it can be applied uniformly to all markup. However, if significant whitespace can be applied in the same way, then it's fine for me. I'm just not quite sure how you would escape bold/italic/other markup with spaces?
-- JanneJalkanen, 2007-01-23
Bold/italic/other markup is escaped using the nowiki markup, as the name suggests.
-- RadomirDopieralski, 2007-01-23
DOes anybody see something wrong in this proposal? Is there something to add or discuss further? I'd like to propose including this in Creole 0.4 in (more or less) current form if there are no further issues related to this.
-- RadomirDopieralski, 2007-01-25
I'm happy with everything. Thanks Raph and Radomir, I've enjoyed the discussions! I think the outcome is really a group effort. To see all the different ideas, problems, solutions, has been a great experience for me.
-- [MarkWharton], 2007-01-25
Maybe I've lost something, but... is there a way to escape 3 curly braces in //in-line// nowiki sections?
-- [[Michele Tomaiuolo]], 2007-02-14
The [[AddNoWikiEscapeProposal]] solution for nowiki includes any trailing "}" into the nowiki span. This means only the final three curly brackets are treated as termination. For cases where {{{~}}}}}} is required in the middle of a nowiki span, simply close one span and immediately open another. See Raph's last entry dated 2007-01-22 above for specifics.
-- MarkWharton, 2007-02-14
Thanks Mark. Including trailing braces is simple and feasible.
But what about a "}}}" sequence in the middle of a nowiki section? I don't like the close-and-open hack very much.
We should find a more generic, 'clean', short-to-type, easy to learn and teach solution, IMO.
Simple parsers could interpret this hack as "close a tag, open another". Not a desirable behaviour.
I think we should find a way to break the closing sequence - for example to "} } }" - and then remove added characters (spaces?). Something like what we do for nowiki blocks. A single solution working in both cases would be better, though.
-- [[Michele Tomaiuolo]], 2007-02-14
Using space as escape character for nowiki/preformatted might work, but we need a general discussion about a escape character, that alsow works for headings, lists etc. Space is not a solution here. I would like to ask you to join the discussion about a general strategy on the [[Escape Character Proposal]], to achive a consistent way of escaping.
-- [[ChristophSauer]], 2007-02-22
A way to escape "}}}" in inline nowiki sections is also needed. I see three main alternatives:
# Add a space after each "}" in the text. Then decrease the number of spaces after each "}" in the output. Quite intuitive IMO. But spaces are very frequent and users would need to add one more if they want some spaces after a closing brace.
# Add a dash (or another char) after each "}". Then decrease the number of dashes after each "}" in the output. Low probability of collision. Not as intuitive as space.
# Use the general escaping mechanism. But that would require user to take care of the escape char, when it appears in nowiki text.
-- [[Michele Tomaiuolo]], 2007-03-05
Just to clarify, this substitution would work for both blocks and inline nowiki sections:
{{{
"/} ( *)(?=})/"
=>
"}$1";
}}}
The rule "to include any trailing '}' into the nowiki span" should also be applied.
-- [[Michele Tomaiuolo]], 2007-03-05
Currently, the escape sequence for triple-right-brace in nowiki is {{{ }} }} }}{{{ }}} (without the spaces,
which I've added because wikicreole doesn't support Creole 0.5 yet). Do we need more than
that and normal escape character?
-- [[YvesPiguet]], 2007-03-05
== Nowiki: really?
Sorry for getting so late into the discussion, but I'd like anyway to tell my opinion about the matter: as [[Michele Tomaiuolo]] said, the tilde character cannot be typed in Italian keyboards (and I guess in other keyboards too) if not through a BlocNum Alt+ASCII combination.
(Note: I have recently added the {{{ nowiki }}} syntax to [WikiOnAStick] in the not-yet-released v0.9.3 Beta)
I am totally against an escape character in our wiki syntax because it looks like a mind trap to me, and it might make the WikiCreole rules complex and hard to learn.
I will explain what's the best solution in my opinion:
* no escape character either inside the {{{ nowiki }}} blocks and in the normal wiki source
* support of a "raw" transclusion
When your file includes the "}}}" you'd have to create a wiki page which will never be directly accessed but inline-transcluded in raw mode and shown without any wiki parsing.
This would also be efficient in case of big ASCII files.
-- [[DanieleC.]], 2007-Jul-05
The tilde is used in many programming languages and shells. I don't understand why an unused AltGr key combination isn't used
on PC. Mathematica [[http://support.wolfram.com/mathematica/international/italiankit/keyboard.html|hints]] at a utility to add the tilde. On Mac, there is no such problem. [[http://en.wikipedia.org/wiki/Keyboard_layout]] shows that among roman keyboards, icelandic, hungarian and romanian layouts lack the tilde too. If you feel the escape is important in your wiki, you could explain how to type them
with Alt, or have a button with Javascript to insert the character; otherwise, no problem...
The motivation for the tilde has already been discussed at length. Raw transclusion has pluses and minuses, but it isn't suitable in all situations (not all converters can fetch secondary files).
-- [[YvesPiguet]], 2007-Jul-05
Sorry for the apparently trivial reply: the average user won't type a character that he does not see on the keyboard ([AvoidSpecialCharacters]), I really feel that a slice of users is cut apart with the tilde - but if it's not the biggest slice, it could be anyway a good compromise.
About raw transclusion: it is (in my opinion) the only "clean" solution because it would separate the raw block of text from the wiki markup text, any other solution would require to modify the raw block of text. Just my 2cents; by the way, thanks for the additional informations.
-- [[DanieleC.]], 2007-Jul-06
=== User-defined block terminator ===
Here is one more idea for nowiki-block termination syntax - let user define the terminator:
{{{
{{{TERM1
nowiki-text
TERM1~}}}
{{{MY-DELIMITER-2
another nowiki-text, which can contain even TERM1~}}}
MY-DELIMITER-2~}}}
}}}
It can be used by advanced wiki users, who can include everything they like into nowiki-blocks in this way. Basic Creole 1.0 syntax is compatible with this concept (user-defined terminator defaults to empty string).
Same idea is used in Perl for example:
{{{
print <<EOT;
blabla
EOT
}}}
-- [[YaroslavStavnichiy]], 2007-12-15
Version Date Modified Size Author Changes ... Change note
44 15-Dec-2007 14:57 29.148 kB YaroslavStavnichiy to previous
43 15-Dec-2007 12:13 29.147 kB YaroslavStavnichiy to previous | to last
42 26-Sep-2007 09:31 28.525 kB ChuckSmith to previous | to last restore
41 26-Sep-2007 01:09 28.549 kB 194.9.85.141 to previous | to last
« This page (revision-44) was last changed on 15-Dez-2007 14:57 by YaroslavStavnichiy