diff --git a/docs/06_custom_tags.md b/docs/06_custom_tags.md index 7d3c7c6f..c7c6425c 100644 --- a/docs/06_custom_tags.md +++ b/docs/06_custom_tags.md @@ -99,7 +99,7 @@ stringify( In YAML-speak, a custom data type is represented by a _tag_. To define your own tag, you need to account for the ways that your data is both parsed and stringified. Furthermore, both of those processes are split into two stages by the intermediate AST node structure. -If you wish to implement your own custom tags, the [`!!binary`](https://github.com/eemeli/yaml/blob/main/src/tags/yaml-1.1/binary.js) and [`!!set`](https://github.com/eemeli/yaml/blob/main/src/tags/yaml-1.1/set.js) tags provide relatively cohesive examples to study in addition to the simple examples in the sidebar here. +If you wish to implement your own custom tags, the [`!!binary`](https://github.com/eemeli/yaml/blob/main/src/schema/yaml-1.1/binary.ts) and [`!!set`](https://github.com/eemeli/yaml/blob/main/src/schema/yaml-1.1/set.ts) tags provide relatively cohesive examples to study in addition to the simple examples in the sidebar here. ### Parsing Custom Data @@ -135,6 +135,8 @@ For collections in particular, the default stringifier should be perfectly suffi ```js import { + createNode, // (value, tagName, ctx) => Node -- Create a new node + createPair, // (key, value, ctx) => Pair -- Create a new pair debug, // (logLevel, ...messages) => void -- Log debug messages to console findPair, // (items, key) => Pair? -- Given a key, find a matching Pair foldFlowLines, // (text, indent, mode, options) => string -- Fold long lines diff --git a/src/util.ts b/src/util.ts index b0e0848e..dd92a80d 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,4 +1,6 @@ +export { createNode, CreateNodeContext } from './doc/createNode.js' export { debug, LogLevelId, warn } from './log.js' +export { createPair } from './nodes/Pair.js' export { findPair } from './nodes/YAMLMap.js' export { toJS, ToJSContext } from './nodes/toJS.js' export { map as mapTag } from './schema/common/map.js'