Feature Request: allow book.json macros to take arguments
desht opened this issue ยท 1 comments
Right now, book.json
macros allow a simple substitution from one string to another, as documented at https://github.com/Vazkii/Patchouli/wiki/Text-Formatting-101#custom-macros
It would be really useful if such macros could take arguments, either positional or named. For example (with named parameters):
"macros": {
"$(message:who)": "Hello, $(arg:who)!",
"$(require:x,a,y,b)": "This process requires $(arg:x) of $(arg:a) and $(arg:y) of $(arg:b)",
"$(require2:amount=1000,fluid)": "This process requires $(arg:amount)mB of $(arg:fluid)"
}
could be called as "$(message:who=world")
or $(require:x=3,a=cobblestone,y=5,b=diamond)
or $(require2:fluid=oil)
from some page text.