Atila Fassina
Web developer specialized in Jamstack and Design Systems π§
Atila is located at Berlin
Schema and Component for editing Markdown in Sanity
This plugin only works with an older version of Sanity Studio (v2), which is deprecated.
Learn how to migrate to the new Studio v3 βThis is a wrapper on React SimpleMDE Editor to be used on Sanity Studio
sanity install sanity-plugin-mdide
Just set type markdown
to the field you wish to use.
// ./schemas/post.js
export default {
name: 'post',
title: 'Post',
type: 'document',
fields: [
{
name: 'body',
title: 'Body',
type: 'markdown',
},
],
}
To fit well with Sanity Studioβs design system. These variables come from part:@sanity/base/theme/variables-style
.
The list of CSS custom properties:
--body-text
--component-bg
--hairline-color
--border-radius-base
--brand-primary
--brand-secondary
This also allows to easily adapt to any color pallete.
Just is a very thin wrapper on top of React SimpleMDE Editor and as such, it accepts every option EasyMDE supports. On your field schema, just pass an options
object.
export default {
name: 'post',
title: 'Post',
type: 'document',
fields: [
{
name: 'body',
title: 'Body',
type: 'markdown',
options: {
minHeight: '400px', // default is 500px
},
},
],
}
sanity install mdide
Web developer specialized in Jamstack and Design Systems π§