//Define the table name SET vMyTable = 'MyTable1'; //Load in the table of data $(vMyTable)_Temp: LOAD A, B, text(C) & ' a string' AS C RESIDENT $(vMyTable);
Knowing that there are some very good automatic syntax highlighters for other languages out there, I started to explore whether it is possible to adapt one of them to solve this problem. After looking at quite a few I settled on Highlight.js, because of its capabilities, it's extensive list of currently supported languages and the fact that it is open source.
Borrowing on the work I did on the QlikView syntax highlighting for Notepad++ and UltraEdit, and a thanks to a few nights struggling to sleep, I have been slowly working on a custom build of Highlight to create QlikView Syntax Highlighting for the Web. There is still plenty of work to do but the above block of code is the first on this site (and for that matter any website) that has been automatically syntax highlighted using this new creation.
As you can see, it provides a reasonable approximation of the highlighting provided by QlikView and is roughly equivalent to the highlighting in Notepad++ and UltraEdit (in fact it is slightly better). It currently only supports QlikView script and has the following capabilities:
- Highlighting of all current (v11.20) functions
- Highlighting of all current (v11.20) keywords and statements
- Highlighting of line comments (//) and block comments (/* */ and REM ; )
- Highlighting of variable definitions (SET and LET)
- Highlighting the usage of variable within dollar-sign expansion $( )
To help make it as useful as possible to fellow QlikView bloggers, I intend to package it in 2 ways. The first is as a plugin for Wordpress, which is the most commonly used blogging platform. Having it as a proper Wordpress plugin means installing it on a Wordpress based site takes only a few seconds and doesn't involve changing any of the existing site files. It also means the highlighting can be triggered using a Wordpress shortcode. There will also be a version for manual inclusion in all other websites.
I've added the project to branch.qlik.com so that you can follow its progress and contribute should you wish. And obviously I'll be posting more here over the coming weeks about how things are progressing. Watch this space!