Skip to content

Commit

Permalink
feat: add more block level nodes; remove Text
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Mar 28, 2019
1 parent 83a3489 commit a6a3af9
Show file tree
Hide file tree
Showing 18 changed files with 183 additions and 46 deletions.
4 changes: 2 additions & 2 deletions examples/emphasis/simple.emphasis.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: Emphasis
content:
- type: Text
value: This is some text
- Some emphasied text

3 changes: 1 addition & 2 deletions examples/heading/simple.heading.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
type: Heading
depth: 1
content:
- type: Text
value: "Metamorphosis"
- Metamorphosis
12 changes: 4 additions & 8 deletions examples/paragraph/simple.paragraph.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
type: Paragraph
content:
- type: Text
value: Some text with some
- Some text with some
- type: Emphasis
content:
- type: Text
value: emphasised words
- type: Text
value: ' and '
- emphasised words
- ' and '
- type: Strong
content:
- type: Text
value: some strongly emphasised words
- some strongly emphasised words
14 changes: 14 additions & 0 deletions examples/table/simple.table.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: Table
cells:
- type: TableCell
position: [0, 0]
content:
- 1
- type: TableCell
position: [1, 0]
content:
- Some text
- type: Emphasis
content:
- emphasised

3 changes: 0 additions & 3 deletions examples/text/invalid.text.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions examples/text/simple.text.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions schema/Blockquote.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/Blockquote.schema.json
title: Blockquote
'@id': stencila:Blockquote
description: |
A section quoted from somewhere else.
properties:
type:
enum: [Blockquote]
content:
'@id': 'stencila:content'
description: |
The content that is marked for deletion. Often indicated using a strike through style.
allOf:
- $ref: blockContent.schema.yaml
additionalProperties: false
required:
- type
- content
5 changes: 3 additions & 2 deletions schema/Emphasis.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ properties:
content:
'@id': 'stencila:content'
description: The content that is emphasised.
allOf:
- $ref: inlineContent.schema.yaml
type: array
items:
$ref: inlineContent.schema.yaml
additionalProperties: false
required:
- type
Expand Down
6 changes: 6 additions & 0 deletions schema/Expression.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/Expression.schema.json
title: Expression
description: An expression.
allOf:
- $ref: SoftwareSourceCode.schema.yaml
25 changes: 25 additions & 0 deletions schema/List.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/List.schema.json
title: List
'@id': schema:ItemList
description: |
A list of items.
properties:
type:
enum: [List]
order:
'@id': 'schema:itemListOrder'
description: Type of ordering.
enum:
- ascending
- descending
- unordered
items:
'@id': 'schema:itemListElement'
type: array
items:
$ref: ListItem.schema.yaml
additionalProperties: false
required:
- type
- items
20 changes: 20 additions & 0 deletions schema/ListItem.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/ListItem.schema.json
title: List
'@id': schema:ListItem
description: |
A list item, e.g. a step in a checklist or how-to description.
properties:
type:
enum: [ListItem]
position:
'@id': 'schema:position'
description: The position of an item in a series or sequence of items.
type: integer
item:
'@id': 'schema:itemListElement'
description: The position of an item in a series or sequence of items.
additionalProperties: false
required:
- type
- item
5 changes: 3 additions & 2 deletions schema/Paragraph.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ properties:
type:
enum: [Paragraph]
content:
allOf:
- $ref: inlineContent.schema.yaml
type: array
items:
$ref: inlineContent.schema.yaml
additionalProperties: false
required:
- type
37 changes: 27 additions & 10 deletions schema/Table.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/Table.schema.json
title: Table
'@id': stencila:Table
'@id': schema:Table
description: |
A table within an executable document.
type: object
properties:
cells:
'@id': stencila:cells
description: |
An array of cells in the table.
type: array
items:
$ref: TableCell.schema.yaml
allOf:
- $ref: CreativeWork.schema.yaml
- properties:
type:
enum: [Table]
rows:
'@id': stencila:rows
description: |
Rows of cells in the table.
type: array
items:
$ref: TableRow.schema.yaml
cells:
'@id': stencila:cells
description: |
An array of cells in the table.
type: array
items:
$ref: TableCell.schema.yaml
required:
- type
anyOf:
- required:
- rows
- required:
- cells
15 changes: 8 additions & 7 deletions schema/TableCell.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ title: TableCell
'@id': stencila:TableCell
description: |
A cell within a `Table`.
type: object
properties:
type:
description: The type of node.
type: string
const: TableCell
enum: [TableCell]
name:
'@id': schema:name
description: |
Expand Down Expand Up @@ -48,9 +45,13 @@ properties:
minimum: 0
maximum: 65534
default: 1
value:
'@id': schema:value
content:
'@id': schema:content
description: |
Contents of the table cell.
$comment: Currently there are no vaildations on TableCell values. See TableCell.md for more discussion.s
allOf:
- $ref: inlineContent.schema.yaml
additionalProperties: false
required:
- type
- content
20 changes: 20 additions & 0 deletions schema/TableRow.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/TableRow.schema.json
title: TableRow
'@id': stencila:TableRow
description: |
A row within a `Table`.
properties:
type:
enum: [TableRow]
cells:
'@id': stencila:cells
description: |
An array of cells in the table.
type: array
items:
$ref: TableCell.schema.yaml
additionalProperties: false
required:
- type
- value
12 changes: 12 additions & 0 deletions schema/ThematicBreak.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/ThematicBreak.schema.json
title: ThematicBreak
'@id': stencila:ThematicBreak
description: |
A thematic break, such as a scene change in a story, a transition to another topic, or a new document.
properties:
type:
enum: [ThematicBreak]
additionalProperties: false
required:
- type
10 changes: 10 additions & 0 deletions schema/blockContent.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/blockContent.schema.json
description: Block content.
anyOf:
- $ref: Blockquote.schema.yaml
- $ref: Heading.schema.yaml
- $ref: List.schema.yaml
- $ref: Paragraph.schema.yaml
- $ref: Table.schema.yaml
- $ref: ThematicBreak.schema.yaml
17 changes: 9 additions & 8 deletions schema/inlineContent.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
$schema: http://json-schema.org/draft-07/schema#
$id: https://stencila.github.com/schema/inlineContent.schema.json
description: Inline content.
type: array
items:
anyOf:
- $ref: Text.schema.yaml
- $ref: Emphasis.schema.yaml
- $ref: Strong.schema.yaml
- $ref: Delete.schema.yaml
- $ref: Verbatim.schema.yaml
anyOf:
- type: boolean
- type: integer
- type: number
- type: string
- $ref: Emphasis.schema.yaml
- $ref: Strong.schema.yaml
- $ref: Delete.schema.yaml
- $ref: Verbatim.schema.yaml

0 comments on commit a6a3af9

Please sign in to comment.