ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Installing Scribuntu, for Lua on the wiki
@ 2013-05-23 12:46 Sietse Brouwer
  2013-05-24  7:17 ` Taco Hoekwater
  0 siblings, 1 reply; 2+ messages in thread
From: Sietse Brouwer @ 2013-05-23 12:46 UTC (permalink / raw)
  To: Taco Hoekwater, mailing list for ConTeXt users

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-24  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-23 12:46 Installing Scribuntu, for Lua on the wiki Sietse Brouwer
2013-05-24  7:17 ` Taco Hoekwater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).