def render_button(
    content,
    button_type=None,
    icon=None,
    button_class="btn-default",
    size="",
    href="",
    name=None,
    value=None,
    title=None,
    extra_classes="",
    id="",
):
    """
    Render a button with content
    """
    attrs = {}
    classes = add_css_class("btn", button_class)
    size = text_value(size).lower().strip()
    if size == "xs":
        classes = add_css_class(classes, "btn-xs")
    elif size == "sm" or size == "small":
        classes = add_css_class(classes, "btn-sm")
    elif size == "lg" or size == "large":
        classes = add_css_class(classes, "btn-lg")
    elif size == "md" or size == "medium":
        pass
    elif size:
        raise BootstrapError(
            'Parameter "size" should be "xs", "sm", "lg" or '
            + 'empty ("{}" given).'.format(size)
        )
    if button_type:
        if button_type not in ("submit", "reset", "button", "link"):
            raise BootstrapError(
                'Parameter "button_type" should be "submit", "reset", '
                + '"button", "link" or empty  ("{}" given).'.format(button_type)
            )
        attrs["type"] = button_type
    classes = add_css_class(classes, extra_classes)
    attrs["class"] = classes
    icon_content = render_icon(icon) if icon else ""
    if href:
        attrs["href"] = href
        tag = "a"
    else:
        tag = "button"
    if id:
        attrs["id"] = id
    if name:
        attrs["name"] = name
    if value:
        attrs["value"] = value
    if title:
        attrs["title"] = title
    return render_tag(
        tag,
        attrs=attrs,
        content=mark_safe(text_concat(icon_content, content, separator=" ")),
    )
Render a button with content