bdarcus / csln

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

Djot integration #86

Open bdarcus opened 1 year ago

bdarcus commented 1 year ago

Preface: this depends on https://github.com/jgm/djot/issues/32, and the overall continued progress of djot.

The idea is to use djot for both:

  1. the document itself (see #49)
  2. subfield markup

For 2, then, fields like titles would always be strings, but any need to provide meaning to the components of those strings would be provided by djot.

This really would depend on djot implementing citations, and then jotdown in turn supporting them.

https://docs.rs/jotdown/latest/jotdown/#examples

But assuming so, would want to look at the latter's Render trait.

https://github.com/hellux/jotdown/blob/0173db178a73d2841aae5656d12f6c0159b285cf/src/lib.rs#L102

I think the "strategy" questions still apply here:

https://github.com/bdarcus/csl-next/issues/5

Do we:

  1. convert this to the Djot AST, and then let it do the full rendering?
  2. convert this to djot markup.
  3. instead inject the djot rendered content into this?

I guess the answer may depend on where and how it's integrated, but my impulse is to try 2 first.


Have also added suggestion to do typst too, though it's now possible to convert djot to typst via pandoc. Still, would be nice to have very nice and performant PDF output via that.

bdarcus commented 1 year ago

Worth also looking at the stanza renderer design.

https://github.com/obsidiandynamics/stanza/blob/f4faa1959a9941cc85bcfaa030c8571cd5452451/src/renderer.rs#L27