@snorreeb/sanity-plugin-markdown v2.2.4-studio-v3.3
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.
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
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 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago