Skip to content

Commit 833092f

Browse files
authored
Support at data and yaml (#3)
* Init feature updates * changed function to more general name, support for JSON data as well * Fixed bug when @DaTa was JSON * Fixed 5.3.3 compatibility issues * fixed var name in if statement * Fixed if statement...again * Fixed bad tick marks * Fixed incorrect quote marks in data_replace function
1 parent 20d9d1f commit 833092f

13 files changed

Lines changed: 111 additions & 14 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"nesbot/Carbon": "~1.6",
1919
"erusev/parsedown": "^1.6",
2020
"mnapoli/front-yaml": "^1.5",
21-
"symfony/twig-bridge": "^2.3"
21+
"symfony/twig-bridge": "^2.3",
22+
"symfony/yaml": "=2.6.13"
2223
},
2324
"autoload": {
2425
"psr-0": {

resources/fixtures/cat.jpg

104 KB
Loading

resources/fixtures/foo.docs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bar: abc
2+
baz: def

resources/fixtures/foo2.docs.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"bar": "123",
3+
"baz": "456"
4+
}

resources/fixtures/image.docs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src: /resources/fixtures/cat.jpg
2+
alt: This is a photo

resources/fixtures/image.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "Image",
4+
"category": "atom",
5+
"type": "object",
6+
"format": "grid",
7+
"properties": {
8+
"name": {
9+
"type": "string",
10+
"default": "image",
11+
"options": {
12+
"hidden": true
13+
}
14+
},
15+
"src": {
16+
"type": "string"
17+
},
18+
"alt": {
19+
"type": "string"
20+
}
21+
},
22+
"required": ["name"],
23+
"additionalProperties": false
24+
}

resources/fixtures/image.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<img src="{{src}}" alt="{{alt}}" >

resources/fixtures/test.docs.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

resources/fixtures/test.docs.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: test
2+
quotation: We think of Red Hat as one of just a handful of superior engineering and support organizations in the United States.
3+
attribution_name: John Defeo
4+
attribution_title: President of Infrastructure, CIGNA
5+
image: @image
6+
foo:
7+
- @foo
8+
- @foo2
9+

resources/fixtures/test.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@
2626
"title": "Attribution Title",
2727
"description": "What is their job title?",
2828
"type": "string"
29+
},
30+
"image": {
31+
"$ref": "image.json"
32+
},
33+
"foo": {
34+
"type": "array",
35+
"items": {
36+
"type": "object",
37+
"properties": {
38+
"bar": {
39+
"type": "string"
40+
},
41+
"baz": {
42+
"type": "string"
43+
}
44+
}
45+
}
2946
}
3047
},
3148
"required": ["name", "quotation", "attribution_name"],

0 commit comments

Comments
 (0)