Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: strikethrough for item visibility #9

Open
Luctins opened this issue Oct 31, 2024 · 2 comments
Open

feature request: strikethrough for item visibility #9

Luctins opened this issue Oct 31, 2024 · 2 comments

Comments

@Luctins
Copy link
Contributor

Luctins commented Oct 31, 2024

Would it be feasible having a strikethrough-like option for item visibility?

Since this crate is usually aimed at 'data-container-like' structs, where usually all fields are pub, and repeating pub over and over is quite repetitive.

I've also tried using the public crate, but it didn't work as expected: it either only applied to the top level item when trying to use without strikethrough and with it, it tried to apply pub to enums, which is incompatible.

I would be interested in implementing this if possible.

@jcaesar
Copy link
Owner

jcaesar commented Oct 31, 2024

Shouldn't be hard, would probably go into here.

But I also have run into situations where I'd like strikethrough, but not on enums. I think I'd like something more generic. Which do you think is better?

  • #[strikethrough[…], on = struct]
  • #![ignorestrikethrough] / #![stopstrikethrough] to not apply strikethrough to self / self or any children

(Saner naming/syntax suggestions appreciated)

([Edit:] why not both?)

@Luctins
Copy link
Contributor Author

Luctins commented Nov 1, 2024

Shouldn't be hard, would probably go into here.

Ok, i'm going to look into it, thanks for the directions.

About the attribute, yes! why not both :); But I think the second alternative is more generally useful tho, i'll implement that first.

About the naming:

  • #[strikethrough[...], on = struct] seems good enough, but I'd remove the comma in that case.
  • I think #![nostrike] would be more concise for skipping subtrees. #![strikethrough[..]] is a bit of a paper cut to type (since the lsp won't help you in this case) and I would not like to make it even longer than present.
    ('th', 'gh' is kinda bad to type for non native english speakers)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants