Skip to content

dvaumoron/indentlang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IndentLang

A templating language mainly to output balised language (html, xml, etc.).

usage

Start by importing the template package :

import "github.com/dvaumoron/indentlang/template"

And use it in two step:

// parse a template
tmpl, err := template.ParsePath(tmplPath)
// and use it
err = tmpl.Execute(writer, data)

With the input (indentation matters):

html
    head
        meta @charset="utf-8"
        title "Hello World"
    body
        h1 @class="greetings" "Hello World"

The output will look like (cleaned):

<html>
    <head>
        <meta charset="utf-8"/>
        <title>Hello World</title>
    </head>
    <body>
        <h1 class="greetings">Hello World</h1>
    </body>
</html>

The file indentlang.go is an adapted copy of engine.go for demo and testing purpose (see examples).

More examples can be found here.

See API Documentation.

About

A templating language mainly to output balised language (html, xml, etc.).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages