add API for specifying text role directive parsers and role functions