Skip to content

Commit ad40c7a

Browse files
committed
update readme
* add rel-urls to example results * add example of experimental language parsing result
1 parent fd8261f commit ad40c7a

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

README.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,12 @@ will result in the following output, with relative URLs made absolute:
144144
"items": [{
145145
"type": ["h-card"],
146146
"properties": {
147+
"name": ["Mr. Example"],
147148
"photo": ["http://example.org/photo.png"]
148149
}
149150
}],
150-
"rels": {}
151+
"rels": {},
152+
"rel-urls": {}
151153
}
152154
```
153155

@@ -170,10 +172,15 @@ parsing will result in the following keys:
170172
"rels": {
171173
"me": ["https://twitter.com/barnabywalters"]
172174
},
173-
"alternates": [{
174-
"url": "http://example.com/notes.atom",
175-
"rel": "etc"
176-
}]
175+
"rel-urls": {
176+
"https://twitter.com/barnabywalters": {
177+
"text": "Me on twitter",
178+
"rels": ["me"]
179+
},
180+
"http://example.com/notes.atom": {
181+
"rels": ["alternate","etc"]
182+
}
183+
}
177184
}
178185
```
179186

@@ -244,6 +251,34 @@ $parser->lang = true;
244251
$result = $parser->parse();
245252
```
246253
254+
```json
255+
{
256+
"items": [
257+
{
258+
"type": ["h-entry"],
259+
"properties": {
260+
"name": ["En svensk titel"],
261+
"content": [
262+
{
263+
"html": "With an <em>english</em> summary",
264+
"value": "With an english summary",
265+
"lang": "en"
266+
},
267+
{
268+
"html": "Och <em>svensk</em> huvudtext",
269+
"value": "Och svensk huvudtext",
270+
"lang": "sv"
271+
}
272+
]
273+
},
274+
"lang": "sv"
275+
}
276+
],
277+
"rels": {},
278+
"rel-urls": {}
279+
}
280+
```
281+
247282
Note that this option is still considered experimental and in development, and the parsed output may change between minor releases.
248283

249284

0 commit comments

Comments
 (0)