Revision [4006]
This is an old revision of InlineCommentFormatter made by DarTar on 2005-01-05 15:39:58.
Inline comment formatter
See also: WantedFormatters
I've modified formatters/wakka.php so as to recognize a new formatter for inline comments.
When adding inline comments, we used to adopt a combination of indents and note markup, which produces hardly readable discussions and frequent inconsistencies.
Syntax
The new InlineCommentFormatter introduces a simple syntax, similar to that of unordered lists.To produce an inline comment Use & preceded by one or more indents (or ~).
To append a child comment to an existing comment use the above syntax with an extra indent (or an extra ~) - much as you append a subitem to an existing list item.
~& Comment
~~& Subcomment
~~~& Subsubcomment
gives:
- Comment
- Subcomment
- Subsubcomment
Example
Note:
To correctly display the following example you need to revert to the default wikka skin (TestSkin). Otherwise, you will just see an ordinary list.
Here's how it looks like:
- This is the father of all comments -- DarTar
- Well, I don't agree with your point of view -- DarTär
- Could you please explain why? -- DarioTaraborelli
- I'm not sure I feel like giving any explanation -- DarTär
- And I'm not sure I feel like listening to your explanation -- DarTär
- Well, it looks like we've found an agreement -- DarTar
Installation
This formatter has been uploaded to this server as a beta feature. If you want to install it locally, follow these instructions:
1. Modify formatters/wakka.php
You first need to modify the wakka formatter in three different places.
A) original
// indented text
elseif (preg_match("/\n([\t,~]+)(-|([0-9,a-z,A-Z,ÄÖÜ,ßäöü]+)\))?(\n|$)/s", $thing, $matches))
elseif (preg_match("/\n([\t,~]+)(-|([0-9,a-z,A-Z,ÄÖÜ,ßäöü]+)\))?(\n|$)/s", $thing, $matches))
A) modified
// indented text
elseif (preg_match("/\n([\t~]+)(-|&|([0-9a-zA-ZÄÖÜßäöü]+)\))?(\n|$)/s", $thing, $matches))
elseif (preg_match("/\n([\t~]+)(-|&|([0-9a-zA-ZÄÖÜßäöü]+)\))?(\n|$)/s", $thing, $matches))
B) original
elseif ($newIndentType == "-") { $opener = "<ul><li>"; $closer = "</li></ul>"; $li = 1; }
else { $opener = "<ol type=\"". substr($newIndentType, 0, 1)."\"><li>"; $closer = "</li></ol>"; $li = 1; }
else { $opener = "<ol type=\"". substr($newIndentType, 0, 1)."\"><li>"; $closer = "</li></ol>"; $li = 1; }
B) modified
elseif ($newIndentType == "-") { $opener = "<ul><li>"; $closer = "</li></ul>"; $li = 1; }
elseif ($newIndentType == "&") { $opener = "<ul class=\"thread\"><li>"; $closer = "</li></ul>"; $li = 1; } #inline comments
else { $opener = "<ol type=\"". substr($newIndentType, 0, 1)."\"><li>"; $closer = "</li></ol>"; $li = 1; }
elseif ($newIndentType == "&") { $opener = "<ul class=\"thread\"><li>"; $closer = "</li></ul>"; $li = 1; } #inline comments
else { $opener = "<ol type=\"". substr($newIndentType, 0, 1)."\"><li>"; $closer = "</li></ol>"; $li = 1; }
C) original
"======|=====|====|===|==|".
"\n([\t,~]+)(-|[0-9,a-z,A-Z]+\))?|".
"\{\{.*?\}\}|".
"\n([\t,~]+)(-|[0-9,a-z,A-Z]+\))?|".
"\{\{.*?\}\}|".
C) modified
"======|=====|====|===|==|". # headings
"\n([\t~]+)(-|&|[0-9a-zA-Z]+\))?|". # indents and lists
"\{\{.*?\}\}|". # actions
"\n([\t~]+)(-|&|[0-9a-zA-Z]+\))?|". # indents and lists
"\{\{.*?\}\}|". # actions
2 Add a new class to your stylesheet (default: css/wikka.css)
ul.thread {
list-style-type: none;
border-left: 2px #666 solid;
padding-left: 10px;
margin: 5px 0px;
}
ul.thread li {
color: #333;
font-size: 12px;
}
list-style-type: none;
border-left: 2px #666 solid;
padding-left: 10px;
margin: 5px 0px;
}
ul.thread li {
color: #333;
font-size: 12px;
}
Suggestions for improving the inline comments style are welcome :)
CategoryDevelopment CategoryLayout