@agentshouse/mdmodel 0.1.0-alpha.17 → 0.1.0-alpha.19
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/API.md +13 -11
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +529 -148
- package/dist/links.js.map +1 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +10 -2
- package/dist/project.js.map +1 -1
- package/dist/schema.d.ts +2 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +5 -0
- package/dist/schema.js.map +1 -1
- package/dist/sections.d.ts +2 -1
- package/dist/sections.d.ts.map +1 -1
- package/dist/sections.js +33 -15
- package/dist/sections.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +49 -22
- package/dist/validate.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/yaml.d.ts +1 -0
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +1 -1
- package/dist/yaml.js.map +1 -1
- package/fixtures/README.md +11 -5
- package/fixtures/cases/section-item-enum/context.json +1 -0
- package/fixtures/cases/section-item-enum/expected.json +7 -0
- package/fixtures/cases/section-item-enum/library/task.md +8 -0
- package/fixtures/cases/section-item-enum/schema.yaml +4 -0
- package/fixtures/cases/section-item-kind/context.json +1 -0
- package/fixtures/cases/section-item-kind/expected.json +7 -0
- package/fixtures/cases/section-item-kind/library/task.md +8 -0
- package/fixtures/cases/section-item-kind/schema.yaml +4 -0
- package/fixtures/cases/section-items/context.json +1 -0
- package/fixtures/cases/section-items/expected.json +1 -0
- package/fixtures/cases/section-items/library/other.md +3 -0
- package/fixtures/cases/section-items/library/page.md +28 -0
- package/fixtures/cases/section-items/schema.yaml +8 -0
- package/fixtures/cases/section-reference-path/context.json +1 -0
- package/fixtures/cases/section-reference-path/expected.json +7 -0
- package/fixtures/cases/section-reference-path/library/other.md +3 -0
- package/fixtures/cases/section-reference-path/library/page.md +7 -0
- package/fixtures/cases/section-reference-path/schema.yaml +4 -0
- package/fixtures/cases/section-reference-type/context.json +1 -0
- package/fixtures/cases/section-reference-type/expected.json +7 -0
- package/fixtures/cases/section-reference-type/library/note.md +1 -0
- package/fixtures/cases/section-reference-type/library/page.md +7 -0
- package/fixtures/cases/section-reference-type/schema.yaml +4 -0
- package/fixtures/cases/shortcut-reference-link/context.json +1 -0
- package/fixtures/cases/shortcut-reference-link/expected.json +6 -0
- package/fixtures/cases/shortcut-reference-link/library/item.md +10 -0
- package/fixtures/cases/shortcut-reference-link/schema.yaml +6 -0
- package/fixtures/cases/text-field-kind/context.json +1 -0
- package/fixtures/cases/text-field-kind/expected.json +7 -0
- package/fixtures/cases/text-field-kind/library/page.md +4 -0
- package/fixtures/cases/text-field-kind/schema.yaml +4 -0
- package/fixtures/projection.json +61 -0
- package/package.json +1 -1
package/API.md
CHANGED
|
@@ -93,9 +93,11 @@ A typed Document carries the frontmatter fields its MD type declares, plus
|
|
|
93
93
|
`member_document` also carries `member`, a string, unless that type declares
|
|
94
94
|
it. Any other field is refused as `undeclared-field` at that field name. A field
|
|
95
95
|
name YAML carries to a record prototype, `__proto__` among them, is an ordinary
|
|
96
|
-
undeclared field and is refused as one.
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
undeclared field and is refused as one. Every occurrence of a declared list section is a list
|
|
97
|
+
whose every item is one value of its declared item kind, or it is refused as `structured-section`.
|
|
98
|
+
A free-text or string item is any text; a number, date, or enum item is that value alone, such
|
|
99
|
+
as `- 3`; a reference item is one ordinary link alone, such as `- [Ada](ada.md)`, refused as
|
|
100
|
+
`unresolved-reference` where it reaches a binary target, a URL, or another MD type's Document.
|
|
99
101
|
Validation returns acceptance or one refusal naming the file, the field or
|
|
100
102
|
section, the violated rule, and `VERSION`. `parse`, `apply`, and `serialize` operate on a single text
|
|
101
103
|
Document; they do not validate collection membership or consume binary bytes.
|
|
@@ -220,14 +222,14 @@ the model reads no bytes, resolves no authority, and classifies nothing it was
|
|
|
220
222
|
not given.
|
|
221
223
|
|
|
222
224
|
An internal link contributes its visible label and no destination, fragment, or
|
|
223
|
-
title, in the inline `[label](path)`, full `[label][id]`,
|
|
224
|
-
`[label][]` forms, and the link reference definition an
|
|
225
|
-
through leaves the projection with it. An image at a
|
|
226
|
-
contributes its alt text the same way, because a move
|
|
227
|
-
too. External URLs, retained binary targets,
|
|
228
|
-
fragments, code spans, fenced code, and escaped
|
|
229
|
-
read through the same syntax profile `links`
|
|
230
|
-
returns text and never rewrites the Document.
|
|
225
|
+
title, in the inline `[label](path)`, full `[label][id]`, collapsed
|
|
226
|
+
`[label][]`, and shortcut `[label]` forms, and the link reference definition an
|
|
227
|
+
enumerated use resolves through leaves the projection with it. An image at a
|
|
228
|
+
supplied document target contributes its alt text the same way, because a move
|
|
229
|
+
rewrites that destination too. External URLs, retained binary targets,
|
|
230
|
+
unsupplied destinations, bare fragments, code spans, fenced code, and escaped
|
|
231
|
+
syntax stay exactly as authored, read through the same syntax profile `links`
|
|
232
|
+
and `validate` read. `project` returns text and never rewrites the Document.
|
|
231
233
|
|
|
232
234
|
Because a moved Path changes destinations alone, applying a `link` change leaves
|
|
233
235
|
the projection of every Document it rewrites byte-identical, while a changed
|
package/dist/links.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AA0sBA,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,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