Simeon Griggs
π¦πΊ in π¬π§ Solution Engineer @ Sanity
Send the contents of a Portable Text field to MonkeyLearn's API to extract insights with the power of Machine Learning!
Send the contents of Portable Text to MonkeyLearn's API to Extract insights with the power of Machine Learning!
options
.sanity install monkeylearn-pane
This is designed to be used as a Component inside of a View.
// ./src/deskStructure.js
import MonkeyLearnPane from 'sanity-plugin-monkeylearn-pane'
// ...all other list items
S.view
.component(MonkeyLearnPane)
.options({
extractors: [`ex_vqBQ7V9B`],
field: 'content',
// Optional but recommended!
// Use your own Component to display/interact with extractions
displayComponent: <Report />,
})
.title('Analysis')
The .options()
configuration works as follows:
extractors
([string], required) The ID's of the Text Extractors you want to produce reports for.field
(string, required) A dot-notated string from the document object to a field containing the Portable Text array.displayComponent
(React Component, optional) A custom Component for handling the report from each text extraction. You will need to BYO a Component that will accept the Document ID and Report as props, so that it can do something fancy like generating tag
documents and sending a patch
to the currently edited document.The example shown above is included in this repo, see ReportTagCreator.js β this Component takes the report, generates a tag
document if one does not already exists, and can send a patch
back to the currently edited document in an array
of references
named tags
.
MIT Β© Simeon Griggs See LICENSE
sanity install monkeylearn-pane
π¦πΊ in π¬π§ Solution Engineer @ Sanity
Drag-and-drop Document Ordering without leaving the Editing surface
Go to Orderable Document ListA configurable Custom Input for Arrays that will add and update items by clicking on an Image
Go to Hotspot ArrayEmpower content editors to migrate Documents and Assets between Sanity Projects and Datasets from inside the Studio
Go to Cross Dataset DuplicatorDisplay any URL in a View Pane, along with helpful buttons to Copy the URL or open in a new tab.
Go to Iframe Pane