liquid-rust icon indicating copy to clipboard operation
liquid-rust copied to clipboard

feat(lib): Implement Jekyll's version of sort

Open epage opened this issue 4 years ago • 5 comments

Part of #311

epage avatar Mar 20 '21 02:03 epage

@limeschool : posting this to keep you updated.

epage avatar Mar 20 '21 02:03 epage

Thanks for working on this, @epage! If I was actually capable of writing decent code, I would've made a PR myself.

Apologies if I came off as whiny earlier, and thanks, really.

ghost avatar Mar 20 '21 02:03 ghost

Want to finish this? I'm trying to wrap up another project before I focus on liquid/cobalt (so I can better focus).

The main other thing to know is the function try_find

epage avatar Mar 20 '21 12:03 epage

I'm working on other things right now myself, but I will give it a looking at once I learn how to write tests (I'm really amateur, haha) and once I've looked at how everything works in this crate.

ghost avatar Mar 20 '21 18:03 ghost

but I will give it a looking at once I learn how to write tests (I'm really amateur, haha)

The PR includes some of Jekyll's tests being ported with Rust with the remaining ones partially ported and commented out. Comparing the original tests with the ones that I already ported should get you most of the way there.

As for the other parts, the surrounding glue is written, just the implementation needs writing. As a hint`

let args = self.args.evaluate(runtime)?;

takes SortArgs and constructs a derive-constructed struct that has property: Option<str>, nils: Option<str>. So you can just do args.property and args.nils.

epage avatar Mar 20 '21 19:03 epage