Hi Taco,

I'd like to propose thse three extensions for the wiki:

* Scribunto [1], which allows writing wikicode extensions in Lua. I
ran into a limitation of the template expansion system the other day.
Also, this may come in useful for the command reference. [2]
[1] http://www.mediawiki.org/wiki/Extension:Scribunto
[2] http://www.mail-archive.com/ntg-context@ntg.nl/msg68550.html

* BacktickCode, which allows writing `...` instead of <code>...</code>
— rather pleasant when writing about commands. The code needs a slight
modification so as to ignore backticks inside <texcode> and <context>
tags, too; see bottom of this e-mail.
http://www.mediawiki.org/wiki/Extension:BacktickCode

* Semantic Forms (which requirs Semantic Mediawiki), which allows
presenting people with a form when creating certain types of pages.
http://www.mediawiki.org/wiki/Extension:Semantic_Forms

How does that sound to you?
Thank you very much,

Sietse

Here's the modification to BacktickCode:

function backtickCodeParse( &$parser, &$text, &$stripState ) {
        // We replace '`...`' by '<code>...</code>' and '\`' by '`'.
        // Text between <pre> tags is not modified.
        $text = preg_replace_callback('/<pre>(.*?)<\/pre>/s', function
($match) {
            return '<pre>' . preg_replace('/`/', '\`', $match[1]) . '</pre>';
        }, $text);
+        $text = preg_replace_callback('/<texcode>(.*?)<\/texcode>/s',
function ($match) {
+            return '<texcode>' . preg_replace('/`/', '\`', $match[1])
. '</texcode>';
+        }, $text);
+        $text = preg_replace_callback('/<context>(.*?)<\/context>/s',
function ($match) {
+            return '<context>' . preg_replace('/`/', '\`', $match[1])
. '</context>';
+        }, $text);
        $text = preg_replace('/([^\\\\]|^)`([^`]*)`/',
'$1<code>$2</code>', $text);
        $text = preg_replace('/\\\\\`/', '`', $text);

        return true;
}
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to