2013年4月8日 星期一

SyntaxHighlighter for Objective-C

網路上有很多教學文章 有興趣的自己去找 我弄出來的效果如下

- (void)viewDidLoad
{
    [super viewDidLoad];
 // Do any additional setup after loading the view, typically from a nib.
 
 // 1 - Add array of personal quotes
 self.myQuotes = @[
       @"Live and let live",
    @"Don't cry over spilt milk",
    @"Always look on the bright side of life",
    @"Nobody's perfect",
    @"Can't see the woods for the trees",
    @"Better to have loved and lost then not loved at all",
    "The early bird catches the worm",
    @"As slow as a wet week"
    ];
 
 // 2 - Load movie quotes
 NSString *plistCatPath = [[NSBundle mainBundle] pathForResource:@"quotes" ofType:@"plist"];
 self.movieQuotes= [NSMutableArray arrayWithContentsOfFile:plistCatPath];
}

shBrushObjC.jsshCore.css 我是在 這邊 下載的
如果連結死了可以直接套用我上傳在google site的

shThemeDefault.cssshCore.js可以直接套用SyntaxHighlighter官網的host
Theme還有其他範本 可以上官網看

要支援其他語言的話 把shBrushObjC.js替換成官方其他語言就好

沒有留言:

張貼留言