[英]I would like to add line numbers to code samples on my web site. I would like to do this either thru CSS (generated content?) or javascript
See the code samples on http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/ where the code samples have line numbers. 请参阅http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/上的代码示例,其中的代码示例具有行号。 Turning Javascript off (in Firefox) shows these sections without the line numbers. 关闭Javascript(在Firefox中)将显示这些没有行号的部分。 I would like a script that accomplished line numbering. 我想要一个完成行编号的脚本。
Smashing Magazine, like many others, uses a JS library called SyntaxHighlighter . 与其他许多杂志一样,Smashing Magazine使用一个名为SyntaxHighlighter的JS库。
Another common one is Google Prettify . 另一个常见的例子是Google Prettify 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.