ninox-d_gotmpl ~master

A dlang template system, compatible with golang templates


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

ninox.d-gotmpl

This package provides a template system like go's text/template.

License

The code in this repository is licensed under AGPL-3.0-or-later; for more details see the LICENSE file in the repository.

Usage

To use the engine, you first need to parse a template. To do this, use one of the parse* variants of Template:

import ninox.gotmpl : Template;

// This parses a template from the string "content", and gives it the name "name".
auto tmpl = Template.parseString("name", "content");

// This method parses a template from a file, and gives it the name "name".
auto tmpl = Template.parseFile("name", "path/to/template");

// It is also possible to parse directly from a libc stream handle (`FILE*`):
import core.stdc.stdio : FILE;
FILE* file = /*...*/;
auto tmpl = Template.parseFile("name", file);

Differences:

  • Unimplemented builtin functions:
    • printf
    • html
    • js
    • urlquery
    • slice
Authors:
  • Mai-Lapyst
Dependencies:
ninox-d_std:callable, ninox-d_std:variant, ninox-d_std:string
Versions:
1.0.2 2024-Jul-23
1.0.1 2024-Jul-23
1.0.0 2024-Jul-23
~master 2024-Jul-23
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 3 downloads total

Score:
0.3
Short URL:
ninox-d_gotmpl.dub.pm