xtpl

package module
v0.0.0-...-7445ac0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 14 Imported by: 0

README

xtpl

Go Report Card

Шаблонизатор Golang

Пример использования в файле xtpl_test.go

Пример синтаксиса в testdata/templates/index.tpl

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CycleLimit

func CycleLimit(limit uint)

CycleLimit Установка ограничения, на максимальное количество итераций в циклах. По умолчанию 10000

func Debug

func Debug(on bool)

Debug Переключение в режим отладки. В этом режиме, все изменения в шаблонах подхватываются налету, однако обработка шаблона занимет больше времени

func EmbeddedFs

func EmbeddedFs(fs fs.FS)

func Functions

func Functions(functions map[string]interface{})

Functions Загрузка пользовательских функций в шаблонизатор.

func String

func String(source string, data map[string]interface{}, writer io.Writer) error

String Обработает строку как шаблон

func View

func View(tplPath string, data map[string]interface{}, writer io.Writer) error

View Обработка шаблона

func ViewExtension

func ViewExtension(extension string)

ViewExtension Расширение файлов шаблона

func ViewsPath

func ViewsPath(path string)

ViewsPath Путь к корневой директории с шаблонами

Types

This section is empty.

Jump to

Keyboard shortcuts

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