from pathlib import Path


def insert_document_start(path: Path) -> str:
    """
    Inserts dashes at the beginning of the yaml document.
    Args:
        path (Path): document path.

    Returns:
        str: new contents of the file
    """
    # Read document
    p = Path(path)
    contents = p.read_text()

    # Prepend dashes and save changes
    contents = '---\n' + contents
    p.write_text(contents, encoding='utf8')

    return contents