atjson
atjson copied to clipboard
Add CLI package for parsing schema files
This is an experiment in defining atjson schemas (specifically annotation definitions) as data instead of as code.
By doing so, we can provide some benefits like allowing for clients to download sources and be able to hydrate documents using the atjson libraries without having to install lots of code.
nb. I'll be providing some concrete examples of why this is a nice thing to have alongside some sample schema definitions. A possible end result of this is a registry of schemas that can be fetched (that is probably overkill though, a simpler solution would probably be better 😄)
cc @blaine I'm interested in hearing some feedback on what sorts of things may be important for this. No worries if you're busy with some other stuff 😄
A small sample schema may look like:
name: rosetta
version: 0.1.0
description: A Rosetta Stone set of annotations used to interoperate between many formats
schema:
bold:
type: mark
description: Emphasizes marked text with a heavier weight font
link:
type: mark
description: Links marked text with a URL
data:
url:
type: string
required: true
paragraph:
type: block
description: A paragraph of text
data:
decorations:
type: enum[]
values: [dropCap, leadIn]
small-caps:
type: mark