Examples / story-source

story-source.json

targets v1.4.0 6 entities 7 schemas

The Relay ingest pattern: a Markdown source carried as rig.media.code (language markdown) with its disk origin as rig.media.asset_ref on the same entity, beside the rig.story.flow a layout host compiled from it. After ingest the composed POD is the editable truth; the buffer is provenance, re-parsed only on explicit re-ingest - code.md Data grammars.

Speaks

rig.media.asset_ref · rig.media.code · rig.meta.named · rig.story.character_style · rig.story.flow · rig.story.paragraph · rig.story.paragraph_style

Document

Validates under npm run check — raw file · open in RigPlayer — drop it in, press play, remix it, share the link.

{
  "rig": "1.4.0",
  "document": {
    "title": "Story source"
  },
  "entities": [
    {
      "id": "chapter-source",
      "components": {
        "rig.meta.named": {
          "name": "chapter.md",
          "stableId": "chapter-source"
        },
        "rig.media.code": {
          "text": "# Title\n\nHello **world**.\n",
          "language": "markdown"
        },
        "rig.media.asset_ref": {
          "kind": "document",
          "path": "chapter.md"
        }
      }
    },
    {
      "id": "style-paragraph",
      "components": {
        "rig.meta.named": {
          "name": "Paragraph",
          "stableId": "style-paragraph"
        },
        "rig.story.paragraph_style": {}
      }
    },
    {
      "id": "style-bold",
      "components": {
        "rig.meta.named": {
          "name": "Bold",
          "stableId": "style-bold"
        },
        "rig.story.character_style": {}
      }
    },
    {
      "id": "p-title",
      "components": {
        "rig.story.paragraph": {
          "style": "style-paragraph",
          "runs": [
            {
              "text": "Title"
            }
          ]
        }
      }
    },
    {
      "id": "p-body",
      "components": {
        "rig.story.paragraph": {
          "style": "style-paragraph",
          "runs": [
            {
              "text": "Hello "
            },
            {
              "text": "world",
              "style": "style-bold"
            },
            {
              "text": "."
            }
          ]
        }
      }
    },
    {
      "id": "story",
      "components": {
        "rig.meta.named": {
          "name": "Main story",
          "stableId": "story"
        },
        "rig.story.flow": {
          "blocks": [
            "p-title",
            "p-body"
          ]
        }
      }
    }
  ]
}