UNPKG

@automattic/rtjson-to-wpblocks

Version:

Javascript code to convert Day One RTJson to WordPress Gutenberg Blocks

160 lines (159 loc) 2.68 kB
{ "contents": [ { "attributes": { "line": { "header": 1 } }, "text": "Here is an example RTJSON entry\n" }, { "attributes": {}, "text": "It has a paragraph\n" }, { "attributes": { "line": { "listStyle": "bulleted", "indentLevel": 1 } }, "text": "And a list\n" }, { "attributes": { "line": { "listStyle": "bulleted", "indentLevel": 2 } }, "text": "Indented\n" }, { "attributes": { "line": { "listStyle": "bulleted", "indentLevel": 3 } }, "text": "again\n" }, { "attributes": { "line": { "listStyle": "numbered", "indentLevel": 1 } }, "text": "Number list\n" }, { "attributes": { "line": { "listStyle": "bulleted", "indentLevel": 2 } }, "text": "Sublist\n" }, { "attributes": {}, "text": "And even a photo:\n" }, { "embeddedObjects": [ { "type": "photo", "identifier": "B7C0EB0794D04FF3B496308ED46D179A" } ] }, { "attributes": { "line": { "codeBlock": true } }, "text": "Here is a code block\n" }, { "attributes": { "line": { "quote": true } }, "text": "Here is a quote block\n" }, { "attributes": {}, "text": "Here is a paragraph " }, { "attributes": { "bold": true }, "text": "with bold text" }, { "attributes": {}, "text": " and " }, { "attributes": { "italic": true }, "text": "with italicized text" }, { "attributes": {}, "text": " and " }, { "attributes": { "bold": true, "italic": true }, "text": "with both" }, { "attributes": {}, "text": ".\n" }, { "attributes": { "line": { "header": 2 } }, "text": "Header 2\n" }, { "attributes": { "line": { "header": 3 } }, "text": "Header 3\n" }, { "embeddedObjects": [ { "type": "horizontalRuleLine" } ] }, { "attributes": {}, "text": "That was a separator" } ], "meta": { "version": 1, "created": { "version": 1718927776, "platform": "webapp" }, "small-lines-removed": true } }