Revision [4006]

This is an old revision of InlineCommentFormatter made by DarTar on 2005-01-05 15:39:58.


Inline comment formatter

Last edited by DarTar:
New formatter proposal
Wed, 05 Jan 2005 15:39 UTC [diff]

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.

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



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 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))

A) modified
        // indented text
        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; }

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; }

C) original


C) modified

    "======|=====|====|===|==|".        # headings
    "\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;

Suggestions for improving the inline comments style are welcome :)

CategoryDevelopment CategoryLayout
There are 5 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki