Wanted Wikka formatters

Last edited by RobertLeckie
Tue, 25 Mar 2008 14:03 UTC [diff]
 


I created this page to list proposals about formatters that might be implemented in future Wikka releases.
Feel free to add your ideas/comments.

Preformatter

Modifies data before it goes into the database, adding signatures, typographical sharpness and ensuring all ampersands are properly escaped.
See PreFormatter
-- IanAndolina

Inline comments formatting

See InlineCommentFormatter
-- DarTar

User-oriented formatters

Beside better formatters for tabular data (see below) I think it's time to consider implementing some features that are largely requested by wiki users: footnotes and tables of content. (see below the discussion on named anchors)

Table formatters

A good wikka syntax for tabular data is IMO one of the top priorities for future Wikka development. Some WikkaTables ideas have already been suggested.

More <div> formatters

I find quite limiting that Wikka only includes formatters for flush-left and flush-right divs. I would like to see a larger set of formatters, that - in association with CSS selectors - might be used to output absolute-positioned divs, bordered divs, divs with different degrees of padding/margin etc.

System formatters

 

It might be interesting - in the spirit of the {{lastedit}} and {{version}} action - to have a set of formatters for printing specific system-related information (GmBowen has also recently suggested something in this lines). I am not sure, though, whether this function should be implemented as a set formatters or as an action.

It would be nice to have in page linking so you can jump directly to a section of a page in the format PageName#Section you could then reuse the Wacko {{ancher}} action to inset the code.


I think that the current forced link formatter should be improved to allow GET parameters, anchors and titles to be parsed as part of valid internal links.

For example it would be nice if we could not only use forced links like:
[[HomePage Internal forced link]]
or
[[http://www.google.com External forced link]]
but also the following:

[[HomePage (? "par1=ba,par2=bo") Internal forced link]]
[[HomePage (# "this") Internal forced link]]
[[HomePage (§ "This is a link to the HomePage") Internal forced link]]

But I don't have a clue on how to modify the current formatter to send to the Link() function all this stuff.


Might be relevant for the present discussion: MeatBall:CleanLinking

-- DarTar

Superscript annd subscript (<sup>/<sub>)
Ticket:160 (text higher or lower in the line than normal)

There are only simple changes needed to add wikka-formatters for superscript and subscript text; the bigger problem are the markup-formatters:
- for superscript: ^^ (seems most logical)
- for subscript: vv (would be logical, but perhaps problematic?) ?? and ?? are unused, but are no logical choice.


Anyway, changes necessary to formatters/wakka.php (with ^^ and vv):
add to the list of static variables (after trigger_center = 0;)
        static $trigger_sup = 0;
        static $trigger_sub = 0;


add after if ($trigger_bold % 2) echo('</strong>');
            if ($trigger_sup % 2) echo '</sup>';
            if ($trigger_sub % 2) echo '</sub>';


change the long line a little below to:
            $trigger_bold = $trigger_center = $trigger_floatl = $trigger_inserted = $trigger_deleted = $trigger_italic = $trigger_keys = $trigger_sup = $trigger_sub = 0;


add after the //center block:
        // higher text
        else if ($thing == "^^")
        {
            return (++$trigger_sup % 2 ? "<sup>" : "</sup>");
        }
        // lowered text
        else if ($thing == "vv")
        {
            return (++$trigger_sub % 2 ? "<sub>" : "</sub>");
        }


and finally change the line with #Wiki Markup (near the end) to:
    "\*\*|\'\'|\#\#|\#\%|@@|::c::|\>\>|\<\<|&pound;&pound;|&yen;&yen;|\v\v|\^\^|\+\+|__|<|>|\/\/|". # Wiki markup


CategoryDevelopmentFormatters
Comments
Comment by GmBowen
2004-12-14 17:39:38
There's a link on the CodeContributions page to a table mod for wikini that looks pretty good....it might be easily adaptable to wikka.
Comment by BlueNode
2005-03-22 00:28:18
Perhaps, with regards to the superscript/subscript format, one could use
/\superscript/\ (forwardslash,backslash)
and
\/subscript\/ (backslash,forwardslash)
Comment by JasRandal
2005-04-12 18:47:50
Or what about two commas ,, for subscript?
Comment by MasinAlDujaili
2006-10-05 09:42:17
Concerning "A better formatter for forced internal links":
What about the following syntax -- just ignoring any brackets:
[[HomePage#this!"This is a link to the Homepage" Internal forced link]]
resulting in <a href="http://wikkawiki.org/HomePage#this" title="This is a link to the Homepage">Internal forced link</a>.

Using quotes as a delimiter should be sufficient to get it to work. This way, the link text then is all text after the first space after the second quote. We could even drop the quotes if we use exclamation mark for beginning and ending of link title:
[[HomePage#this!This is a link to the Homepage! Internal forced link]]
[[HomePage!This is a link to the Homepage!#this Internal forced link]]
Comment by MasinAlDujaili
2006-10-05 09:47:38
Addendum: For query parameters we could use
[[HomePage?par1=ba?par2=bo? Internal forced link]]
Thus ending the queries with a closing question mark.

More complicated: Forced Links Formatter
??parameter=value??
!!link title!!
##anchor
=>
[[HomePage##this!!This is a link to the Homepage!!??par1=ba??par2=bo?? Internal forced link]]

But that's too much I guess :-)
Comment by DarTar
2006-10-05 11:53:25
Masin, two short notes on this point:
- if we extend the current link markup, we might want to take into account the Creole recommendations (on which several wiki developers have recently agreed see http://www.wikicreole.org/);
- common parameters like "title", "id" etc. will adopt a syntax similar to the one currently introduced for tables in the development code, using brackets, so:

[[(t:hello)Home Internal forced link]]

<<(i:myfloat)howdy<<

will be parsed as:

<a href="Home" title="hello">Internal forced link</a>

<div id="myfloat" class="floatl">howdy</div>
Comment by BrianKoontz
2006-10-05 15:16:21
Here's a riddle: At what point does a "simplified" markup language morph into a markup language more complex than the one it's designed to emulate?

This is just an observation. I've not read through all of the wikicreole documentation, but what is striking about this is that at some point, the level of syntactical knowledge required to edit a wiki page will be on par with that required to develop a simple HTML page -- at which point, one might as well just code in HTML to begin with!

Don't get me wrong -- I'm all for enhanced markup...I just hope we don't lose sight of the simplicity in which most wikis (especially Wikka!) excel.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki