SketchUp / sketchup-yard-template

YARD Template used to generate SketchUp Ruby API documentations
MIT License
13 stars 5 forks source link

[tool] Notepad++ ERB-HTML Syntax Language Highlighting User Definition #17

Open DanRathbun opened 7 years ago

DanRathbun commented 7 years ago

Notepad++ ERB (for HTML) User Defined Syntax Language Highlighting

I used the User defined language feature of NPP to create some color lexing when working with ERB HTML template files.

I use black background so it's based on that. I post it here so any others might find it useful as a starting point. It will save you the trouble of inputting all the various keywords and delimiters. On the keywords panel, those for HTML are on the right, Ruby and ERB on the left. (On the right, top .. down are: HTML elements, HTML global attributes, HTML element specific and other attributes, and lastly: events.)

userDefineLang_ERB-HTML.xml.txt

To use with Notepad++, remove the temporary ".txt" from the file name. In NPP, open the Language > Define your language... dialog. At the top is a "Import..." button. Browse to where the xml file is, and choose OK. You should now have a "ERB-HTML" item at the bottom of the Language menu. You can select this lexing for any file you wish. It may have "erb" set as a filename so you may see new erb files opened afterward matching the lexing.

Just a note of caution. The Define your own lexing feature does have bugs. 1) Sometimes certain words of one type get shown in another types color. 2) I noticed when using my "Markdown" definition that sometimes the NPP save button does not know that I've modified the file. So I have to do a "Save As..." and overwrite, instead of a plain "Save".

thomthom commented 7 years ago

Is this something we perhaps should put in the Wiki section? So that we ensure it doesn't get lost in the issue tracker?

DanRathbun commented 7 years ago

I'd say create a "Tool" tag, tag it. then just link it from a "Contributing" section of the main "README" wiki .