Skip to content

About Salal

haskelt edited this page May 12, 2021 · 2 revisions

Salal is a tool that is similar to make or maven, but designed for building websites instead of C/C++/Java programs. In Salal web pages are described using XML "source" files. With the help of the Jinja template engine, Salal "compiles" these source files into HTML, CSS, and JavaScript that can be deployed to a web server.

In Salal, the equivalent of a function or method is a template. An example of a simple template is shown below:

<div class="event-listing__event-location">
  <div class="event-listing__event-location--location">
    {{this.venue}}, {{this.address}}, {{this.city}}, {{this.state}}
  </div>
  <div class="event-listing__event-location--map">
    <a href={{this-map}}>Get Directions</a>
  </div>
</div>

You can "call" this template in your source file like this:

<event-location venue="Plucked Strings Club" address="291 S Grandview" city="Acme" state="WA" map="https://goo.gl/maps/WPR8SoK19yjGBSq1A"/>

Although this example just does simple text substitution, like an old-fashioned C macro, templates are free to utilize the full power of Jinja if they wish, which includes conditional statements, loops, and even loading data from a configuration file.

In many cases, you might have some HTML, some CSS, and some JavaScript that all work together to implement a particular web element or type of functionality. Salal lets you bundle all that code into a module, thus supporting encapsulation and making it easy to reuse code across projects. You can also create larger-scale bundles of reusable templates and code called themes.

Clone this wiki locally