3

In NotepadQQ, I would like to add G-code and PLC (FBD, LD, ST, IL and SFC) programing language definitions/syntax code highlighting. Is this possible for a user to do this? How is it done? I found a post about how to add a language https://github.com/notepadqq/notepadqq/issues/164 but it is a bit beyond my knowledge base. Here is the gist of the post:

It's not possible to migrate XMLs from Notepad++ to Notepadqq. They're completely different formats. The best way is to write it from scratch.

This is the CodeMirror documentation for writing modes (aka syntax highlighters)

And this is an example of a syntax highlighter for makefiles written by a Notepadqq contributor

It seems some knowledge of a formating language is needed to create such a makefile. And I don't see how to implement it into notepadqq on my computer.

  • as best I can tell, your question has nothing to do with makefiles. Because this is your tag, you will probably not get many answers, or even views. – Mark Galeck Oct 30 '17 at 06:52
  • 1
    @MarkGaleck thank you. I tried putting in Notepadqq but there is no tag for it (although there are 9 posts) and I don't have enough reputations in stackoverflow to add a new one. Can you think of some other tags that would be useful? I did find editor. – Geoffrey Wheeler Oct 30 '17 at 10:35
  • 1
    @GeoffreyWheeler I have the same need. Did you get anything? – kran1um May 03 '18 at 12:59
  • 1
    @PauloHenrique No, how do you think we can rephrase the question to get a good response? It would be great to be able to add a *NotepadQQ* tag? – Geoffrey Wheeler May 21 '18 at 02:23

1 Answers1

2

NotepadQQ uses CodeMirror "modes" to handle language highlighting.

This page describes how to add them (a little out dated, look for Languages.json instead of Languages.js). https://github.com/notepadqq/notepadqq/wiki/How-to-let-Notepadqq-see-a-new-CodeMirror-language-(mode)

Look for those paths in your installation folder, which might be something like appdata/editor/...

It's probably easiest to select one of the existing languages that matches your new language and modify it to your needs.

You can find how to create modes here (they're just JavaScript): https://codemirror.net/demo/simplemode.html

g01d
  • 651
  • 5
  • 24