Skip to content

Commit

Permalink
✨ NEW: Add fields enumerated and enumerator to containers, math, …
Browse files Browse the repository at this point in the history
…headings (#36)

* Add required field numbered to containers, math, headings

* Minor fixes to numbered in tests

* Make numbered not required

* Add optional number field to numbered nodes

* Numbered -> enumerated, remove from examples
  • Loading branch information
fwkoch authored Apr 11, 2022
1 parent 35f8097 commit 753530a
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 22 deletions.
7 changes: 1 addition & 6 deletions docs/examples/directives.figure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cases:
Something! A legend!?
```
html: |-
<figure>
<figure class="numbered">
<img src="https://via.placeholder.com/150">
<figcaption>
<p>This is the figure caption!</p>
Expand All @@ -63,7 +63,6 @@ cases:
kind: figure
identifier: myfigure
label: myFigure
numbered: true
children:
- type: image
url: https://via.placeholder.com/150
Expand Down Expand Up @@ -111,7 +110,6 @@ cases:
kind: figure
identifier: myfigure
label: myFigure
numbered: true
children:
- type: image
url: https://via.placeholder.com/150
Expand Down Expand Up @@ -150,7 +148,6 @@ cases:
kind: figure
identifier: myfigure
label: myFigure
numbered: true
children:
- type: image
url: https://via.placeholder.com/150
Expand Down Expand Up @@ -188,7 +185,6 @@ cases:
kind: figure
identifier: myfigure
label: myFigure
numbered: true
children:
- type: image
url: https://via.placeholder.com/150
Expand All @@ -209,7 +205,6 @@ cases:
kind: figure
identifier: myotherfigure
label: myOtherFigure
numbered: true
children:
- type: image
url: https://via.placeholder.com/151
Expand Down
1 change: 0 additions & 1 deletion docs/examples/directives.table.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ cases:
kind: table
identifier: my-table
label: my-table
numbered: true
class: myclass
children:
- type: caption
Expand Down
1 change: 0 additions & 1 deletion docs/examples/references.equations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ cases:
kind: figure
identifier: matrix
label: matrix
numbered: true
children:
- type: image
url: fig.jpg
Expand Down
6 changes: 0 additions & 6 deletions docs/examples/references.figures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ cases:
kind: figure
identifier: my-figure
label: my-figure
numbered: true
children:
- type: image
url: fig.jpg
Expand Down Expand Up @@ -142,7 +141,6 @@ cases:
kind: figure
identifier: my-figure
label: my-figure
numbered: true
children:
- type: image
url: fig.jpg
Expand Down Expand Up @@ -195,7 +193,6 @@ cases:
kind: figure
identifier: my-figure
label: my-figure
numbered: true
children:
- type: image
url: fig.jpg
Expand Down Expand Up @@ -257,7 +254,6 @@ cases:
kind: figure
identifier: my-figure
label: my-figure
numbered: true
children:
- type: image
url: fig.jpg
Expand Down Expand Up @@ -312,7 +308,6 @@ cases:
kind: figure
identifier: my-figure
label: my-figure
numbered: true
children:
- type: image
url: fig.jpg
Expand Down Expand Up @@ -372,7 +367,6 @@ cases:
kind: figure
identifier: my-figure
label: my-figure
numbered: true
children:
- type: image
url: fig.jpg
Expand Down
6 changes: 0 additions & 6 deletions docs/examples/references.tables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ cases:
kind: table
identifier: my-table
label: my-table
numbered: true
children:
- type: caption
children:
Expand Down Expand Up @@ -111,7 +110,6 @@ cases:
kind: table
identifier: my-table
label: my-table
numbered: true
children:
- type: caption
children:
Expand Down Expand Up @@ -189,7 +187,6 @@ cases:
kind: table
identifier: my-table
label: my-table
numbered: true
children:
- type: caption
children:
Expand Down Expand Up @@ -270,7 +267,6 @@ cases:
kind: table
identifier: my-table
label: my-table
numbered: true
children:
- type: caption
children:
Expand Down Expand Up @@ -343,7 +339,6 @@ cases:
kind: table
identifier: my-table
label: my-table
numbered: true
children:
- type: caption
children:
Expand Down Expand Up @@ -423,7 +418,6 @@ cases:
kind: table
identifier: my-table
label: my-table
numbered: true
children:
- type: caption
children:
Expand Down
8 changes: 8 additions & 0 deletions schema/commonmark.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
"minimum": 1,
"maximum": 6
},
"enumerated": {
"description": "count this heading for numbering based on kind, e.g. Section 2.4.1",
"type": "boolean"
},
"enumerator": {
"description": "resolved enumerated value for this heading",
"type": "string"
},
"children": {
"type": "array",
"items": {
Expand Down
8 changes: 6 additions & 2 deletions schema/containers.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
"description": "any custom class information",
"type": "string"
},
"numbered": {
"description": "count this container for numbering based on kind, e.g. Figure 1",
"enumerated": {
"description": "count this container for numbering based on kind, e.g. Figure 1a",
"type": "boolean"
},
"enumerator": {
"description": "resolved enumerated value for this container",
"type": "string"
},
"children": {
"type": "array",
"items": {
Expand Down
8 changes: 8 additions & 0 deletions schema/math.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"type": {
"const": "math"
},
"enumerated": {
"description": "count this math block for numbering based on kind, e.g. See equation (1a)",
"type": "boolean"
},
"enumerator": {
"description": "resolved enumerated value for this math block",
"type": "string"
},
"identifier": {},
"label": {},
"value": {},
Expand Down

0 comments on commit 753530a

Please sign in to comment.