structstruck icon indicating copy to clipboard operation
structstruck copied to clipboard

Add the capability of skipping strikethrough for subtrees

Open Luctins opened this issue 1 year ago • 8 comments

Add a new attribute named nostrike that allows you to skip subtrees for strikethrough.

initial discussion in #9

Luctins avatar Nov 05 '24 19:11 Luctins

@jcaesar I think this does work, but not for subtrees yet.

Luctins avatar Nov 05 '24 19:11 Luctins

(I guess we can ignore the possibility of attribute name collisions for now. Let's see if it ever comes to bite.)

jcaesar avatar Nov 06 '24 00:11 jcaesar

There now is (or will very soon be) machinery for checking for attributes, and I'll rename strikethrough to structstruck::each.

Maybe you can add #[structstruck::exclude_each] or something based on that?

jcaesar avatar Dec 15 '24 13:12 jcaesar

Ok! I was also keeping up with the conversation in the other issue so all good from my part.

I'm just a little swamped with work and end-of-year related things right now, so probably I'm going to take a look at this in January.

Luctins avatar Dec 16 '24 18:12 Luctins

I've updated this to fit with current HEAD and added a test and minimal documentation. It'd be nice if you could give it a look before I merge it and release it as 0.5.

jcaesar avatar Mar 01 '25 09:03 jcaesar

Ok, I'll take a look.

Luctins avatar Mar 04 '25 22:03 Luctins

somewhat error prone to type (at least for me)

Heh, same. That's what I get for being punny.

Also does the current check_crate_attr supports aliasing the crate name to something shorter?

I'm not even sure there's a way to do that, the macros don't know about any use structstruck as foo;. I haven't tested what happens if you foo = { name = "structstruck", … } in your Cargo.toml, that might do something.

jcaesar avatar Mar 05 '25 01:03 jcaesar

(I messed up a few pushes, I hope it's back to what it should be now.)

jcaesar avatar Mar 05 '25 04:03 jcaesar