@canopycanopycanopy/b-ber-validator 3.0.8-nav-memo.4 → 3.0.8-next.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@canopycanopycanopy/b-ber-validator`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`b-ber-validator` validates the custom directive syntax in b-ber Markdown source files before a build runs. It is written in TypeScript and implements a parser-combinator library (`combinators/`) that parses the b-ber fence syntax (`::: directive-name id attr:value ...` / `exit`). The validator checks that directive names are known, that open blocks are correctly closed, and that attribute syntax is well-formed. On failure it reports the line number and a caret-pointed excerpt via the `report` helper. The `validate` task in `b-ber-tasks` calls this package.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Key exports
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
| Export | Purpose |
|
|
8
|
+
| ----------------------- | ----------------------------------------------------------------------- |
|
|
9
|
+
| `validator` (default) | Top-level parser; run against the full file text |
|
|
10
|
+
| `report(name, failure)` | Prints a human-readable parse error with line number and source context |
|
|
11
|
+
| `colors` | ANSI colour constants used by `report` |
|
|
12
|
+
|
|
13
|
+
### Combinators (`src/combinators/`)
|
|
14
|
+
|
|
15
|
+
Parser-combinator primitives: `string`, `regex`, `sequence`, `oneOf`, `many`, `optional`, `required`, `map`, `not`, `lazy`, `close`, `constrained`, `eol`, `eos`.
|
|
16
|
+
|
|
17
|
+
## Dev
|
|
9
18
|
|
|
10
|
-
|
|
19
|
+
```bash
|
|
20
|
+
npm test # tsc type-check + eslint + jest
|
|
21
|
+
npm run build
|
|
11
22
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopycanopycanopy/b-ber-validator",
|
|
3
|
-
"version": "3.0.8-
|
|
3
|
+
"version": "3.0.8-next.61+2bbec564",
|
|
4
4
|
"description": "A b-ber syntax validator",
|
|
5
5
|
"author": "Triple Canopy <b-ber@canopycanopycanopy.com> (https://triplecanopy.github.io/)",
|
|
6
6
|
"contributors": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"url": "https://github.com/triplecanopy/b-ber/issues"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@canopycanopycanopy/b-ber-shapes-directives": "3.0.8-
|
|
39
|
+
"@canopycanopycanopy/b-ber-shapes-directives": "3.0.8-next.61+2bbec564",
|
|
40
40
|
"@types/node": "^14.14.7",
|
|
41
41
|
"@typescript-eslint/eslint-plugin": "^4.8.1",
|
|
42
42
|
"@typescript-eslint/parser": "^4.8.1",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
54
|
"tar": "^6.1.11"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "2bbec5643278f53becb0d2ba1f55edfe379d5587"
|
|
57
57
|
}
|