Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API. It allows you to write HTML pages in pure Python very concisely, which eliminate the need to learn another template language, and to take advantage of the more powerful features of Python.
May want to consider programmatically constructing classes using https://developer.mozilla.org/en-US/docs/Web/HTML/Element
For reference, this is how the
{htmltools}
package queries all non-obsolete tags https://github.com/rstudio/htmltools/blob/bc226a3/scripts/generate_known_tags.R#L37Happy to stab at a PR there's interest in this.