embed-doc-image icon indicating copy to clipboard operation
embed-doc-image copied to clipboard

Support for showing images over enum types

Open ThrashAbaddon opened this issue 2 years ago • 4 comments

Hi, I've noticed there isn't a support for enums. This item is an enhancement request to introduce support for enum types.

ThrashAbaddon avatar Nov 15 '22 14:11 ThrashAbaddon

PRs welcome! I'm pretty thinly stretched right now and this crate is unfortunately pretty low on my list of priorities.

Andlon avatar Dec 08 '22 09:12 Andlon

This is something I'd also love to have. Is it a fairly mechanical change to the existing code, or do I need to know stuff to implement it?

drdozer avatar Jan 13 '23 20:01 drdozer

I've had a quick peak at the code, but am not sure quite what to do. The error I get when trying to add images to an enum variant is:

error: expected non-macro attribute, found attribute macro `embed_doc_image`
  --> src/e2.rs:41:7
   |
41 |     #[embed_doc_image("edge-image", "data/edge_images/0.png")]
   |       ^^^^^^^^^^^^^^^ not a non-macro attribute

I'm guessing this error is actually coming from rustc rather than from your macro? So I'm not quite sure which tyres to kick to get it to work properly.

drdozer avatar Jan 13 '23 20:01 drdozer

Hi @drdozer, thanks for looking into this. I'm ... not sure what's going on here. I must admit I don't have much experience writing proc macros beyond what I've done for this crate. Unfortunately I also have very limited time at the moment and can't devote much time to this crate. I'd be happy to try to assist, but I think you'd have to do most of the legwork.

Andlon avatar Feb 02 '23 07:02 Andlon