Skip to content

Commit

Permalink
docs: fix examples links (ipfs#590)
Browse files Browse the repository at this point in the history
The links to regular files api examples were broken.

Also makes the 'importing from a url' and 'importing from the file
system' headers linkable.
  • Loading branch information
achingbrain authored Feb 10, 2020
1 parent ddefb2e commit e381c8a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions SPEC/FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Prints out objects like:

Now [ipfs.io/ipfs/Qm...WW](https://ipfs.io/ipfs/QmNz1UBzpdd4HfZ3qir3aPiRdX5a93XwTuDNyXRc6PKhWW) returns the "ABC" string.

**Importing files from the file system:**
###### Importing files from the file system

Both js-ipfs and js-ipfs-http-client export a utility to make importing files from the file system easier (Note: it not available in the browser).

Expand Down Expand Up @@ -185,7 +185,7 @@ for await (const file of ipfs.add(globSource('./docs', { recursive: true }))) {
*/
```

**Importing a file from a URL:**
###### Importing a file from a URL

Both js-ipfs and js-ipfs-http-client export a utility to make importing a file from a URL easier.

Expand All @@ -208,7 +208,7 @@ for await (const file of ipfs.add(urlSource('https://ipfs.io/images/ipfs-logo.sv
*/
```

A great source of [examples][] can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-js-ipfs-core/blob/master/src/add.js) can be found in the tests for this API.

#### `cat`

Expand Down Expand Up @@ -247,7 +247,7 @@ for await (const chunk of ipfs.cat(ipfsPath)) {
console.log(Buffer.concat(chunks).toString())
```

A great source of [examples][] can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-js-ipfs-core/blob/master/src/cat.js) can be found in the tests for this API.

#### `get`

Expand Down Expand Up @@ -303,7 +303,7 @@ for await (const file of ipfs.get(cid)) {
}
```

A great source of [examples][] can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-js-ipfs-core/blob/master/src/get.js) can be found in the tests for this API.

#### `ls`

Expand Down Expand Up @@ -353,7 +353,7 @@ for await (const file of ipfs.ls(cid)) {
}
```

A great source of [examples][] can be found in the tests for this API.
A great source of [examples](https://github.com/ipfs/interface-js-ipfs-core/blob/master/src/ls.js) can be found in the tests for this API.

---

Expand Down Expand Up @@ -769,7 +769,6 @@ for await (const file of ipfs.files.ls('/screenshots')) {
// 2018-01-22T18:08:49.184Z.png
```

[examples]: https://github.com/ipfs/interface-ipfs-core/blob/master/src/files-regular
[b]: https://www.npmjs.com/package/buffer
[file]: https://developer.mozilla.org/en-US/docs/Web/API/File
[cid]: https://www.npmjs.com/package/cids
Expand Down

0 comments on commit e381c8a

Please sign in to comment.