JCL*_*CLL 0 ruby syntax-highlighting
在网页上显示Ruby代码的最佳工具是什么?
你是怎样做的?
(像 http://www.khelll.com/blog/ruby/stackoverflow-cool-ruby-questions-4/
有很多这样的工具.Stack Overflow使用google-code-prettify.如果你喜欢这里发布的代码格式,你可能想要使用.Ruby示例:
<pre class="prettyprint lang-ruby">
def sum(n)
result = 0
i = 1
while i <= n
result += i
i += 1
end
return result
end
</pre>
Run Code Online (Sandbox Code Playgroud)
结果将如下所示:
def sum(n)
result = 0
i = 1
while i <= n
result += i
i += 1
end
return result
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2299 次 |
| 最近记录: |