Skip to content

Commit

Permalink
Add EEx (Embedded Elixir)
Browse files Browse the repository at this point in the history
EEx is embedded Elixir: http://elixir-lang.org/docs/v1.0/eex/. Here's
some in-the-wild usage on Github: https://github.com/search?p=100&q=extension%3Aeex+NOT+nothack&ref=searchresults&type=Code&utf8=✓

This uses the "html_elixir" Ace mode, which was added in this pull
request on the Ace project: ajaxorg/ace#2696
  • Loading branch information
Jeff Kreeftmeijer committed Oct 9, 2015
1 parent acfad43 commit b34acac
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ vendor/grammars/elixir-tmbundle:
- source.elixir
- text.elixir
- text.html.elixir
- text.html.eex
vendor/grammars/erlang.tmbundle:
- source.erlang
- text.html.erlang.yaws
Expand Down
10 changes: 10 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,16 @@ HTML+Django:
- htmldjango
ace_mode: django

HTML+EEX:
type: markup
tm_scope: text.html.eex
group: HTML
aliases:
- eex
extensions:
- .eex
ace_mode: html_eex

HTML+ERB:
type: markup
tm_scope: text.html.erb
Expand Down
26 changes: 26 additions & 0 deletions samples/HTML+EEX/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<h1>Listing Books</h1>

<table>
<tr>
<th>Title</th>
<th>Summary</th>
<th></th>
<th></th>
<th></th>
</tr>

<%= for book <- @books do %>
<tr>
<%# comment %>
<td><%= book.title %></td>
<td><%= book.content %></td>
<td><%= link "Show", to: book_path(@conn, :show, book) %></td>
<td><%= link "Edit", to: book_path(@conn, :edit, book) %></td>
<td><%= link "Delete", to: book_path(@conn, :delete, book), method: :delete, data: [confirm: "Are you sure?"] %></td>
</tr>
<% end %>
</table>

<br />

<%= link "New book", to: book_path(@conn, :new) %>

0 comments on commit b34acac

Please sign in to comment.