@automattic/rtjson-to-wpblocks
Version:
Javascript code to convert Day One RTJson to WordPress Gutenberg Blocks
309 lines (307 loc) • 10.6 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"RTJ.Node": {
"anyOf": [
{
"properties": {
"attributes": {
"properties": {
"autolink": {
"type": "boolean"
},
"bold": {
"type": "boolean"
},
"cursorPlacement": {
"type": "number"
},
"highlightedColor": {
"type": "string"
},
"inlineCode": {
"type": "boolean"
},
"italic": {
"type": "boolean"
},
"line": {
"properties": {
"checked": {
"type": "boolean"
},
"codeBlock": {
"type": "boolean"
},
"header": {
"type": "number"
},
"identifier": {
"type": "string"
},
"indentLevel": {
"type": "number"
},
"listIndex": {
"type": "number"
},
"listStyle": {
"enum": [
"bulleted",
"checkbox",
"numbered"
],
"type": "string"
},
"quote": {
"type": "boolean"
}
},
"type": "object"
},
"linkURL": {
"type": "string"
},
"pageLink": {
"type": "boolean"
},
"strikethrough": {
"type": "boolean"
}
},
"type": "object"
},
"text": {
"type": "string"
}
},
"required": [
"text"
],
"type": "object"
},
{
"properties": {
"embeddedObjects": {
"items": {
"$ref": "#/definitions/RTJ.RTJEmbeddedObject"
},
"type": "array"
}
},
"required": [
"embeddedObjects"
],
"type": "object"
}
]
},
"RTJ.RTJEmbeddedObject": {
"anyOf": [
{
"properties": {
"identifier": {
"type": "string"
},
"type": {
"const": "photo",
"type": "string"
}
},
"required": [
"identifier",
"type"
],
"type": "object"
},
{
"properties": {
"identifier": {
"type": "string"
},
"type": {
"const": "audio",
"type": "string"
}
},
"required": [
"identifier",
"type"
],
"type": "object"
},
{
"properties": {
"identifier": {
"type": "string"
},
"type": {
"const": "video",
"type": "string"
}
},
"required": [
"identifier",
"type"
],
"type": "object"
},
{
"properties": {
"identifier": {
"type": "string"
},
"type": {
"const": "pdfAttachment",
"type": "string"
}
},
"required": [
"identifier",
"type"
],
"type": "object"
},
{
"properties": {
"type": {
"const": "externalVideo",
"type": "string"
},
"url": {
"type": "string"
}
},
"required": [
"type",
"url"
],
"type": "object"
},
{
"properties": {
"type": {
"const": "externalAudio",
"type": "string"
},
"url": {
"type": "string"
}
},
"required": [
"type",
"url"
],
"type": "object"
},
{
"properties": {
"contents": {
"type": "string"
},
"type": {
"const": "renderableCodeBlock",
"type": "string"
}
},
"required": [
"contents",
"type"
],
"type": "object"
},
{
"properties": {
"type": {
"const": "horizontalRuleLine",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
{
"properties": {
"entryID": {
"type": "string"
},
"journalID": {
"type": "string"
},
"type": {
"const": "dayOneEntry",
"type": "string"
}
},
"required": [
"entryID",
"type"
],
"type": "object"
},
{
"properties": {
"identifier": {
"type": "string"
},
"type": {
"const": "preview",
"type": "string"
}
},
"required": [
"identifier",
"type"
],
"type": "object"
}
]
}
},
"properties": {
"contents": {
"items": {
"$ref": "#/definitions/RTJ.Node"
},
"type": "array"
},
"meta": {
"properties": {
"created": {
"properties": {
"platform": {
"type": "string"
},
"version": {
"type": "number"
}
},
"required": [
"platform",
"version"
],
"type": "object"
},
"small-lines-removed": {
"type": "boolean"
},
"version": {
"const": 1,
"type": "number"
}
},
"required": [
"created",
"small-lines-removed",
"version"
],
"type": "object"
}
},
"required": [
"contents"
],
"type": "object"
}