Skip to content

nervetattoo/sanity-plugin-mermaid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c5be4ab · May 18, 2020

History

23 Commits
Mar 23, 2020
Mar 26, 2020
Mar 23, 2020
Mar 23, 2020
Mar 23, 2020
Mar 23, 2020
Mar 23, 2020
Mar 26, 2020
Mar 24, 2020
Mar 22, 2020
Mar 22, 2020
May 18, 2020

Repository files navigation

sanity-plugin-mermaid

Add a Mermaid graph input type for Sanity CMS

Read more about using the plugin in this blog post

Screenshot

sanity install mermaid

Then use it in your schema:

export default {
  name: 'graph',
  title: 'Graph',
  type: 'document',
  fields: [
    {
      name: 'title',
      title: 'Title',
      type: 'string',
    }, {
      type: 'mermaid',
    }
  ]
}

In order to render in your frontend you need to manually use the mermaid package.

TODO

  • Write a helper package providing a serialiser for portable text
  • Link to mermaid docs in editor
  • Syntax highlighted editor