Improve PlaintextSyntaxHighlighter#2560
Conversation
|
Thank you! Is that json format of some other tool / something generic where other languages can be fetched from? |
|
I referred to these projects for Markor's current JSON syntax highlighting configuration files. Their syntax highlighting definitions are advanced and sophisticated, I don't know how to directly use these files, so I just reused some basic regex from these files, such as keywords, variable, string, number, function and comment ... By the way, I found many text editors use TextMate grammars to highlight. Maybe we can use TextMate grammars for Markor, and if use it, we can directly use these syntax highlighting configuration files. 1. PrismJSPrismJS syntax highlighting configuration files 2. sora-editorUsing TextMate grammars. 3. Xed-EditorXed-Editor syntax highlighting configuration files Using TextMate grammars. 4. Visual Studio CodeUsing TextMate grammars. |
|
If you feel any is somewhat similar to whats feasible for Markor, feel free to rearrange the json/definition structure. I asked also because saw the keyword list and what came to my mind were Geany filedefs (https://github.com/geany/geany/blob/master/data/filedefs/filetypes.java) |
56822c0 to
f8dba13
Compare
|
Thanks, I did further improvements and fixes (i.e. it was crashing for files that are not one of those py/java/..). Good enough for getting it in use as first. Good also that its fully app internal for now (no external loading), this allows to further improve (i.e. change the language definition syntax). |

Make PlaintextSyntaxHighlighter have versatile languages syntax highlight function based on configuration files (JSON), and add several popular language (C, C++, Java, Python) syntax highlight. Which language to be highlighted depends on the plain text file extension.