almanac.style

highlight_for_mimetype(text: str, mimetype: str, *, fallback_mimetype: Optional[str] = 'text/plain', formatter_cls: Type[pygments.formatter.Formatter] = <class 'pygments.formatters.terminal.TerminalFormatter'>)str[source]

Return ANSI-escaped highlighted text, as per the .

If :param`mimetype` cannot be resolved, then :param`fallback_mimetype` will be used. If that cannot be resolved (or is None), then the pygments ClassNotFound exception will be raised.