html-query icon indicating copy to clipboard operation
html-query copied to clipboard

Refactor into a library

Open zexa opened this issue 2 years ago • 5 comments

I'd like to use hq in one of my personal rust projects, but I don't want to use the binary.

Could we refactor hq into a library and make the binary use that lib instead?

zexa avatar Mar 10 '23 14:03 zexa

That's a great idea - I don't have time to work on it right now, but when I next get round to making changes to this project I will give it a go.

Can you describe what kind of interface you'd like for the library?

orf avatar Mar 10 '23 14:03 orf

I'd love to have something like a pub fn hq(query: impl ToString, text: impl ToString) -> Result<serde_json::Value, HqError>

zexa avatar Mar 10 '23 15:03 zexa

I was having more thoughts about this and figured I'd also love to have pub fn validate_query(query: impl ToString) -> Result<(), HqError>

zexa avatar Mar 22 '23 08:03 zexa

Agree, would love to see this as a library.

magick93 avatar Mar 08 '24 21:03 magick93

Yep! This is my next project to show some love to. I’m going to be making this into a library, changing a few things around and making it a bit more easy to use.

orf avatar Mar 09 '24 22:03 orf