typst / biblatex

A Rust crate for parsing and writing BibTeX and BibLaTeX files.
Apache License 2.0
120 stars 15 forks source link

serde support added #14

Closed constraintAutomaton closed 2 years ago

constraintAutomaton commented 2 years ago

I think it would be good to add support for serde this way to user can convert the bib library to other formats more easily (for example store the references into a mongo database or conversion into another reference system)

reknih commented 2 years ago

Thanks for your PR!

Could you make serde an optional feature? You'll just need to change your dependency declaration to

serde = { version = "1.0", optional = true }

and mark the derived traits like this:

#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

Please test whether the crate compiles with and without the feature enabled.

constraintAutomaton commented 2 years ago

Thanks for your PR!

Could you make serde an optional feature? You'll just need to change your dependency declaration to

serde = { version = "1.0", optional = true }

and mark the derived traits like this:

#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

Please test whether the crate compiles with and without the feature enabled.

it's done, it compile with and without.