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
- Install SyntaxHighlighter Evolved.
- Install this plugin.
- Use [ros] and [/ros] around your code.
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?
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.
RouterOS script syntax highlighting for Atom editor.
https://atom.io/packages/language-routeros-script