gohaml: github.com/realistschuckle/gohaml Index | Files

package gohaml

import "github.com/realistschuckle/gohaml"

The gohaml package contains a HAML parser similar to the one found at http://www.haml-lang.com.

You can find the specifics about this implementation at http://github.com/realistschuckle/gohaml.

Index

Package Files

haml.go http.go lang.go loader.go parser.go tree.go

Constants

const ATOM = 57347
const FOR = 57348
const IDENT = 57346
const RANGE = 57349

Variables

var Output inode

func NewHamlHandler Uses

func NewHamlHandler(base string) (hndl http.Handler, err error)

create an http.Handler that loads haml files from locations relative to base dir, taking into account that they won't end in *haml in the http request. Translates URLs such that:

/bla.html -> ${base}/bla.haml /bla/bla/dingdong.html -> ${base}/bla/bla/dingdong.haml /bla/bla/ -> ${base}/bla/bla/index.haml

type Engine Uses

type Engine struct {
    Autoclose       bool
    Indentation     string
    IncludeCallback func(string, map[string]interface{}) string
    // contains filtered or unexported fields
}

Engine provides the template interpretation functionality to convert a HAML template into its corresponding tag-based representation.

Available options are:

engine.Options["autoclose"] = true|false, default true

The Options field contains the values to modify the way that the engine produces the markup.

The Indentation field contains the string used by the engine to perform indentation.

The IncludeCallback field contains the callback invoked by the gohaml engine to process other files included through the %include extension.

func NewEngine Uses

func NewEngine(input string) (engine *Engine, err error)

NewEngine returns a new Engine with the given input.

func (*Engine) Render Uses

func (self *Engine) Render(scope map[string]interface{}) (output string)

Render interprets the HAML supplied to the NewEngine method.

type Lexer Uses

type Lexer struct {
    // contains filtered or unexported fields
}

func (*Lexer) Error Uses

func (l *Lexer) Error(e string)

func (*Lexer) Lex Uses

func (l *Lexer) Lex(v *yySymType) (output int)

type Loader Uses

type Loader interface {
    Load(id interface{}) (entry *Engine, err error)
}

func NewFileSystemLoader Uses

func NewFileSystemLoader(dir string) (loader Loader, err error)

Package gohaml imports 11 packages (graph) and is imported by 3 packages. Updated 2016-07-31. Refresh now. Tools for package owners.