JuliaTagBot / HAML.jl

HTML Abstract Markup Language for Julia. Inspired by Ruby's HAML.

Home Page:https://tkluck.github.io/HAML.jl/stable/

Repository from Github https://github.comJuliaTagBot/HAML.jlRepository from Github https://github.comJuliaTagBot/HAML.jl

HAML.jl

HTML Abstract Markup Language for Julia. Inspired by Ruby's HAML.

Build Status Test coverage
Coverage Status

Synopsis

The easiest way to use HAML in Julia is in the form of the haml"" macro. Just write your HAML code in-line and it will expand to a string:

julia> using HAML

julia> link = "https://youtu.be/dQw4w9WgXcQ"

julia> haml"""
       %html
         %body
           %a(href=link) Hello, world!
       """ |> print
<html>
  <body>
    <a href='https://youtu.be/dQw4w9WgXcQ'>Hello, world!</a>
  </body>
</html>

It is also possible to store HAML in a file and execute it from there:

julia> write("/tmp/test.hamljl", """
       %html
          %body
             %a(href=\$link)= \$greeting
       """)
47

julia> render(stdout, "/tmp/test.hamljl", variables=(link=link, greeting="Hello, world!",))
<html>
   <body>
      <a href='https://youtu.be/dQw4w9WgXcQ'>Hello, world&#33;</a>
   </body>
</html>

In this case, note that input variables need to be quoted with a dollar sign $. This distinguishes them from file-local variables.

Syntax

If you are already familiar with Ruby-flavoured HAML, read about the differences here. If not, either use read the getting started guide or the syntax reference.

About

HTML Abstract Markup Language for Julia. Inspired by Ruby's HAML.

https://tkluck.github.io/HAML.jl/stable/

License:Other


Languages

Language:Julia 98.6%Language:Haml 1.3%Language:HTML 0.0%Language:JavaScript 0.0%