Hi All
I thought that having syntax highlighting in Notepad++ for TELEMAC steering files would be great. Here are the pros:
- better readability of the files
- verification of the keywords (i.e. they are not highlighted if incorrectly spelt)
We know that often new steering files are created from existing ones, so most keywords are already there, but errors can creep up, and syntax highlighting requires no effort and can only save time.
I have created a XML file that you can load into Notepad++ that sets up the syntax highlighting. This requires a recent version of Notepad++ (as the XML file syntax has changed not so long ago). All the keywords (English and French) have been included in the XML file.
There are 4 syntax setups contained in the XML file, one that works for all TELEMAC steering files (i.e. T2D, T3D and Sisyphe), and one set for each individual module.
The first one is nice with different colours for each module, but because some keywords are repeated between modules there are some steering files where colours get a bit mixed up. Hence why it can be good to use a setup for one individual module.
Here are a few limitations for now:
- with French keywords, the syntax highlighting gets mixed up with the single quote.
- ARTEMIS and Tomawac (or Mascaret) are not included yet.
- with some keywords defined in multiple dico (cf. above), the colours can look a bit mixed-up and the order of the keyword groups matter (currently kw1 Sisyphe, kw2 T2D, kw3 T3D).
You can find the XML file in the attachments.
In Notepad++ v6.6.9, you need to go to Language > Define your own language, then click on Import and select the XML file.
I have also created a python script to generate the list of keywords automatically by reading the dico files. This script is also in the attachments, as well as the text file it generates.
In order to update the XML file or a future release of Telemac, the python script needs to point to the new tag and run. Then each linein the text file needs to be pasted in the XML at the following nodes <Keywords name="Keywords1"> <Keywords name="Keywords2"> <Keywords name="Keywords3"> <Keywords name="Keywords4"> <Keywords name="Keywords5">.
Hope you find this useful.
Julien