Echo the contents of a file, string interpolation
Adds a new file, echofile.lua
Primarily, this module contains functions for echoing file contents, but I decided to add interpolation/templating to it because
- I'm tired of not having string interpolation
- It makes it more useful for dynamic page generation using templates
- I'm tired of not having string interpolation (not a typo, I'm that tired of it)
As an example, take the following file contents in file getMudletHomeDir() .. "/hechotest"
#ff0000 #ff0b00 #ff1600a#ff2000 #ff2b00l#ff3600u#ff4000m#ff4b00i#ff5600n#ff6000e#ff6b00s#ff7600c#ff8000ent#ff8c00 #ff9800b#ffa300u#ffaf00t#ffba00t#ffc600e#ffd100r#ffdd00f#ffe800l#fff400y#ffff00 fl#e8ff00o#d1ff00a#baff00t#a3ff00s#8cff00 #74ff00a#5dff00b#46ff00o#2fff00u#18ff00t#00ff00 la#00ff18z#00ff2fi#00ff46l#00ff5dy#00ff74 #00ff8co#00ffa3n#00ffba #00ffd1b#00ffe8r#00ffffill#00f4ffa#00e8ffn#00ddfft#00d1ff #00c6ffb#00baffl#00afffu#00a3ffe#0098ff #008cffa#0080ffnd #0c75ffl#1869ffi#235effl#2f52ffa#3b46ffc#463bff #522fffw#5e23ffi#6918ffn#750cffg#8000ffs
{GM.hgradient(" a luminescent butterfly floats about lazily on brillant blue and lilac wings\n", {255,0,0}, {0,0,255})}
You can output the following using hechoFile(f"{getMudletHomeDir()}/hechotest")
if you've installed the functions globally and have the gradientmaker in GM. https://demonnic.github.io/mdk/1.1.4/modules/echofile.html has more info