2.2.4-studio-v3.3 • Published 2 years ago

@snorreeb/sanity-plugin-markdown v2.2.4-studio-v3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

sanity-plugin-markdown

NOTE

This is the Sanity Studio v3 version of sanity-plugin-markdown.

For the v2 version, please refer to the v2-branch.

What is it?

A Markdown editor with preview for Sanity Studio.

Supports Github flavored markdown and image uploads. You can either drag image(s) into the editor or click the bottom bar to bring up a file selector. The resulting image URL(s) are inserted with a default width parameter which you can change to your liking using the Sanity image pipeline parameters.

Markdown input

Installation

npm install --save sanity-plugin-markdown@studio-v3

or

yarn add sanity-plugin-markdown@studio-v3

Usage

Declare a field in your schema to be markdown

const myDocument = {
  type: "document",
  name: "myDocument",
  fields: [
    {
      type: "markdown",
      description: "A Github flavored markdown field with image uploading",
      name: "bio"
    }
  ]
}

Demo

demo

License

MIT © Sanity.io See LICENSE

Develop & test

Make sure to run npm run build once, then run

npm run link-watch

In another shell, cd to your test studio and run:

npx yalc add sanity-plugin-markdown --link && yarn install

Now, changes in this repo will be automatically built and pushed to the studio, triggering hotreload. Yalc avoids issues with react-hooks that are typical when using yarn/npm link.

About build & watch

This plugin uses @sanity/plugin-sdk with default configuration for build & watch scripts.

2.2.4

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.5

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago