CSS/JS to format and display code samples on a website [closed]

房东的猫 提交于 2019-12-11 06:54:51

问题


I'm looking for a set of CSS/JS code that would let me create special text areas with properly formatted and displayed code samples similar to this.

Would you please suggest a open source solution for this.


回答1:


This StackOverflow question may be of help. You might also want to check out code-highlighter. It highlights JavaScript, CSS, and HTML by default, but doesn't have line numbers. Here is an interesting solution that does have line numbers.

Also, google-code-prettify looks like a fairly mature and has pretty good support for a number of languages.




回答2:


SyntaxHighlighter version 2.1.364 (October 15 2009) http://alexgorbatchev.com

http://builtbywill.com/code/booklet/examples/size for a demo



来源:https://stackoverflow.com/questions/4688484/css-js-to-format-and-display-code-samples-on-a-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!