import typing


def split_sections(docstring: str) -> typing.Dict[str, str]:
    """Parses the sections of a docstring.

    The docstring is assumed to follow the Google docstring convention.

    """

    lines = iter(docstring.splitlines())
    sections = {}
    admonitions = []

    section = 'Description'
    content = []

    for l in lines:

        # Parse admonitions
        if l.startswith('.. '):
            admonition = ''
            kind = l.lstrip('.. ').rstrip('::')
            for l in lines:
                if not l:
                    break
                admonition += f' {l.rstrip()}'
            admonitions.append((kind, ' '.join(admonition.split())))
            continue

        if not l.startswith(' ') and l.endswith(':') and ' ' not in l:
            sections[section] = '\n'.join(content)
            section = l.split(':')[0]
            content = []
            continue
        content.append(l)

    sections[section] = '\n'.join(content)
    sections['Admonitions'] = admonitions

    return sections