import re


def title_to_dirname(text: str) -> str:
    """Converts a title into a sanitized dirname.

    title_to_dirname('Godot for Designers') outputs 'godot-for-designers'"""
    string = text.lower().replace(" ", "-").replace(".", "-")
    string = re.sub(r"[_:,/?]|(\[.*\])|(\(.*\))", "", string,)
    return re.sub(r"-+", "-", string, flags=re.DOTALL)