bdarcus / csl-next

An experimental reimagining of CSL
Mozilla Public License 2.0
8 stars 0 forks source link

restart of render #115

Closed bdarcus closed 1 year ago

bdarcus commented 1 year ago

Very much WIP., picking up where I left off with #114.

Plan

Basic plan is to iterate through the (ultimately sorted) array of ProcReference instances, and from there through the style templates, and return an array of ProcTemplate objects, which are just the templates with added rendered strings.

  [
    [ { contributors: "author", procValue: [ [Object] ] } ],
    {
      date: "issued",
      format: "year",
      wrap: "parentheses",
      procValue: "2020"
    },
    [ { title: "title", procValue: "The Title" } ],
    [ { title: "container-title", procValue: undefined } ],
    [
      {
        contributors: "publisher",
        wrap: "parentheses",
        procValue: undefined
      }
    ]
  ]

Then output to different final targets (plain text, maybe Djot and/or pandoc, HTML) would involve transforming that.

Status

It's mostly working finally, but still need to:

  1. run the transform functions on the input data to produce a consistent string as the value.
  2. don't add the ProcTemplate unless there's a value.
  3. handle both citation and bibliography, at least as a start
  4. misc cleanup.