amber

package module
v0.0.0-...-3a517e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2015 License: MIT Imports: 3 Imported by: 0

README

#Amber Render wercker status GoDoc GoCover

Amber template for Neko.

Usage

package main

import (
  "github.com/neko-contrib/amber"
  "github.com/rocwong/neko"
)
func main() {
  app := neko.Classic()
  //default: Options{BaseDir: "views", Extension: ".amber", PrettyPrint: true}
  //app.Use(amber.Renderer())
  app.Use(amber.Renderer(&amber.Options{BaseDir: "template", Extension: ".jade", PrettyPrint: true}))
  app.Run(":3000")
}

####type Options

type Options struct {
  // BaseDir represents a base directory of the amber templates.
  BaseDir string
  // Extension represents an extension of files.
  Extension string
  // Setting if pretty printing is enabled.
  // Pretty printing ensures that the output html is properly indented and in human readable form.
  // If disabled, produced HTML is compact. This might be more suitable in production environments.
  // Default: true
  PrettyPrint bool
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Renderer

func Renderer(options ...*Options) neko.HandlerFunc

Types

type Options

type Options struct {
	// BaseDir represents a base directory of the amber templates.
	BaseDir string
	// Extension represents an extension of files.
	Extension string
	// Setting if pretty printing is enabled.
	// Pretty printing ensures that the output html is properly indented and in human readable form.
	// If disabled, produced HTML is compact. This might be more suitable in production environments.
	// Default: true
	PrettyPrint bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL