Skip to content

Commit

Permalink
Merge pull request #74 from stencila/refine-listSchema
Browse files Browse the repository at this point in the history
Update List & ListItem schemas
  • Loading branch information
nokome committed Jun 20, 2019
2 parents b2d954d + 8361a36 commit 7d07710
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 17 deletions.
22 changes: 16 additions & 6 deletions examples/list/nested.list.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
type: List
items:
- Item One
- type: ListItem
content:
- Item One
- type: ListItem
content:
- Item Two, containing nested children
- type: List
content:
- Nested Item One
- Nested Item Two
- Nested Item Three
- Item Three
items:
- type: ListItem
content:
- Nested Item One
- type: ListItem
content:
- Nested Item Two
- type: ListItem
content:
- Nested Item Three
- type: ListItem
content:
- Item Three
12 changes: 9 additions & 3 deletions examples/list/simple.list.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
type: List
items:
- Item One
- Item Two
- Item Three
- type: ListItem
content:
- Item One
- type: ListItem
content:
- Item Two
- type: ListItem
content:
- Item Three
2 changes: 1 addition & 1 deletion schema/text/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If an `order` field is not defined, the list is assumed to be `unordered`.

### Nested Ordered List Inside an Unordered List

A [`ListItem`](/schema/ListItem) can contain any valid [`BlockContent`](/schema/BlockContent), meaning that lists can be nested and/or contain other block elements.
A [`ListItem`](/schema/ListItem) can contain any valid `Node`, meaning that lists can be nested and/or contain other block elements.

```json
{
Expand Down
2 changes: 1 addition & 1 deletion schema/text/List.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ properties:
description: The items in the list
type: array
items:
$ref: Node.schema.yaml
$ref: ListItem.schema.yaml
order:
'@id': 'schema:itemListOrder'
description: Type of ordering.
Expand Down
11 changes: 6 additions & 5 deletions schema/text/ListItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `ListItem` schema represents a collection of items, which can be ordered or

### Nested Ordered List Inside an Unordered List

A list item can contain any valid [`BlockContent`](/schema/BlockContent), meaning that lists can be nested and/or contain other block elements.
A list item can contain any valid `Node`, meaning that lists can be nested and/or contain other block elements.

```json
{
Expand Down Expand Up @@ -54,7 +54,7 @@ completable, omit the `checked` field.
[`<list-item>`](https://jats.nlm.nih.gov/articleauthoring/tag-library/1.2/element/list-item.html)
type.
Note that JATS only permits the `ListItem` to contain either a
[`Paragraph`](/schema/Paragraph) element, or another [`List`](/schema/List), while the Stencila equivalent is closer to HTML and accepts any valid [Block content](/schema/BlockContent).
[`Paragraph`](/schema/Paragraph) element, or another [`List`](/schema/List), while the Stencila equivalent is closer to HTML and accepts any valid `Node`.

### mdast

Expand All @@ -65,6 +65,7 @@ Note that JATS only permits the `ListItem` to contain either a

`ListItem` is analagous to the OpenDocument
[`<text:list-item>`](http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415154_253892949)
element.
Note that OpenDocument only permits the `ListItem` to contain either a
[`Paragraph`](/schema/Paragraph) element, or another [`List`](/schema/List), while the Stencila equivalent is closer to HTML and accepts any valid [Block content](/schema/BlockContent).
element. Note that OpenDocument only permits the `ListItem` to contain either
a [`Paragraph`](/schema/Paragraph) element, or another
[`List`](/schema/List), while the Stencila equivalent is closer to HTML and
accepts any valid `Node`.
2 changes: 1 addition & 1 deletion schema/text/ListItem.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ properties:
'@id': stencila:content
type: array
items:
$ref: BlockContent.schema.yaml
$ref: Node.schema.yaml
checked:
'@id': stencila:checked
type: boolean
Expand Down

0 comments on commit 7d07710

Please sign in to comment.