tentative abstraction of toHTML conversion of flask.