While I was setting up this blog, I installed WP-GeSHi-Highlight for X++ syntax high lighting. I wrote about it here. At the end of that post I wrote that I would edit the CSS of the plugin to make it look more like the X++ Editor.
I make a few small changes, this is what I have come up with so far:
/// This job is used as an X++ sample (From Wikipedia's Microsoft Dynamics AX page)
public static void xppTest3(Args _args)
select forupdate userInfo
where userInfo.id != 'Admin'
&& userInfo.RecId == 1234567890;
userInfo.enable = NoYes::No;
and this is the same code in the MorfX editor in 2012.
The original CSS produced this result:
I removed the dot from the line numbers and make the numbers turquoise. I also made the line height less. If you by chance use WordPress to write about X++ and have the WP-GeSHi-Highlight plugin, you are welcome to the changes I made to wp-geshi-highlight.css. The changes are small, but it just makes me feel a bit more at home with the way the code is displayed.
I’m still setting up the blog and was looking for a syntax highlighter plugin for X++. I tried a few highly rated syntax highlighters. Most does not have X++ support, so I tried using C++ and Java. All of the plugins formatted the code nicely and made the comments green, but of course did not make X++ keywords like select and while blue.
I consider X++ to be a niche, so I was surprised to find WP-GeSHi-Highlight that has support for X++. It’s highly customizable with arguments and CSS.
The plugin uses GeSHi highlight system, a .php library for formatting syntax on the web. I saw two other WordPress plugins based on GeSHi, but haven’t tried them yet:
It displays X++ code in WordPress like this:
Here’s the same code in the MorfX editor in 2012:
I’m going to try it and see how it goes. I’ll probably also make a few changes to the CSS to see if I can make it look more like the MorfX editor. I’ve noticed that it does not make integers red or comments italics, as you can see above.
UPDATE: I changed the CSS so that it looks a bit more like the MorfX editor. You can download the updated CSS at the end of this post.