I use jinja to write templates. This makes me work with files like the one below.
\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\newcommand\devtool[1]{\fbox{#1}}
\begin{document}
$f(x) = <:f:>$ .
\end{document}
To test my templates before using it, I would like that <:f:> works like \devtool{f}.
In other words, I would like to activate the sequences <: ... :> to be similar to \devtool{...}.

process_input_buffercallback in LuaTeX, but still... wouldn’t it be easier to just use your editor to string replace<:by\devtool{and:>by}in each document? – Gaussler Oct 14 '22 at 11:38