accent-proust 0.10.0 → 0.12.0

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 CHANGED
@@ -180,6 +180,13 @@ keystroke needs. Call `config.free()` when you are done with it.
180
180
  `nodes` takes the same shape as `tags`, keyed by Markdoc node type, so you can
181
181
  change what a `heading` renders as.
182
182
 
183
+ The vocabulary -- which keys a declaration may carry, and what each means -- is
184
+ [`accent-proust-schema-config`](https://github.com/zoosky/accent-proust/tree/main/crates/accent-proust-schema-config),
185
+ shared with the [command line](https://github.com/zoosky/accent-proust/tree/main/crates/accent-proust-cli).
186
+ This host reads it from an object and the command line from a YAML or JSON
187
+ file, so a schema declared for one is accepted by the other: a JSON file the
188
+ command line reads is what `JSON.parse` hands `new Config` here.
189
+
183
190
  ### What crosses, and what does not
184
191
 
185
192
  A schema is data and crosses whole: `render`, `children`, `attributes`,
@@ -188,7 +195,14 @@ A schema is data and crosses whole: `render`, `children`, `attributes`,
188
195
 
189
196
  Attribute types are written as the strings `"String"`, `"Number"`, `"Boolean"`,
190
197
  `"Object"`, `"Array"`. Markdoc uses the JavaScript constructors, and a
191
- constructor is a function. An array of them is a union.
198
+ constructor is a function. An array of them is a union, one level deep: a
199
+ list inside the list is refused.
200
+
201
+ A schema object is read key by key, so a class instance or a proxy works as
202
+ well as an object literal. Only a value carried through whole -- an attribute's
203
+ `default`, a variable -- has to be a plain object, because a `Date` or a `Map`
204
+ would flatten to `{}` on the way. An explicitly `undefined` variable is
205
+ `null`, which is what `user: session?.user` means by it.
192
206
 
193
207
  A hook is code, and code does not cross: `transform`, `validate`, a custom
194
208
  attribute type, a `RegExp` in `matches`, and host-defined `functions`. **So the
@@ -204,7 +218,9 @@ expected String, Number, Boolean, Object, Array, or an array of those
204
218
  ```
205
219
 
206
220
  A schema that half arrives is worse than one that does not, because the missing
207
- half is invisible until an author trips over it.
221
+ half is invisible until an author trips over it. For the same reason a property
222
+ whose getter throws is refused as unreadable rather than read as absent: a
223
+ block that was written and then lost is that failure in another form.
208
224
 
209
225
  ## Not supported yet
210
226
 
@@ -224,6 +224,10 @@ function __wbg_get_imports() {
224
224
  const ret = typeof(val) === 'object' && val !== null;
225
225
  return ret;
226
226
  },
227
+ __wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
228
+ const ret = typeof(getObject(arg0)) === 'string';
229
+ return ret;
230
+ },
227
231
  __wbg___wbindgen_is_symbol_d2cecf3ba20e3e5e: function(arg0) {
228
232
  const ret = typeof(getObject(arg0)) === 'symbol';
229
233
  return ret;
Binary file
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "accent-proust",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Markdoc for the browser: parse, validate, transform, render and format, compiled to WebAssembly from Rust.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/zoosky/accent-proust.git"
9
9
  },
10
- "homepage": "https://github.com/zoosky/accent-proust",
10
+ "homepage": "https://zoosky.github.io/accent-proust/",
11
11
  "keywords": [
12
12
  "markdoc",
13
13
  "markdown",