Pandoc Lua filter to convert role attributes to classes for every element of a document.
This is particularly handy for Docbook documents, which usually use the role attributes as classes.
Example command:
pandoc -f docbook -t markdown --lua-filter=roles-to-classes.lua file.dbk