The Deki Wiki syntax extension provides built-in support for highlighting syntax of popular programming languages. This extension is based on the work done by Alex Gorbatchev on the syntaxhighlighter project. To use it:
Note that it is also possible to use syntax highlighting on file data, rather than page content. To do this, pass the output of web.text to the syntax extension:
| Output | ||
|
<extension>
<title>Scratch Extension</title>
<label>Scratch</label>
<copyright>Copyright (c) 2007, 2008 MindTouch, Inc.</copyright>
<description>This extension contains functions for embedding Scratch applications.</description>
<uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/Scratch</uri.help>
<uri.logo>http://scripts.mindtouch.com/logos/scratch-logo.png</uri.logo>
<function>
<name>scratch</name>
<description>Embed a Scratch application.</description>
<param name="id" type="str">Application User/ID.</param>
<param name="width" type="num" optional="true">Application width. (default: 482)</param>
<param name="height" type="num" optional="true">Application height. (default: 387)</param>
<return>
<html xmlns:eval="http://mindtouch.com/2007/dekiscript">
<body>
<applet id="ProjectApplet" style="display:block" code="ScratchApplet" codebase="http://scratch.mit.edu/static/misc" archive="ScratchApplet.jar" eval:width="web.size(args.width ?? 482)" eval:height="web.size(args.height ?? 387)">
<param name="project" eval:value="'../../static/projects/' .. args.id .. '.sb'" />
</applet>
<a eval:href="'http://scratch.mit.edu/projects/' .. args.id">Learn more about this project</a>
</body>
</html>
</return>
</function>
</extension> |