Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting Java code in WordPress posts, like in Eclipse

Tags:

wordpress

I am about to write some posts which has some Java code, and I would like to format it properly by coloring the Java keywords. Like in Eclipse.

I am looking for some recommendation for a theme / plugin to use.

like image 701
Gaurav Avatar asked Dec 20 '22 16:12

Gaurav


2 Answers

It looks like it's rather standard nowadays:

[code language="css"]
   Your code here
[/code]

As described here by WordPress itself.

like image 163
gkephorus Avatar answered Jan 16 '23 18:01

gkephorus


The Chili code formatter is a good WordPress plugin to do that.

Alternative link: WP Chili

You could have some other plugins with this page or this other one.

However, it has not been updated for since 2010. Maybe you should use much recent one like the WP Code plugin.

It seems new versions of WordPress have already included the support of code posting. It is very interesting for me too, LOL.

like image 36
BendaThierry.com Avatar answered Jan 16 '23 19:01

BendaThierry.com