0005.txt
来自「用ruby on rails写的一个博客程序,还不错..ruby on rail」· 文本 代码 · 共 19 行
TXT
19 行
Colorizing code has already been touched on briefly in the Introduction chapter (under "Quick Start"). To review, the process is a mere three steps:# Require the class for the type of the output you want (currently, only HTML is supported).# Obtain an instance of the convertor, for the syntax you wish to convert.# Call @#convert@ on that convertor, passing in the text you want to convert. The return value is the HTML representation of the colorized text.For example:{{{lang=ruby,number=true,caption=Colorizing a Ruby script# Step 1: require the HTML convertorrequire 'syntax/convertor/html'# Step 2: get an instance of the HTML convertor for the Ruby syntaxconvertor = Syntax::Convertor::HTML.for_syntax "ruby"# Step 3: convert the text to HTMLputs convertor.convert( File.read( "program.rb" ) )}}}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?