Code Friendly Block Quotes

I have a self-hosted Wordpress Blog (located atif you're interesed :) I put a lot of Code Snippets on there, beca

I have a self-hosted Wordpress Blog (located at if you're interesed :)

I put a lot of Code Snippets on there, because I'm a programmer. How do I make these "snippets" code friendly? Right now, I am using a simple Blockquote around each one and it converts all single and double apostrophes into strange symbols that will not work when the code is actually copied and pasted.

I am willing to convert to a new theme, or alter an existing one.

Thanks!

I have a self-hosted Wordpress Blog (located at http://www.dougmolineux/wp if you're interesed :)

I put a lot of Code Snippets on there, because I'm a programmer. How do I make these "snippets" code friendly? Right now, I am using a simple Blockquote around each one and it converts all single and double apostrophes into strange symbols that will not work when the code is actually copied and pasted.

I am willing to convert to a new theme, or alter an existing one.

Thanks!

Share Improve this question asked Jan 11, 2011 at 1:58 Doug MolineuxDoug Molineux 1155 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 4

Geshi

In general the Geshi library is a popular library for formatting code ( http://qbnz/highlighter/)

Geshi as a WordPress plugin

For WordPress several authors "packaged" Geshi in a plugin. take your pick: http://wordpress/extend/plugins/search.php?q=geshi

The one I use

Personally I use this plugin: http://wordpress/extend/plugins/codecolorer/. This one works by enclosing all pieces of codes with a [cc lang="bla"] code [/cc] tag where you can specify things like language, width, line numbering, etc…

Example

WP - SyntaxHighlighter Evolved

This is my favorite one, I had issues with others not processing the content correctly (despite being defined as the right language):

URL:

http://wordpress/extend/plugins/syntaxhighlighter/

Description:

SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without losing it's formatting or making any manual changes. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev.

Screenshot:

Both options mentioned above are good... but if all you need is to highlight syntax, you will probably need something less robust like the wp syntax it is compatible with wordpress up to version 3.5.1: as at the time of view you site, i noticed you're still running wordpress 3.3.1, dont worry, this will still work for you.

http://s-plugins.wordpress/wp-syntax/assets/banner-772x250.jpg

without line number

with line number

Works Fine with PHP, Ruby, Java and many other popular development languages

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745456182a4628495.html

相关推荐

  • Code Friendly Block Quotes

    I have a self-hosted Wordpress Blog (located atif you're interesed :) I put a lot of Code Snippets on there, beca

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信