Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DanRathbun opened this issue Jan 25, 2017 · 2 comments
Open

Comments

@DanRathbun
Copy link
Contributor

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
Copy link
Member

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants