Specify elements and classes in format menu of rich text editor

I would like to be able to specify what elements (or elements and classes) are in the format dropdown of the rich textfield.

This allows me to restrict the output to specifically what has been designed for and styled in my css. Yes, this is partly possible by specifying only bold, italics etc but this is still quite limited in scope.

I have seen this done in Craft CMS in an elegant way where you can specify the JSON config that gets passed through to redactor (the wsywig component they use)

An example of this might be:

  formatting: ['h2', 'h3', 'h3.small-caps', 'p', 'blockquote', 'blockquote.float-left']

The extra mile would be the ability to specify a CSS file that is loaded by the rich textfield so that it is formatted the same way when editing in DatoCMS as when eventually rendered by the website.

Even just limiting the “format” option would be great (as shown in the OP), where only some headings are allowed, for example.

Yes, I would like to be able to specify a list of options that include block level tags and/or classes on them. I’d also like to be able to give each one a friendly human-readable name (for my non-technical editors). E.g.:

    "Paragraph" => "p",
    "Footnote" => "p.note"