Skip to content

Commit f5fd3f2

Browse files
committed
Markup cleanup.
- Add some whitespace. - Add explicit simplified anchors for canonize, fromrdf, tordf.
1 parent 8a00400 commit f5fd3f2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const context = {
139139
```
140140

141141
### [compact](http://json-ld.org/spec/latest/json-ld/#compacted-document-form)
142+
142143
```js
143144
// compact a document according to a particular context
144145
jsonld.compact(doc, context, function(err, compacted) {
@@ -161,6 +162,7 @@ const compacted = await jsonld.compact(doc, context);
161162
```
162163

163164
### [expand](http://json-ld.org/spec/latest/json-ld/#expanded-document-form)
165+
164166
```js
165167
// expand a document, removing its context
166168
jsonld.expand(compacted, function(err, expanded) {
@@ -181,6 +183,7 @@ const expanded = await jsonld.expand(doc);
181183
```
182184

183185
### [flatten](http://json-ld.org/spec/latest/json-ld/#flattened-document-form)
186+
184187
```js
185188
// flatten a document
186189
jsonld.flatten(doc, (err, flattened) => {
@@ -192,6 +195,7 @@ const flattened = await jsonld.flatten(doc);
192195
```
193196

194197
### [frame](http://json-ld.org/spec/latest/json-ld-framing/#introduction)
198+
195199
```js
196200
// frame a document
197201
jsonld.frame(doc, frame, (err, framed) => {
@@ -202,7 +206,8 @@ jsonld.frame(doc, frame, (err, framed) => {
202206
const framed = await jsonld.frame(doc, frame);
203207
```
204208

205-
### [canonize](http://json-ld.github.io/normalization/spec/) (normalize)
209+
### <a name="canonize"></a>[canonize](http://json-ld.github.io/normalization/spec/) (normalize)
210+
206211
```js
207212
// canonize (normalize) a document using the RDF Dataset Normalization Algorithm
208213
// (URDNA2015), see:
@@ -218,7 +223,8 @@ jsonld.canonize(doc, {
218223
const canonized = await jsonld.canonize(doc, {format: 'application/n-quads'});
219224
```
220225

221-
### toRDF (N-Quads)
226+
### <a name="tordf"></a>toRDF (N-Quads)
227+
222228
```js
223229
// serialize a document to N-Quads (RDF)
224230
jsonld.toRDF(doc, {format: 'application/n-quads'}, (err, nquads) => {
@@ -229,7 +235,8 @@ jsonld.toRDF(doc, {format: 'application/n-quads'}, (err, nquads) => {
229235
const rdf = await jsonld.toRDF(doc, {format: 'application/n-quads'});
230236
```
231237

232-
### fromRDF (N-Quads)
238+
### <a name="fromrdf"></a>fromRDF (N-Quads)
239+
233240
```js
234241
// deserialize N-Quads (RDF) to JSON-LD
235242
jsonld.fromRDF(nquads, {format: 'application/n-quads'}, (err, doc) => {
@@ -241,6 +248,7 @@ const doc = await jsonld.fromRDF(nquads, {format: 'application/n-quads'});
241248
```
242249

243250
### Custom RDF Parser
251+
244252
```js
245253
// register a custom async-callback-based RDF parser
246254
jsonld.registerRDFParser(contentType, (input, callback) => {
@@ -262,6 +270,7 @@ jsonld.registerRDFParser(contentType, async input => {
262270
```
263271

264272
### Custom Document Loader
273+
265274
```js
266275
// how to override the default document loader with a custom one -- for
267276
// example, one that uses pre-loaded contexts:

0 commit comments

Comments
 (0)