Markdown + automated HTML styling API Reference

Example Markdown

  • With bold and italics
  • With a link

And a subheading

This is a blockquote

This supports inline latex: $e^{\pi i} + 1 = 0$ as well as block latex thanks to Katex.

$$ \frac{1}{2\pi i} \oint_C \frac{f(z)}{z-z_0} dz $$

And even syntax highlighting thanks to Highlight.js! (Just make sure you set highlightjs=True in the headers function)

def add(a, b):
    return a + b

You can overwrite the default styling for markdown rendering with your own css classes with `class_map

With custom bold style

But no extra quote style because class_map overrides all default styled

You can modify the default styling for markdown rendering with your own css classes with `class_map_mods

With custom bold style

But default quote style because class_map_mods replaces sepecified styles and leaves the rest as default

This uses the apply_classes function, which can be used to apply classes to html strings. This is useful for applying styles to any html you get from an external source.

<div><h1 class="uk-h1 text-4xl font-bold mt-12 mb-6">Hello, World!</h1><p class="text-lg leading-relaxed mb-6">This is a paragraph</p></div>

One common external source is a markdown renderer. MonsterUI uses tailwind css for styling so you don't get any styling without specifying classes, apply_classes can do that for you.

Hi

a link

apply_classes

Source
apply_classes(html_str: str, class_map=None, class_map_mods=None) -> str

Apply classes to html string

Params
  • html_str Html string

  • class_map Class map

  • class_map_mods Class map that will modify the class map map (for small changes to base map)

Returns: Html string with classes applied