Ruby中的等效库对于Python来说是CodeRay和Pygments,
提前致谢!
解决方法
我自己已经找了很长时间才找到一个漂亮而强大的Cocoa Syntax Highlighter,因为我现在正在构建一个面向代码的文本编辑器,这将是该项目的一个主要部分.
所以,我发现有很多Objective-C/C++ocoa友好的语法突出显示库/组件.对于启动器(对于相对基本的东西,即),我建议你看一下:
> OkudaKit(使用CSS进行样式设计)
> UKSyntaxColoredTextDocument by Uli Kusterer(非常好的尝试)
但是,如果你真的需要一些功能强大,经过良好测试且仍然可以使用Cocoa的东西,我肯定会建议你试试the Scintilla component (for Cocoa).代码很棒,社区(Scintilla-Interest集团)很乐意帮你解决任何问题.遭遇.
简而言之 :
我目前正在使用一个即将发布的大项目,它对我来说很漂亮.
火花
Scintilla is a free library that provides text-editing functions,with
an emphasis on advanced features for source code editing. SciTE
(cross-platform),Geany,Notepad++ (Windows),and Notepad2 (Windows)
are examples of standalone editors based on Scintilla.
正在使用的Scintilla编辑组件(SciTe)
特征
Scintilla supports many features to make code editing easier in
addition to Syntax highlighting. The highlighting method allows the
use of different fonts,colors,styles and background colors,and is
not limited to fixed-width fonts. The control supports error
indicators,line numbering in the margin,as well as line markers such
as code breakpoints. Other features such as code folding and
autocompletion can be added.
>下载Scintilla(Cocoa支持已集成在主项目中):http://www.scintilla.org/SciTEDownload.html
>示例项目(将Scintilla与Cocoa集成):
http://bazaar.launchpad.net/~mike-lischke/scintilla-cocoa/trunk/files/head:/cocoa/ScintillaTest/
>有关完整文档,请查看:Scintilla Documentation