Contents
Table headings
I would like to add a new proposal about table headings.
For example, take a very simple table, like this one:
| head 1 | head 2 |
|---|---|
| cell 1 | cell 2 |
It was created using the following Creole 1.0-compliant code:
|=head 1 |=head 2 | cell 1 | cell 2
But it could be simpler and quicker to use exclamation marks:
! head 1 ! head 2 | cell 1 | cell 2
What do you think about it? -- AmauryBouchard
I can see at least two big problems with it:
- conflict/overlap with the existing Creole markup (quoting Zen of Python, "There should be one, and preferably only one, obvious way to do it.")
- exclamation mark is a popular character, appearing in many strange situations, sometimes at the beginning of the line (in Portuguese or Spanish), sometimes with strange spacing (in French) and sometimes just like that (when the users get very excited). You really don't want to have unexpected tables, especially when they are pretty rare. What if you want an exclamation mark in a table cell?
I can also see a number of smaller problems that somehow make this solution look bad in my eyes:
- It's very easy to miss the difference between "|" and "!"
- Some wikis use "!" for normal headings, but Creole uses "=". Allowing both for table headings would be inconsistent with allowing only = for normal headings.
- It's not obvious on which side of the header cell the exclamation mark should be located.
Of course, wiki engines that use Creole are free to extend it with its own markup, if their authors think it's necessary, but I really think this particular proposition is not thought out throughfully. -- RadomirDopieralski 2008-12-23 21:56:42
Colors
- These two features are absolutely necessary when you use a personal Wiki to take notes and manage to-do lists. It is possible with some HTML-based- or HTML-compatible- wikis, but it is a bit crappy and always time consuming.
For example :
<span style="background-color: yellow">Go back to work</span> <font color="red">Call mom</font>
- So, we can imagine something where we specify colors as with HTML. For example (just to explain my tought, not a real proposal):
[|yellow|Go back to work|] => black font on yellow background <|red|Call mom|> => red font
- But this solution is crappy as well. HTML color names are obvious for english-speaking people only. And it could be a big pain to manage background and foreground colors at the same time...
- Another solution is to let the user and/or the wiki provider define some labels, and use these labels to display the text in the wanted colors. For example:
<\LABEL:FOREGROUND_COLOR;BACKGROUND_COLOR/>
<\important:red/> => a colon is followed by a foreground color
<\urgent;yellow/> => a semi-colon is followed by a background color
<\todo:#c4acd8;orange/>
{{urgent{Go back to work}}}
{{important{Call mom}}}
{{current{Think about Creole Wiki}}}
--{{current{Yeah, but now it's done}}}--- Well, the "label idea" could be extended to other text rendering definition. For example:
<\LABEL:FGCOLOR;BGCOLOR!BOLD!STRIKE!UNDERLINE!ITALIC/>
<\important:red!bold/>
<\urgent;yellow!underline/>
<\done:grey!strike/>
{{urgent{Go back to work}}}
{{important{Call mom}}}
{{done{Yeah, but now it's done}}}But... it begins to go far away of the "keep it simple" principle... -- AmauryBouchard 2008-12-23
Sorry for being so negative, but again I have some problems with this proposal:
- There already are bold, italic and bold italic for basic highlighting. If you need more, there are additions with underlining and I think there was also strike through.
- If you don't like the looks of them, define styles to color them differently.
- If that is still not enough, you can define macros like <<important>>, <<note>>, <<example>>, etc.
- There is already a well defined and standard language for defining the looks of web pages -- it's called CSS. There is no need to invent your own, with its own bugs and problems.
- Wiki is not a web page design software, it's for dealing with content. I'm pretty sure we had a discussion about this for Creole 1.0 already, I will add a link if I find it. Sorry for being so negative. -- RadomirDopieralski 2008-12-23 22:38:15
I spent some time on the Creole 1.0 wiki, and I didn't find any discussion about text color. Maybe I missed it.
I don't agree with your arguments. I'm working on "wiki syntax-enabled personal notebooks and to-do lists" rather than usual wikis, and it brings special constraints.
- There is a real different usage between text emphasis (combination of bold, italic and underline) and highlight (font color and background color). Strikeout is slightly different, it is generally used to mark something done. I will not define styles to color them differently, because I want to manage them separately.
- Most of WYSIWYG editor and major electronic notebooks have an easy way to highlight text, like using a Stabilo pen on a real paper sheet. If you want to compete with such tools (well, I want) you need to provide these functionnalities.
- WikiCreole goals are "Cover the common things people need" and "Fast to type". It's not a nonsense to provide a clear syntax to manage text color.
- You can't reject it, saying that CSS exists and wiki are not for web design. There is no fundamental difference between "underline this text" and "highlight this text with an electronic Stabilo pen". Maybe you think that bold and italic and underline are used more often than color highlight, but it's not true in every usage. Try to use Google Notebook for a week: you will use color highlight and strikeout a lot more than bold and italic.
But, you get a point with CSS.
- It's a convenient mean to define styles.
- So, maybe we have to think about a clean wiki syntax to use CSS style on text?
- As you suggest, it can be done using the extension syntax <<...>>. But I'm not sure about the result.
- It could be something like:
- <<css:important>>Call mom<</css:important>>
- <<style:urgent>>Go back to work<</style>>
- But it begins to look like HTML markup, far away from wiki principles.
- It could be something like:
- And the extension syntax... is for extensions. As I see it, it's an important lack, so it would be better to have a native syntax for CSS.
-- AmauryBouchard 2008-12-24 09:32:00
Agreed about difference between emphasis (italic, different font like sans-serif/serif or monospace), and highlight (bold, color, different font size, letterspacing, background, underline). In "standard" wiki markup, as well as in books and similar texts, the number of different highlighting techniques is usually very limited -- because they are distracting, and because the readers will often want to add their own highlighting. You usually have some bold text, different sizes of headings, sometimes indentation or spacing. Books made specially for students will often have more highlights, like "notes", "warnings", "examples" and such -- but they are usually whole blocks of text, not just single words or phrases. So we have two kinds of highlights: inline and block.
Another observation is that you usually don't care about how the inline highlight really looks like, as long as it's consistent. You also want it to be short and convenient. I think that using markup like %%highlight%%, &&highlight&&, ::highlight::, @@highlight@@ and of course __highlight__ could be good choice. How they look exactly is irrelevant, as long as they are different and sticking out of the text.
Allowing decisions about exact looks of the elements in a multi-user environment like wiki is bound to cause inconsistencies and even conflicts, not to mention impairing accessibility and portability. For example, letting users choose the colors will hurt in environments where different users can use different themes with different background color.
The block highlights are easier -- their presentation may be defined in the theme, and they don't have to be as concise and easy to use -- so you can use regular macros or some variation of the preformatted block markup.
This is an example of a solution that seems nice to me. It still has a number of problems, of course, otherwise I would propose it already. -- RadomirDopieralski 2008-12-24 10:22:21 -- RadomirDopieralski 2008-12-24 10:22:21
Sorry Radomir, but I don't really understand what your solution is (beyond the "stay as we are" point). Yes, in a multi-user environment we must have consistency: the same meaning must be rendered the same way. But how can we define the different highlights needed by users?
A notebook or a todo-list has really constraints. Typically, it's based on bullet-point entries. And most of users care about how they can highlight these entries, because they will see a bold entry differently than a yellow-highlighted one or than a striked-out one. And from my point of view, each of them are inline hightlights.
So, I'm back to the question: How can we add highlights (with different "severity" levels) to text, staying in a wiki-style syntax? I think there is 2 ways to answer it:
- The style definition approach. As we say already, we can define all the CSS styles as we need. A todo-list platform would define some syslog-like priorities: info, notice, warning, ... It can translate them if necessary. But how use them the wiki-style?
- <<css:notice>>bla bla bla<</css>> => not really wiki-style
- something else?
- A criticity level approach. Let's see how titles are defined: =title=, ==sub-title==, ===sub-sub-title===, and so on. It should be possible to use a similar way to set text highlight. As you say previously (about my proposition for table headings), exclamation marks are used in several wikis to define titles. But this syntax wasn't taken for Creole syntax. Why not use it?
- !Go back to work! => written with an orange background
- !!Call mom!! => written with a yellow background
- !!!Check server monitoring!!! => written in bold on a yellow background
With the last proposition (using exclamation marks), the Creole syntax may only define the "concept", and let each wiki implementation deal with the style details.
This is how the original wiki (and later many clones) did it with "'". It resulted in a number of troubles.
Exclamation point is not used for titles precisely because it's not suitable to be used for markup -- it's too common in everyday text, both as a single character and in groups, also together with other punctuation. Consider "It's alive!!!", "!Que pasa!" (straight exclamation mark is often used in place of "¡" when the latter is not available).
It would be possible to use some less common character, and that's what I had in mind.
Repeating the markup character to indicate severity is troublesome if you allow nesting -- the text becomes impossible to parse without unbound lookahead, and some expressions become inherently ambiguous. -- RadomirDopieralski 2008-12-24 12:57:50
I understand your argument. Well, I'm not stuck on the exclamation mark character (but it has the advantage to express some kind of emphasis). All that I want is to find the best possible syntax to manage criticity levels of highlighting, and try to get a consensus about it from the people involved in Creole. So, we can think about it together: what syntax can be safely used?
- <!important text!>, <!!more important text!!>, <!!!even more important text!!!>, ... => Not so bad but looks a bit like HTML
- \!important text!/, \!!more important text!!/, ... => Looks ugly
- ^^important text^^, ^^^more important text^^^, ... => Pretty nice, but nesting problem. Do we want to allow nesting? I don't think so.
- ««important text»», «««more important text»»», ... => Very aesthetic, but these characters are not always easily accessible on usuable keyboards
Any other idea?
Damn, ^^ is already a Creole 1.0 addition for superscript...
-- AmauryBouchard 2008-12-24 17:19:00
I believe a general approach is needed for adding xhtml attributes (css flexibility is needed by EVERYONE) to 1.0 syntax, both block & inline elements. For instance
=== A level-3 heading === +class=important-heading +style=color:black;background-color:white;
A separate tag of course is needed to define the *important-heading* css class.
-- John (2008-12-30)
Perhaps I can suggest a possible way to include CSS styling (and I second the former writer in the need of it) that would fit rather naturally. I think the most needed way of CSS styling is adding CSS class names to an element. This way, the "basic" Creole elements could be extended if need be. My proposal is to mirror CSS syntax, i.e.:
.important This is an important paragraph! #myId This is a paragraph marked with an ID =#anotherID This is a first-level heading with fragment ID And **.myClass this is bold with myClass** to show inline use.
This would be a short way to express CSS styling (and providing fragment identifiers that could be used as targets). I've used a similar syntax for quite a while now, and it comes in very handy. It could be a way to systematically extend the Creole syntax. Two additional elements I would suggest are generic SPAN and DIV support so that special cases can be handled (i.e. "figure" with image and associated caption). Using the extension syntax to provide this looks a little bit awkward to me (I think it should be used for less generic needs).
I don't think that it is always necessary to have user-definable CSS styles (but perhaps this would be a good use for the extension syntax). I'm thinking more in the way of specific CSS styles provided by the maintainer of the Wiki.
-- ChristianAugustin (2009-02-22)
Hi Christian,
Starting a paragraph with a number sign (#) wouldn't be doable as that is already used for lists. The other ideas are very good though. I had a very similar suggestion (with a bit more typing):
{.important} This is an important paragraph!
{#myId} This is a paragraph marked with an ID
={#anotherID}This is a first-level heading with fragment ID
And **{.myClass}this is bold with myClass** to show inline use.-- StephenDay (2009-02-22)
Hi Stephen,
yes, I guessed that problem afterwards. With the system I used, there was a space needed after the number sign to get a numbered list (which is not recommended by Creole, as far as I remember). But what with bold (starting with a star) or monospace (proposed to use number signs)? Okay, it depends on the order of parser expressions and some context, maybe it simply works because it is a symmetric pattern etc., but it should have similar problems (think of nested lists, starting with two stars, followed by some bold text - how can the parser guess which stars should be paired ...).
Typing curly braces is tedious when touch typing on German keyboards (a little bit better on Mac, but very ugly on PC), but your suggestion looks quite reasonable. Another way could be to have another "special" character in front so that it is easier to type and does not need a closing character.
On the other hand, your suggestion opens some other possibilities, perhaps to include CSS:
{#myID $color: red; background: yellow;$ "This could be the title attribute" !de:DE}
This would be a paragraph with ID "myID", red font and yellow background,
a title attribute and a language attribute of "de:DE" ...Especially setting languages on paragraphs (or SPANs when using foreign words or phrases) is something to consider for a Wiki. Parsing is rather simple with your suggestion (BTW, the system I used had a similar syntax, using [...], and it was tedious in the long run; my suggestion was made to streamline typing and get rid of those hard to type characters).
Thanks for your suggestion (and I'm looking forward to Radomir's opinion ... ;-)
-- ChristianAugustin (2009-02-23)
After thinking about the # problem, there could be a rather simple solution by preceding an "attribute run" with a &:
&.important This is an important paragraph! &#myId This is a paragraph marked with an ID =&#anotherID This is a first-level heading with fragment ID And **&.myClass this is bold with myClass** to show inline use.
Not very nice looking, but easy and fast to type. Another way could be to start always with a dot (like .cssClass for CSS classes and .#myID for IDs).
-- ChristianAugustin (2009-03-02)
Indented Paragraphs
Oddmuse produces the following when using the Creole Additions extension:
<p>This is a normal paragraph.</p> <p style="margin-left:2em">This is an indented paragraph in two lines.</p> <p style="margin-left:4em">This is more indented.</p>
Is there any drawback that you can see?
The reason Usemod, Mediawiki, and Oddmuse with the Usemod markup extension use dl/dd to indent text is that this will also work on text browsers. It works without CSS, which is always a boon.
That reminds me of the fact that there is no "real" blockquote markup in Creole (indenting paragraphs is not the same in my opinion). But I have no idea how this could be done (other than using the extension/addition syntax). Ideas anyone?
Apart from this I would find the "original" approach (using DIVs to encapsulate the indented paragraphs) a little bit cleaner than using hardcoded styles for the paragraphs themself (there is a possibility of grouping consecutive paragraphs inside of one DIV). I wouldn't like the idea of "abusing" definition lists to indent text (even though they also work with text-only browsers -- but blockquote would do too). I know, it's all about "appearance" vs. "intention" ...
-- ChristianAugustin (2009-02-27)
(Hmm, discussing with myself ... ;-)
There was a proposal in Creole 1.0 for blockquotes:
""" This is blockquoted content, including all the "usual suspects", like * unordered lists ## numbered lists etc. """
Normally, blockquotes are indented by default and can be styled via CSS as the wiki maintainer likes it. It should work with text-only browsers and screen readers. And it would enable proper quoting of content. (And there was a proposal for inline quoting with ""..."" -- looks good to me).
-- ChristianAugustin (2009-03-01)
Additional attributes
MoinMoin's default "moin wiki" parser (not the creole wiki parser we also have) supports creole-like linking and transclusion. The link syntax was changed from moin 1.5 to 1.6 to get rid of the rather complex/broken old syntax and the respective complex/broken code in the parser.
I like the easy link syntax of creole much and even more to just have 2 fundamental things solved by some sane syntax:
- you can either link to something: [[...]]
- or you can transclude something: {{...}} (often used with images, but not limited to)
Consistent usage of those 2 patterns makes stuff much easier, better predictable and requires less magic.
But we had to extend that syntax a bit - just [[ target | label ]] is just not powerful enough.
We use now an (optional) 3rd field, like:
- [[ target | label | params ]] (for links)
- {{ target | label | params }} (for transclusion)
The params field can have stuff like:
- class=red - creates a class="red" attribute of the <a href=...> tag when used with a link
- &do=get - creates a query string argument "do=get" of the target url when used with a link
- height=100 - creates height="100" attribute of the <img src=...> tag when used with a image transclusion
- multiple params are separated by a comma
See http://master.moinmo.in/HelpOnLinking for details (this stuff was implemented in moin 1.6/1.7).
-- ThomasWaldmann 2009-03-02 12:07:47
Anchors
Another thing I recently found needing improvement is specification of anchors:
Currently moin 1.8.x just uses `TargetPageName#anchor` syntax.
If one allows # as a valid character in pagenames, this is of course a bit ambiguous and needs some hacks in some cases:
- we split pagename and anchor at the rightmost #
- if splitting results in empty anchor, it is treated the same way as no anchor
- if your pagename has a # inside, you can always add a # at the right to avoid having it split at the wrong place
- Example_#1 would be interpreted wrong, but hackish Example_#1# works around that (empty anchor
Better would be this:
[[ target_without_anchor | label | #anchor ]]
With that, the parser knows that there is never an anchor spec contained in the target, thus no ambiguity, no hacks needed. If someone wants to link to an anchor, it is given in the 3rd field.
Note that according to the URL RFC the anchor ("fragment id") has to be at the very end of an URL (so, if the URL has a query string, the anchor is AFTER the query string). Thus, having it a) separate from pagename and b) in the field where the qs stuff is also, is not that far fetched.
-- ThomasWaldmann 2009-03-02 12:07:47
Matching anchors to target IDs
Sometimes you want to create target IDs from stuff like headlines (and not give them some weird and arbitrary generated ID).
Problem: in headings, about everything from unicode is allowed, HTML IDs / fragment IDs just allow a small subset of this.
Thus, for generating IDs from some arbitrary text you need some id_encode(text) transformation.
If text contains only characters that are valid in IDs, that id_encode transformation should be an identity transformation (thus will output same text).
If text contains other characters, id_encode has to map them somehow to the valid chars:
- e.g. blank can get _
- unicode stuff can go through some utf-7 and url_encode transformation
- see http://hg.moinmo.in/moin/1.8/file/tip/MoinMoin/wikiutil.py function anchor_name_from_text() (we didn't call it id_encode, but it does that job)
With that, we can create a valid and sometimes even well readable ID from some arbitrary text (like some headline text).
BUT: assuming that there was some non-valid char in the original text (before in went through that id_encode transform), then the output used for the real ID will be different.
A wiki page author should not have to bother with this (most people are bad at utf-7 and urlencoding etc. :) ).
Thus, for the anchor links, we should use the same transformation, so they can simply give the same text there and the resulting anchor (fragment ID) in the URL will automatically match the generated ID at the target.
Example:
[[|jump to down there|#down there]] ... ... ... ... == down there ... ...
Notes:
- the 1st field of the link (usually the target) is empty, that shall mean "same page"
- the 3rd field (params field) needs more work, we need to quote somehow
- the IDs used in URL and HTML will be likely something like "down_there", but the wiki user does not need to know that
- for non-latin languages like chinese, the IDs will be completely unreadable (we can't do anything about that when auto-generating IDs)
-- ThomasWaldmann 2009-03-02 12:16:40
Indented Paragraphs
Use '>' and not ':'
I don't see why both should be supported. Especially as the colon is proposed for use in definition lists.
Allow leading spaces
Remove the requirement that the character (':' or '>') be the first on a line. This breaks with the Creole "convention" that leading spaces are OK.
-- StephenDay 31-March-2009
Line Comments
It is often useful to include comments (that you don't what to render) in raw wiki text.
I propose a mark-up for commenting on a line-by-line basis. This would not allow a line to mix rendered content and comments, thus making implementation easier. The choice of mark-up to use is up for debate. Here are some ideas:
<!-- Hard to remember and type. Implies a closing "-->" /* Better, but implies a closing "*/" # (or ##) Conflicts with existing mark-up Any other unused mark-up...
Comments inside pre blocks must be rendered.
-- StephenDay 4-April-2009
Basic used "'", but I suppose that's too common, even at the beginning of sentences. Windows .ini files and some other config files (dns zone files) use ";" for comments -- I think that this is rare enough. The question is, why do you need invisible comments? Isn't a wiki page an eternal work in progress? Why would you want to hide parts of it? Shouldn't everyone be invited to the unfinished text, not just the ones who click on edit?
I used % as a line comment sign with my parser. This is stolen from PostScript/PDF ;-)
-- ChristianAugustin, 2009-08-03
Numbered Headings
Are there any plans to introduce Numbered Headings, similar to how MS Word uses "Outline Numbered" sections.
Something like this:
1. Heading 1
Some text.
1.1 Heading 2
Some more text.
1.1.1 Heading 3
Even more text.
1.1.2 Heading 3
Even more text.
1.2 Heading 2
Even more text.
1.3 Heading 2
Even more text.
2. Heading 1
Even more text.
It would be similar to a numbered list for the headings, except that it includes all the numbers of the higher level headings.
Any comments? DanSmart - 23-Apr-2009
I don't think this is a good idea. Whether headings are numbered like this or not should be handled by the wiki engine, just like size or other styling. -- MarioLenz 2009-04-23 17:29:26
Automatic numbering introduces a number of problems: Should there be a way to skip a number and jump to the next one without a heading? A way to have an additional heading with the same number? How would you refer to the headings if they can be renumbered at any moment? If you still have to refer to them by text, what good are the numbers? What about wikis in different languages/scripts, what digits/numbering should they use? How should the numbers be formatted in right-to-left languages? What if you want to start numbering from the level two headings, or make level one headings start with a digit in front already (for example, when the page is just one of many chapters)? Not including this flexibility will make many users unhappy. Including it will turn Creole from a basic wiki markup standard into some kind of a professional, full-blown content preparation system that is hard to implement and learn. I think it's best to allow the authors/admins of particular wikis decide on how to handle numbering of headings, even if we risk that some of the content might suffer when moved between wikis. -- RadomirDopieralski 2009-04-23 18:33:04
