Specification for the Spectrum content format.
Version: 0.1
Table of Contents generated with DocToc
The top level of Spectrum.
Fields:
- version: Number, version of spectrum spec document is using. Used for spectrum migrations
- content: Subtype, document content
{
"version": 0.1
"content": SubtypeOutput
}
Subtypes define the shape of the content. For example, an Article subtype might have a stream of blocks. Where as a Video subtype could also have a video block at its root level. A gallery subtype could deviate from the loose stream of blocks entirely to have a more structured stream of Image blocks.
Fields:
- _name: String, name of the subtype
- []: Properties, properties that define the subtype
Fields:
- name:
'article'
- stream:
Stream
of sections
Fields:
- name:
'video'
- featureVideo:
VideoBlock
- stream:
Stream
of sections
Blocks are the containers of different types of media elements, for example videos, text, quotes, images and embeds.
Fields:
- name:
'image'
- reference:
ImageResource
- alt:
PlainTextTransformer
- title:
PlainTextTransformer
- caption:
InlinedownTextTransformer
- source:
InlinedownTextTransformer
- sourceURL:
String(validation=URL)
Fields:
- name:
'video'
- reference:
VideoResource
- caption:
InlinedownTextTransformer
- source:
InlinedownTextTransformer
- sourceURL:
String(validation=URL)
Fields:
- name:
'heading'
- level: Number(min=1, max=6)
- text:
InlinedownTextTransformer
Fields:
- name:
'text'
- text:
MarkdownTextTransformer
- name:
'quote'
- quote:
InlinedownTextTransformer
- attributed:
InlinedownTextTransformer
Transformers have a common output: HTML.
- name:
'transformer'
- transformer: name of transformer
- text: string
- name:
'markdown'
Transforms Markdown text.
- name:
'inline'
Transforms inline-level Markdown text. This essentially limits generated elements to anchors, emphasis and strong tags.
- name:
'plain'
No transform.
- name:
'html'
No transform. HTML directly injected. Does not escape.