updated syntax highlighting test page to use codeblock instead of highlight and added objective c test

This commit is contained in:
Brandon Mathis 2011-07-26 12:11:22 -04:00
parent 6d652b1b46
commit 1936cfdcc3

View File

@ -32,8 +32,7 @@ sidebar: false
{% gist 996818 %} {% gist 996818 %}
<h3 class="filename">syntax_test.php</h3> {% codeblock Testing PHP (syntax_test.php) %}
{% highlight php %}
<?php <?php
require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/country/common.php"); require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/country/common.php");
require_once($GLOBALS['g_campsiteDir']. "/classes/SimplePager.php"); require_once($GLOBALS['g_campsiteDir']. "/classes/SimplePager.php");
@ -63,11 +62,35 @@ echo camp_html_breadcrumbs($crumbs);
<td><a href="add.php"><?php putGS("Add new"); ?></a></td> <td><a href="add.php"><?php putGS("Add new"); ?></a></td>
</tr> </tr>
</table> </table>
{% endhighlight %} {% endcodeblock %}
{% codeblock Testing Objective C (Cocoa1AppDelegate.m) %}
#import "Cocoa1AppDelegate.h"
@implementation Cocoa1AppDelegate
@synthesize window,siteUrl,pageContents;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
model = [[Cocoa1Model alloc] init];
}
- (IBAction)getSiteContents:(id)sender {
[model setPageUrl:[siteUrl stringValue]];
NSString* reply = [model getUrlAsString];
NSLog(@"pageSrc: %@", reply);
[pageContents setString:reply];
[[[pageContents textStorage] mutableString] appendString:reply];
}
@end
{% endcodeblock %}
<h3 class="filename">syntax_test.hs</h3> {% codeblock Testing Haskel (syntax_test.hs) %}
{% highlight hs %}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Main where module Main where
@ -109,10 +132,9 @@ sass :: Compiler Resource String
sass = getResourceString >>> unixFilter "sass" ["-s", "--scss"] sass = getResourceString >>> unixFilter "sass" ["-s", "--scss"]
>>> arr compressCss >>> arr compressCss
{% endhighlight %} {% endcodeblock %}
<h3 class="filename">syntax_test.sh</h3> {% codeblock Testing Bash (syntax_test.sh) %}
{% highlight sh %}
#!/bin/bash #!/bin/bash
cd $ROOT_DIR cd $ROOT_DIR
@ -140,10 +162,9 @@ case "$PLATFORM" in
fi fi
;; ;;
{% endhighlight %} {% endcodeblock %}
<h3 class="filename">syntax_test.py</h3> {% codeblock Testing Python (syntax_test.py) %}
{% highlight py %}
# test python (sample from offlineimap) # test python (sample from offlineimap)
class ExitNotifyThread(Thread): class ExitNotifyThread(Thread):
@ -212,10 +233,9 @@ class ExitNotifyThread(Thread):
set.""" set."""
return self.exitmessage return self.exitmessage
{% endhighlight %} {% endcodeblock %}
<h3 class="filename">syntax_test.pl</h3> {% codeblock Testing Perl (syntax_test.pl) %}
{% highlight perl %}
#!perl -w #!perl -w
# Time-stamp: <2002/04/06, 13:12:13 (EST), maverick, csvformat.pl> # Time-stamp: <2002/04/06, 13:12:13 (EST), maverick, csvformat.pl>
@ -250,10 +270,9 @@ while(<F>)
} }
close F; close F;
{% endhighlight %} {% endcodeblock %}
<h3 class="filename">syntax_test.java</h3> {% codeblock Test Java (syntax_test.java) %}
{% highlight java %}
import java.util.Map; import java.util.Map;
import java.util.TreeSet; import java.util.TreeSet;
@ -270,10 +289,9 @@ public class GetEnv {
System.out.printf("%s = %s\n", k, env.get(k)); System.out.printf("%s = %s\n", k, env.get(k));
} }
} } } }
{% endhighlight %} {% endcodeblock %}
<h3 class="filename">syntax_test.c</h3> {% codeblock Test C (syntax_test.c) %}
{% highlight c %}
#define UNICODE #define UNICODE
#include <windows.h> #include <windows.h>
@ -301,4 +319,4 @@ int main(int argc, char **argv) {
return 0; return 0;
} }
{% endhighlight %} {% endcodeblock %}