asteroid 1.0-1
“Stupidly simple lua string templating”
README basename (markdown/plain text)Archive has a sub-10KB member
SHA-2568c246b041c0fd2d6ad67d422f7bf1742bc923cbe1cc773769d3f9dc25a3a85a4
MaleculeO(As)H(Cm)Md
Evidence
1# Asteroid
2
3Stupidly simple templating for Lua strings.
4
5Asteroid simplifies string templating by using simple template syntax instead of `string.fomrat` or concatenation. Designed for [Silvermoon](https://silvermoon.up.railway.app) HTML preprocessor, but it can be used in any Lua project.
6
7## How to use
8
9- Use `@name` to embed values
10- Put a `!` if you nee …
10:39… g input as value name, space also stops reading the value name
11- Use `\` (`\\` if using raw strings in Lua) to escaping characters
12- Make a template via `make_template` and then call it's `generate` method
13
14## Installation
⋯5 lines
⋯4 lines
23
24```lua
25local asteroid = require("asteroid")
26
27local template = asteroid.make_template("Hello, @user!! You have @amount coins!")
28
29print(template:generate({
30 user = "John",
31 amount = 100
32})) -- Output: Hell …
39:20… template.
40
41**Parameters:**
42
43- `string` - String with values
44- `config` - Configuration table (optional)
45
46**Returns:** Template object with a `generate …
24:10… m in_params? Template_Params default parameters for generators
25--- @return Template template template object
26function template:new(in_data, in_para …
No evidence locations were recorded for this file. Raw result