How to add custom {{pseudo-field}} placeholders for card-creation?

Can I allow users to design cards using new {{myaddon:function(something)}} placeholders provided by my add-on?

I would also like them to be able to accept arbitrary arguments

{{myaddon:function("a literal value")}}, {{myaddon:function(AnotherField)}}

I think something like {{myaddon function(something):}} instead could be implemented (notice the colon at the end), because Anki will treat anything after the colon as a field name (and shows an error if the field doesn’t exist).

See for an example of implementing custom field filters using hooks:

4 Likes