bdarcus / csln

Reimagining CSL
Mozilla Public License 2.0
13 stars 0 forks source link

Render cleanup #25

Closed bdarcus closed 1 year ago

bdarcus commented 1 year ago

Basic rendering now works so:

  1. [X] add it to CLI
  2. [X] fix render_references so it returns an array of templates (also need to add a type for that)
  3. [X] fix what seems to be a input date format issue (see error below)
  4. [X] fill out the example style to demonstrate and test better.

Tackle these later:

  1. [ ] add edtf:Date formatting
  2. [ ] add disambiguation from hints
  3. [ ] I think I want to remove the outer templateComponent property in the AST, but may do later
    {
      "templateComponent": {
        "contributor": "author",
        "form": "long",
        "rendering": null
      },
      "value": "United Nations"
    }

❯ target/debug/csln processor/examples/style.csl.yaml processor/examples/ex1.bib.yaml
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(TooShort)', bibliography/src/reference.rs:101:82
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

On EDTF, here's what the parse function returns, so will presumably need to match on this?

pub enum Edtf {
    DateTime,
    Date,
    YYear,
    Interval,
    IntervalFrom,
    IntervalTo,
}

I think I then need to use chrono to do the formatting, but I'm not sure:

https://docs.rs/chrono/latest/chrono/#formatting-and-parsing

bdarcus commented 1 year ago

@cormacrelf . here's the PR branch where I'm trying to figure out how to integrated localized edtf date formatting. Any help would be much appreciated.

EDIT: I merged what I had, and will tackle this piece later. Still would love some help!