async function createMarkdown(sourceDir, config) {
  config = config || {};

  return sassdoc.parse(sourceDir, config).then(
    data => {
      let markdownFile = '';

      const documentedItems = data.filter(
        (item, index) => item.access === 'public' || item.access === 'private'
      );

      markdownFile += `# Sass API

| Mark | Description |
| --- | --- |
| ✅ | Public functions, mixins, placeholders, and variables |
| ❌ | Private items - not supported outside package's build |
| ⚠️ | Deprecated items - may not be available in future releases |

<!-- toc -->
<!-- tocstop -->`;

      let currentGroup = '';

      documentedItems.forEach(item => {
        const itemGroup = createGroupName(item.group);

        if (itemGroup !== currentGroup) {
          markdownFile += `\n\n## ${itemGroup}`;
          currentGroup = itemGroup;
        }

        markdownFile += createMarkdownItem(item);
      });

      return prettier.format(
        toc.insert(markdownFile, { slugify }),
        prettierOptions
      );
    },
    err => {
      console.error(err);
    }
  );
}