Patchouli

Patchouli

168M Downloads

Feature Request: allow book.json macros to take arguments

desht opened this issue ยท 1 comments

commented

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.

commented

This issue is stale because it has been open for a while with no activity. Please bump if this is still an issue, or this ticket will be closed soon.