def create_readme(data):
    """
    Create README.md text for the given module data.
    """
    out = ['<a name="top"></a>Modules\n========\n\n']
    for module in sorted(data.keys()):
        desc = ''.join(data[module]).strip().split('\n')[0]
        format_str = '\n**[{name}](#{name})** — {desc}\n'
        out.append(format_str.format(name=module, desc=desc))
    for module in sorted(data.keys()):
        out.append('\n---\n\n### <a name="{name}"></a>{name}\n\n{details}\n'
            .format(name=module, details=''.join(data[module]).strip()))
    return ''.join(out)
