from bs4 import BeautifulSoup


def slide_factory(tag, id: int, classes: list = []):
    """
    Factory for creating slides from a given Beautifulsoup tag, id, and list of classes to use for the slide.

    Args:
        tag (_type_): The tag to put into the slide.
        id (int): The id of the slide (used for the Javascript on the page).
        classes (list, optional): What classes should be on the HTML of the slide tag. Defaults to [].

    Returns:
        _type_: The Beautifulsoup slide tag.
    """
    soup = BeautifulSoup()
    slide = soup.new_tag(
        "div", **{"class": "slide " + " ".join(classes), "id": "slide{}".format(id)}
    )
    slide.append(tag)
    return slide