jgm / typst-hs

Haskell library for parsing and evaluating typst
Other
42 stars 5 forks source link

Derive the decoder for typst.toml #7

Closed glguy closed 1 year ago

glguy commented 1 year ago

If you're interested, you can use some of the other machinery to derive your toml processor. This would make it easy to add new fields or sub-sections.

If you prefer matching tables manually, I won't be offended :)

glguy commented 1 year ago

I'd like to hear if you're interested in this, but if you're going to merge it, give me a moment as I'd like to do away with the FromTable class altogether. Making this PR has got me questioning that design choice.

jgm commented 1 year ago

Sure, take as much time as you need. No great hurry on this, since it works now.

Eventually I'd also like to implement typst's toml function. (I've already implemented the similar functions for yaml, json, and xml -- see Modules/Standard.hs.) Maybe that's also something you could help with.

jgm commented 1 year ago

will merge this for now; feel free to submit a new PR if you update the API.