jet

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 1 Imported by: 0

README

Jet Template Engine for Revel

The Jet Templating Plugin

Jet is a template engine developed to be easy to use, powerful, dynamic, yet secure and very fast.

  • supports template inheritance with extends, import and include statements
  • descriptive error messages with filename and line number
  • auto-escape
  • simple C-like expressions
  • very fast execution – Jet can execute templates faster than some pre-compiled template engines
  • very light in terms of allocations and memory footprint
  • simple and familiar syntax
  • easy to use

Profit:

  • Extremely fast
  • Perfect syntax
  • Correct (When i developed blog module the pongo2 is working not correct for me)
  • Extendable
  • Custom renderers for model is really cool

Jet wiki

The Jet Wiki Templating Plugin

Details

Extending Jet Module

import (
  "ohyo.network/modules/jet"
)
....
// Should extend after module registered
// use onAppStart hook or AddInitEventHandler on 
// REVEL_AFTER_MODULES_LOADED State

jet.Engine.AddGlobalFunc("base64", func(a jet.Arguments) reflect.Value {
  a.RequireNumOfArguments("base64", 1, 1)

  buffer := bytes.NewBuffer(nil)
  fmt.Fprint(buffer, a.Get(0))

  return reflect.ValueOf(base64.URLEncoding.EncodeToString(buffer.Bytes()))
})
....

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Engine link to extend functionality
	Engine *jet.Set
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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