Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Modules

ADT
Database
GTK2
GUI
IP
PiJAX
Public
Sql
Stdio
Subversion
System
Tools
Xosd
lua
v4l2
wx

Recent Changes

Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0

Popular Downloads

Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48


Module Information
Public.Template.Mustache
Viewing contents of Public_Template_Mustache-1.0/README

Mustache 

Inspired by ctemplate and et, Mustache is a framework-agnostic way to render 
logic-free views.

As ctemplates says, "It emphasizes separating logic from presentation: it is 
impossible to embed application logic in this template language."

For a list of implementations (other than Ruby) and tips, see 
http://mustache.github.com/.

Using Public.Template.Mustache

Begin by verifying that you have Regexp.PCRE installed. If not, install the PCRE 
library and rebuild your pike, or run pike -x module in your _Regexp_PCRE module 
directory. You may need to clear out old .o files from your Pike module directory.

Next, install PCRERegexp.pike and the Public.pmod folder to a location in your 
Pike module path.

Now, run Pike (the -M. assumes you're just going to work in the module dist 
directory rather than install things):

$ pike -M.
Pike v7.8 release 352 running Hilfe v3.5 (Incremental Pike Frontend)
> object m = Public.Template.Mustache();
> m->to_html("{{greeting}}, {{audience}}!", 
       (["greeting": "Hello", 
         "audience": "world"]));
(1) Result: "Hello, world!"

And you're off to the races!

This code is still relatively young and may break or behave in unexpected ways. 
Please feel free to send bug reports to me; my contact info may be found in the 
AUTHORS file.

Bill Welliver, October 2011



gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University