Skip to content

Instantly share code, notes, and snippets.

@rudyrigot
Created October 24, 2013 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudyrigot/7129058 to your computer and use it in GitHub Desktop.
Save rudyrigot/7129058 to your computer and use it in GitHub Desktop.
An example of a pretty complex StructuredText field as seen in a prismic.io's JSON collection response
{
"body" : {
"type" : "StructuredText",
"value" : [
{
"type" : "heading1",
"text" : "The nicest macarons are the fondest",
"spans" : [ ]
},
{
"type" : "paragraph",
"text" : "This article features a lot of nice media about Les Bonnes Choses's macarons.",
"spans" : [
{ "start" : 5, "end" : 12, "type" : "strong" },
{ "start" : 48, "end" : 65, "type" : "em" },
{
"start" : 68,
"end" : 76,
"type" : "hyperlink",
"data" : {
"type" : "Link.document",
"value" : {
"document" : {
"id" : "Ul2ROEnM00MEMQoY",
"type" : "product",
"slug" : "fresh-mint-macaron"
}
}
}
}
]
},
{
"type" : "embed",
"oembed": {
"thumbnail_url" : "http://i1.ytimg.com/vi/Ye78F3-CuXY/hqdefault.jpg"
"provider_url" : "http://www.youtube.com/"
"thumbnail_height" : 360
"type" : "video"
"version" : "1.0"
"author_url" : "http://www.youtube.com/user/thatsmynamedude"
"width" : 459
"author_name" : "TRR56"
"title" : "How It's Made Chocolate"
"thumbnail_width" : 480
"height" : 344
"provider_name" : "YouTube"
"html": "<iframe width=\"459\" height=\"344\" src=\"http://www.youtube.com/embed/Ye78F3-CuXY?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>"
"embed_url" : "http://www.youtube.com/watch?v=Ye78F3-CuXY"
}
},
{
"type": "image",
"url" : "https://prismic-io.s3.amazonaws.com/zenexity/41f39458a1b1a3482ca19f5c597718ce3d531023.png",
"alt" : "A nice, melty macaron",
"copyright" : "CC-BY Les Bonnes Choses",
"dimensions": {
"width": 580,
"height": 327
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment