bible-technology / scripture-burrito

Scripture Burrito Schema & Docs 🌯
http://docs.burrito.bible/
MIT License
21 stars 13 forks source link

Declarative Extensions for Recipes #181

Closed jonathanrobie closed 3 years ago

jonathanrobie commented 4 years ago

I would like to have a way to allow any processor to define declarative operations that it can perform and use these operations to describe the relationship between a variant and its source.

For instance, DBL might need to do things like remove footnotes, tweak licenses, and convert to USX. It can specify the sequence of operations it used to create a variant with a list of operations that it knows how to perform:

"recipe": {
    "steps": [
      { "dbl": "removeFootnotes" },
      { "dbl": "tweakLicenses"},
      { "dbl": "usfm2usx"}
    ],
    "content": [
      {
        "type": "section",
        "nameId": "ot",
        "content": [
          {
            "type": "element",
            "nameId": "intot",
            "ingredient": "release/text/USX_1/OTINT.usx"
          },

No two processors have to agree on a set of operations, each processor can provide a set of operations that it finds useful.

The implementation of these operations is up to the processor that created the variant and can be changed at any time with anything that can perform the operation.

jonathanrobie commented 4 years ago

Question: do processors that are not idServers also need to be able to create variants and specify recipes for them?

Or is this a YAGNI?

jonathanrobie commented 4 years ago

Joel suggested descriptions rather than identifiers. Something like this:

"recipe": {
    "steps": [
      { "dbl": "Remove all footnotes" },
      { "dbl": "Change license to CC BY-SA"},
      { "dbl": "Converted from USFM to USX"}
    ],
    "content": [
      {
        "type": "section",
        "nameId": "ot",
        "content": [
          {
            "type": "element",
            "nameId": "intot",
            "ingredient": "release/text/USX_1/OTINT.usx"
          },