qtc

command
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: MIT, MIT Imports: 18 Imported by: 0

README

qtc

Template compiler (converter) for quicktemplate. Converts quicktemplate files into Go code. By default these files have .qtpl extension.

Usage

$ go get -u github.com/valyala/quicktemplate/qtc
$ qtc -h

qtc may be called either directly or via go generate. The latter case is preffered. Just put the following line near the main function:

package main

//go:generate qtc -dir=path/to/directory/with/templates

func main() {
    // main code here
}

Then run go generate whenever you need re-generating template code. Directory with templates may contain arbirary number of subdirectories - qtc generates template code recursively for each subdirectory.

Directories with templates may also contain arbitrary .go files - contents of these files may be used inside templates. Such Go files usually contain various helper functions and structs.

Documentation

Overview

Command qtc is a compiler for quicktemplate files.

See https://github.com/valyala/quicktemplate/qtc for details.

Jump to

Keyboard shortcuts

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