Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Syntax Highlighting for HTML Files with <script type="tmpl_handlebars">

Currently I'm working on a Project with Handlebars (JS Template Engine) and I'm using eclipse for development. The problem is, that eclipse doesn't offer syntax highlighting for my Handlebars-Templates. My Templates are enclosed in tags. Syntax highlighting in works as expected.

Screenshot:

http://i.stack.imgur.com/1tPyz.png

Is it possible, that Eclipse also highlights this code (at the best with HTML Syntax Coloring)?

like image 337
Markus Avatar asked Apr 21 '12 12:04

Markus


People also ask

Is it possible to enable syntax highlighting for HTML/template?

Suggestion: for html/templateit could be an extension of the default html syntax highlighting for VSCode, capable of highlighting both HTML and code inside {{ }}on HTML template files. The highlighting could be activated for files with extensions: .gohtmlor .go.html .gotmplor .go.tmpl Sorry, something went wrong. Copy link

How to enable syntax highlighting in Sahi_Install_folder?

If you are using .js extension, copy apis.sah from <SAHI_INSTALL_FOLDER>/userdata/scripts into the scripts folder in the project and rename it as apis.js. Open any .js (or .sah) file from the JavaScript project, and you should be able to see Syntax highlighting.

Does HTML/templateextend vs code's syntax highlighting for go's default tags?

It would be great to have html/templateextend VS Code's HTML syntax highlighting and add support for Go's default tags {{and }}and the logic in between them. The text was updated successfully, but these errors were encountered:

How to use sahieclipseeditortemplates in Eclipse?

Press OK on the Templates window. SahiEclipseEditorTemplates.xml has now been successfully imported. To make use of any template, type the first few letters of the template and press Ctrl + Space to bring up the template proposal. Here are a few examples.


2 Answers

If you are using PHP, you can fool Eclipse by adding empty php tag:

<scrip<?php ?>t type="tmpl_handlebars" id="tmpl_places">
    <article> 
       <h1> 
          ...
       </h1>
    </article>
</script>
like image 152
neparkiraj Avatar answered Sep 25 '22 17:09

neparkiraj


You would have to find a plug-in which supports that template engine. The HTML Editor provided by Eclipse uses the value of the type/language attributes to find the classes that provide syntax coloring, content assist, etc. The possibility is there, but out of the box, it only provides for JavaScript.

like image 26
nitind Avatar answered Sep 23 '22 17:09

nitind