atjson icon indicating copy to clipboard operation
atjson copied to clipboard

Add CLI package for parsing schema files

Open tim-evans opened this issue 2 years ago • 2 comments

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 😄)

tim-evans avatar Jun 29 '22 22:06 tim-evans

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 😄

tim-evans avatar Jun 29 '22 22:06 tim-evans

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

tim-evans avatar Jun 29 '22 22:06 tim-evans