The MindTouch 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) 2006-2009 MindTouch Inc.</copyright>
<description>This extension contains functions for embedding Scratch applications.</description>
<uri.help>http://developer.mindtouch.com/App_Catalog/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>
|
| File | Size | Date | Attached by | |||
|---|---|---|---|---|---|---|
| SyntaxHighlighting1.PNG No description | 120.13 kB | 00:30, 1 May 2008 | BrigetteK | Actions | ||
| SyntaxHighlighting2.PNG No description | 119.81 kB | 00:30, 1 May 2008 | BrigetteK | Actions | ||
| SyntaxHighlighting3.PNG No description | 132.75 kB | 00:30, 1 May 2008 | BrigetteK | Actions | ||