0010.txt
来自「用ruby on rails写的一个博客程序,还不错..ruby on rail」· 文本 代码 · 共 21 行
TXT
21 行
Once you've written your new syntax module, you need to register it with the Syntax library so that it can be found and used by the framework. To do this, just add it to the @Syntax::SYNTAX@ hash:{{{lang=ruby,number=true,caption=Registering a new syntaxrequire 'syntax'class SimpleTokenizer < Syntax::Tokenizer ...endSyntax::SYNTAX['simple'] = SimpleTokenizer}}}That's it! Once you've done that, you can now use your syntax just by requiring the file that defines it, and then using the standard Syntax framework methods:{{{lang=ruby,number=true,caption=Using your new syntaxrequire 'simple-tokenizer'require 'syntax/convertor/html'convertor = Syntax::Convertors::HTML.for_syntax "simple"puts convertor.convert( "hello 15 worlds!" )}}}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?