WordPress RouterOS Syntax Highlighting

When looking for a syntax highlighting solution for WordPress I asked a few people. I also did the Google thing and searched. I came across a plugin that looked promising called SyntaxHighlighter Evolved by Alex. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev . It’s what WordPress uses in their hosted solution.

Anyways, it supports brushes which allow you to extend the highlighting to additional languages. Someone had already made a Brush for RouterOS for the JavaScript package, but in order to use it it with the WordPress plugin it had to be packed into it’s own plugin which I’ve done.  I improved the brush by adding more keywords from the Notepad++ syntax highlighter from the Mikrotik forums and Andrew’s blog.

I still need to test all the keywords, and add custom highlights that match WinBox coloring.

Here it is:

syntaxhighlighter-routeros 1.0.0

  1. Install SyntaxHighlighter Evolved.
  2. Install this plugin.
  3. Use [ros] and [/ros] around your code.

3 Comments on “WordPress RouterOS Syntax Highlighting

  1. Hey, I tried your shortcodes and it looks good, but I’m getting ‘junk’ that looks like this:
    :local username "<span style="color: #ff0000;">YourUserNameHere</span>"
    :local password "<span style="color: #ff0000;">YourPasswordHere</span>"
    :local hostname "<span style="color: #ff0000;">YourHostAddress</span>"
    any idea what I might have wrong here?

  2. Jim,

    Sorry about the long delay, I don’t get emails when comments are waiting around for approval. I guess I should get on that.

    I’m not sure but it looks like the html tags are getting included in the ros tags. Try switching to HTML mode in the WP editor and doing just the ROS code between the tags.

Leave a Reply

Your email address will not be published. Required fields are marked *