Skip to content

Commit 8ef085f

Browse files
committed
docs: Fix API docs links
1 parent 374c19c commit 8ef085f

2 files changed

Lines changed: 30 additions & 11 deletions

File tree

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,29 @@ The first has the simplest API and "just works", the second gets you all the bel
5555

5656
A [command-line tool](https://eemeli.org/yaml/#command-line-tool) is also included.
5757

58+
### Parse & Stringify
59+
5860
```js
5961
import { parse, stringify } from 'yaml'
60-
// or
61-
import YAML from 'yaml'
62-
// or
63-
const YAML = require('yaml')
6462
```
6563

66-
### Parse & Stringify
67-
6864
- [`parse(str, reviver?, options?): value`](https://eemeli.org/yaml/#yaml-parse)
6965
- [`stringify(value, replacer?, options?): string`](https://eemeli.org/yaml/#yaml-stringify)
7066

7167
### Documents
7268

69+
<!-- prettier-ignore -->
70+
```js
71+
import {
72+
Document,
73+
isDocument,
74+
parseAllDocuments,
75+
parseDocument
76+
} from 'yaml'
77+
```
78+
7379
- [`Document`](https://eemeli.org/yaml/#documents)
7480
- [`constructor(value, replacer?, options?)`](https://eemeli.org/yaml/#creating-documents)
75-
- [`#anchors`](https://eemeli.org/yaml/#working-with-anchors)
7681
- [`#contents`](https://eemeli.org/yaml/#content-nodes)
7782
- [`#directives`](https://eemeli.org/yaml/#stream-directives)
7883
- [`#errors`](https://eemeli.org/yaml/#errors)
@@ -83,6 +88,15 @@ const YAML = require('yaml')
8388

8489
### Content Nodes
8590

91+
<!-- prettier-ignore -->
92+
```js
93+
import {
94+
isAlias, isCollection, isMap, isNode,
95+
isPair, isScalar, isSeq, Scalar,
96+
visit, visitAsync, YAMLMap, YAMLSeq
97+
} from 'yaml'
98+
```
99+
86100
- [`isAlias(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
87101
- [`isCollection(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
88102
- [`isMap(foo): boolean`](https://eemeli.org/yaml/#identifying-node-types)
@@ -93,13 +107,18 @@ const YAML = require('yaml')
93107
- [`new Scalar(value)`](https://eemeli.org/yaml/#scalar-values)
94108
- [`new YAMLMap()`](https://eemeli.org/yaml/#collections)
95109
- [`new YAMLSeq()`](https://eemeli.org/yaml/#collections)
96-
- [`doc.createAlias(node, name?): Alias`](https://eemeli.org/yaml/#working-with-anchors)
110+
- [`doc.createAlias(node, name?): Alias`](https://eemeli.org/yaml/#creating-nodes)
97111
- [`doc.createNode(value, options?): Node`](https://eemeli.org/yaml/#creating-nodes)
98112
- [`doc.createPair(key, value): Pair`](https://eemeli.org/yaml/#creating-nodes)
99113
- [`visit(node, visitor)`](https://eemeli.org/yaml/#finding-and-modifying-nodes)
114+
- [`visitAsync(node, visitor)`](https://eemeli.org/yaml/#finding-and-modifying-nodes)
100115

101116
### Parsing YAML
102117

118+
```js
119+
import { Composer, Lexer, Parser } from 'yaml'
120+
```
121+
103122
- [`new Lexer().lex(src)`](https://eemeli.org/yaml/#lexer)
104123
- [`new Parser(onNewLine?).parse(src)`](https://eemeli.org/yaml/#parser)
105124
- [`new Composer(options?).compose(tokens)`](https://eemeli.org/yaml/#composer)

docs/01_intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ import {
8686
} from 'yaml'
8787
```
8888

89-
- [`isNode(foo): boolean`](#identifying-nodes)
89+
- [`is*(foo): boolean`](#identifying-node-types)
9090
- [`new Scalar(value)`](#scalar-values)
9191
- [`new YAMLMap()`](#collections)
9292
- [`new YAMLSeq()`](#collections)
9393
- [`doc.createAlias(node, name?): Alias`](#creating-nodes)
9494
- [`doc.createNode(value, options?): Node`](#creating-nodes)
9595
- [`doc.createPair(key, value): Pair`](#creating-nodes)
96-
- [`visit(node, visitor)`](#modifying-nodes)
97-
- [`visitAsync(node, visitor)`](#modifying-nodes)
96+
- [`visit(node, visitor)`](#finding-and-modifying-nodes)
97+
- [`visitAsync(node, visitor)`](#finding-and-modifying-nodes)
9898

9999
<h3>Parsing YAML</h3>
100100

0 commit comments

Comments
 (0)