realistschuckle / gohaml

An implementation of the popular XHTML Abstraction Markup Language using the Go language.
MIT License
95 stars 13 forks source link

!https://travis-ci.org/realistschuckle/gohaml.png?branch=master!:https://travis-ci.org/realistschuckle/gohaml

h1. What is it?

You can find out more about HAML at "haml.info":http://haml.info/ You can find out more about GO at "golang.org":http://golang.org

I've tried to remain diligent about reproducing the output from the canonical Ruby-based parser, so if you feel familiar with the one, then you should feel familiar with the other.

This branch compiles with 6g/8g "go version go1.0.3."

h1. Is it done?

I think so. It has...

If you would like another feature added, just log an issue and I'll review it forthright.

h1. How can I install this?

To install the library for use in your project, you can use goinstall.

pre. go get "github.com/realistschuckle/gohaml"

h1. How can I install this from source?

In a "Go workspace":http://golang.org/doc/code.html#tmp_2, create a directory for @gohaml@. mkdir -p src/github.com/realistschuckle/gohaml Clone the @gohaml@ repository into that newly created directory. git clone git://github.com/realistschuckle/gohaml.git src/github.com/realistschuckle/gohaml Now build and install it. go install github.com/realistschuckle/gohaml

h1. How can I use it?

How about something like this? Save it, compile it, link it, and run it!

bc.. package main

import ( "github.com/realistschuckle/gohaml" "fmt" )

func main() { var scope = make(map[string]interface{}) scope["lang"] = "HAML" content := "I love <\n=lang<\n!" engine, _ := gohaml.NewEngine(content) output := engine.Render(scope) fmt.Println(output) // Prints "I love HAML!" }