def create_page(name, content):
    """
    Creates a manpage with name filled with content.
    If content is a list or tuple, instead create a dir and fill it with pages
    created from the elements of this list.
    The list should consist of tuples of (ending, content)
    """
    path = os.path.join(EMP, name)
    if isinstance(content, (list, tuple)):
        # create a bunch of pages
        if os.path.exists(path):
            shutil.rmtree(path)
        os.mkdir(path)
        for n, element in enumerate(content, 1):
            ending, elementcontent = element
            pagename = "{b}/page_{n}.{e}".format(n=n, e=ending, b=path)
            create_page(pagename, elementcontent)
        return path
    else:
        return create_file(path, content)

    Creates a manpage with name filled with content.
    If content is a list or tuple, instead create a dir and fill it with pages
    created from the elements of this list.
    The list should consist of tuples of (ending, content)
    
lib/stashutils/extensions.py