from pathlib import Path


def default_path_factory(refname: str, ispkg: bool) -> Path:
    """Default path factory for markdown."""
    path = Path(*refname.split("."))
    if ispkg:
        filepath = path / "index.md"
    else:
        filepath = path.with_suffix(".md")
    return filepath