WAFasGBS ERB/HAML templates

Ken Webb 2013-04-15T14:48:40Z

Web App Frameworks as Graph-Based Software - ERB/HAML templates

Ruby on Rails apps (Rails 3) use ERB and HAML templates to render HTML content in web browsers.

For example, see a typical adopt-a-tree template file.

Here's what this Rails template file structure looks like when it's been read in by Xholon, using a simple Java parser:

The template files are not just tree structures. They also contain connections (directed edges in the terminology of graphs) to nodes that live in other parts of the overall Rails structure.

For example, t("defaults.thing") is a reference to the defaults thing node in a locale file.

en:
  ...
  defaults:
    ...
    thing: "tree"
...

The Xholon model can be exported in a wide range of formats. The following is part of a GraphML file. Node 582 is a line in the index.html.haml file. Node 397 is a key/value pair from the en.yml locale file. There are two edges (connections) from node 582 to node 397, an alt edge and a title edge.

The following figure shows one of these edges, as visualized using the Xholon JUNG tool.

Return to Web App Frameworks as Graph-Based Software.

return to main page