Skip to content

An Elixir library for rendering slim templates

License

Notifications You must be signed in to change notification settings

vicmargar/slim_fast

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlimFast Build Status Hex Version License

A refreshing way to slim down your markup in Elixir.

SlimFast is an Elixir library for rendering slim templates as HTML.

Easily turn this:

doctype html
html
  head
    meta name="keywords" description="slim fast"
    title = site_title
  body
    #id.class
      ul
        = Enum.map [1, 2], fn x ->
          li = x

Into this:

<!DOCTYPE html>
<html>
<head>
  <meta name="keywords">
  <title>Website Title</title>
</head>

<body>
  <div class="class" id="id">
    <ul>
      <li>1</li>
      <li>2</li>
    </ul>
  </div>
</body>
</html>

With this:

SlimFast.render(slim, site_title: "Website Title")

Phoenix

To use slim templates (and SlimFast) with Phoenix, please see PhoenixSlim.

Precompilation

Templates can be compiled into module functions like EEx templates, using functions SlimFast.function_from_file/5 and SlimFast.function_from_string/5.

Contributing

Feedback, feature requests, and fixes are welcomed and encouraged. Please make appropriate use of Issues and Pull Requests. All code should have accompanying tests.

License

Please see LICENSE for licensing details.

About

An Elixir library for rendering slim templates

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%