1 | # @textlint/ast-node-types
|
2 |
|
3 | The definition for textlint AST Node types.
|
4 |
|
5 | This module for parse plugin.
|
6 |
|
7 |
|
8 | For more details, see [TxtNode document](https://github.com/textlint/textlint/blob/master/docs/txtnode.md).
|
9 |
|
10 | ## Installation
|
11 |
|
12 | npm install @textlint/ast-node-types
|
13 |
|
14 | ## Usage
|
15 |
|
16 | ```js
|
17 | import { ASTNodeTypes } from "@textlint/ast-node-types";
|
18 | console.log(ASTNodeTypes.Document); // => string
|
19 | ```
|
20 |
|
21 | ### Type interface for TxtNode
|
22 |
|
23 | This library include type interface of [TxtNode](https://github.com/textlint/textlint/blob/master/docs/txtnode.md).
|
24 | TypeScript user can use it as type of TxtNode.
|
25 |
|
26 | ```ts
|
27 | // type interface
|
28 | import { TxtNode } from "@textlint/ast-node-types";
|
29 |
|
30 | ```
|
31 |
|
32 |
|
33 | ## For parser creator
|
34 |
|
35 | Please use it for creating your textlint-plugin parser.
|
36 |
|
37 | Use it by
|
38 |
|
39 | - textlint internal
|
40 | - `@textlint/text-to-ast`
|
41 | - `@textlint/markdown-to-ast`
|
42 |
|
43 | ## Versioning
|
44 |
|
45 | - major: Breaking Change
|
46 | - minor: Adding new type
|
47 | - patch: Fixing issues
|
48 |
|
49 | ## Tests
|
50 |
|
51 | npm test
|
52 |
|
53 | ## Contributing
|
54 |
|
55 | If you want to new type for AST, Please file issue :)
|
56 |
|
57 | 1. Fork it!
|
58 | 2. Create your feature branch: `git checkout -b my-new-feature`
|
59 | 3. Commit your changes: `git commit -am 'Add some feature'`
|
60 | 4. Push to the branch: `git push origin my-new-feature`
|
61 | 5. Submit a pull request :D
|
62 |
|
63 | ## License
|
64 |
|
65 | MIT
|