Rumah  >  Artikel  >  hujung hadapan web  >  关于实现代码语法标亮 dp.SyntaxHighlighter_javascript技巧

关于实现代码语法标亮 dp.SyntaxHighlighter_javascript技巧

WBOY
WBOYasal
2016-05-16 19:19:431093semak imbas

呵呵,因为到现在为止,BLOG用的都是LBS,感觉缺少很多自己喜欢用的功能,这次终于下定决心自己写BLOG程序了,为兼容之前的BLOG,内容入库的格式仍会保持与LBS的一致。
因为自己的BLOG中贴代码会比较多,帮考虑用JS来实现对code的语法标亮效果。
以前曾看过了下dp.SyntaxHighlighter,但并未深入研究-_-
在新的BLOG中打算加入代码标亮功能,这段时间就先好好研究研究:)

参考地址:http://www.dreamprojections.com/syntaxhighlighter/

dp.SyntaxHighlighter is a free JavaScript tool for source code syntax highlighting.

The script is meant to help a developer to post code snippets online with ease and without having to worry about applying format. People who use blogs like MovableType, .Text (dotText), dasBlog and any other system can easily add code to their posts.

If you are looking to get syntax highlighter for your blog, give dp.SyntaxHighlighter a try!

演示地址:
http://www.cnlei.com/codelab/SyntaxHighlighter_1.4.1/index.html
Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn