Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI package for parsing schema files #1286

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add CLI package for parsing schema files #1286

wants to merge 1 commit into from

Conversation

tim-evans
Copy link
Collaborator

@tim-evans tim-evans commented Jun 29, 2022

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

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.
@tim-evans tim-evans added 🎉 Feature A new feature or request ⚗️ Experiment labels Jun 29, 2022
@tim-evans
Copy link
Collaborator Author

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
Copy link
Collaborator Author

tim-evans commented Jun 29, 2022

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

@@ -46,10 +47,11 @@
"react": "17.0.2",
"react-dom": "17.0.2",
"ts-loader": "9.2.8",
"typescript": "4.6.2",
"typescript": "^4.8.0-dev.20220628",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this....right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚗️ Experiment 🎉 Feature A new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants