开发者

Good Wordpress Theme/plugin for showing off code examples and scripts [closed]

开发者 https://www.devze.com 2022-12-26 09:25 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract o开发者_开发技巧pinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

I have an ancient version of Wordpress and its WYSIWYG editor really mucks up code examples in my blogs (removing lines and whitespace when saved, etc).

I wish to upgrade and install a theme/plugin that will make it easy to display code in a pleasant way.

Any suggestions?


Many sites use Google Code Prettify for syntax highlighting on code, and people have developed wordpress extensions that make it easy to add GCP to a blog. Here's an example of one:

http://www.deanlee.cn/wordpress/google-code-prettify-for-wordpress/


I recommend Syntax Highlighter Evolved. http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/

You can use shortcodes like [php] or [css] to contain your source code, and it will be rendered nicely when you view the post/page.


I recommend WP-Syntax. From the usage notes:

Wrap code blocks with <pre lang="LANGUAGE" line="1"> and </pre> where LANGUAGE is a GeSHi supported language syntax. The line attribute is optional.

0

精彩评论

暂无评论...
验证码 换一张
取 消