From 1936cfdcc34aafc9592d847c455e0e62f262a371 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 26 Jul 2011 12:11:22 -0400 Subject: [PATCH] updated syntax highlighting test page to use codeblock instead of highlight and added objective c test --- source/docs/blogging/code/test/index.markdown | 60 ++++++++++++------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/source/docs/blogging/code/test/index.markdown b/source/docs/blogging/code/test/index.markdown index b744402..c36b9c9 100644 --- a/source/docs/blogging/code/test/index.markdown +++ b/source/docs/blogging/code/test/index.markdown @@ -32,8 +32,7 @@ sidebar: false {% gist 996818 %} -

syntax_test.php

-{% highlight php %} +{% codeblock Testing PHP (syntax_test.php) %} -{% 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 %} -

syntax_test.hs

-{% highlight hs %} +{% codeblock Testing Haskel (syntax_test.hs) %} {-# LANGUAGE OverloadedStrings #-} module Main where @@ -109,10 +132,9 @@ sass :: Compiler Resource String sass = getResourceString >>> unixFilter "sass" ["-s", "--scss"] >>> arr compressCss -{% endhighlight %} +{% endcodeblock %} -

syntax_test.sh

-{% highlight sh %} +{% codeblock Testing Bash (syntax_test.sh) %} #!/bin/bash cd $ROOT_DIR @@ -140,10 +162,9 @@ case "$PLATFORM" in fi ;; -{% endhighlight %} +{% endcodeblock %} -

syntax_test.py

-{% highlight py %} +{% codeblock Testing Python (syntax_test.py) %} # test python (sample from offlineimap) class ExitNotifyThread(Thread): @@ -212,10 +233,9 @@ class ExitNotifyThread(Thread): set.""" return self.exitmessage -{% endhighlight %} +{% endcodeblock %} -

syntax_test.pl

-{% highlight perl %} +{% codeblock Testing Perl (syntax_test.pl) %} #!perl -w # Time-stamp: <2002/04/06, 13:12:13 (EST), maverick, csvformat.pl> @@ -250,10 +270,9 @@ while() } close F; -{% endhighlight %} +{% endcodeblock %} -

syntax_test.java

-{% highlight java %} +{% codeblock Test Java (syntax_test.java) %} import java.util.Map; import java.util.TreeSet; @@ -270,10 +289,9 @@ public class GetEnv { System.out.printf("%s = %s\n", k, env.get(k)); } } } -{% endhighlight %} +{% endcodeblock %} -

syntax_test.c

-{% highlight c %} +{% codeblock Test C (syntax_test.c) %} #define UNICODE #include @@ -301,4 +319,4 @@ int main(int argc, char **argv) { return 0; } -{% endhighlight %} +{% endcodeblock %}