indentlang

command module
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

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).

See API Documentation.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
gin
Package ginadapter implements LoadTemplatesAsRender to supply a gin compatible HTMLRender.
Package ginadapter implements LoadTemplatesAsRender to supply a gin compatible HTMLRender.

Jump to

Keyboard shortcuts

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