gtk-rs / gir

Tool to generate rust bindings and user API for glib-based libraries
https://gtk-rs.org/gir/book/
MIT License
230 stars 102 forks source link

Replace dox feature with docsrs attribute #1455

Closed AaronErhardt closed 1 year ago

AaronErhardt commented 1 year ago

Fixes #1454

I think this should be all from the gir side. I've tested this branch on gtk4-rs and everything looked and worked great so far.

Let me know if I should submit PRs for various gtk-rs crates once this is merged.

bilelmoussaoui commented 1 year ago

I would also suggest documenting how cargo doc should be ran in the gir book if possible

GuillaumeGomez commented 1 year ago

So sadly it will require to add a --feature argument when running cargo doc. Not much we can do about it... Really annoyed that cargo still doesn't allow to have doc profile for that.

bilelmoussaoui commented 1 year ago

So sadly it will require to add a --feature argument when running cargo doc. Not much we can do about it... Really annoyed that cargo still doesn't allow to have doc profile for that.

why a --feature is needed? i thought everything would be handled by the RUSTFLAGS?

GuillaumeGomez commented 1 year ago

Sorry, you're right. Wrote too quickly. RUSTFLAGS is what I meant.

sdroege commented 1 year ago

And generator.py would set that accordingly before calling cargo doc.

AaronErhardt commented 1 year ago

Speaking of generator.py, I haven't changed anything on this file so far. As far as I understand it doesn't run cargo doc but expects the user to do so after following all required steps. Should I change something about that?

Everything else should be in place by now, I've pushed an update for the book earlier today.

sdroege commented 1 year ago

Oh right. But we set RUSTFLAGS for that already anyway so adding just one more thing is not a problem. Currently we have to set RUSTFLAGS=-Z unstable-options at least.

AaronErhardt commented 1 year ago

Is there still anything missing in this PR?

sdroege commented 1 year ago

@AaronErhardt Once merged, will you create PRs for gtk-rs-core and gtk4-rs at least to update accordingly?

AaronErhardt commented 1 year ago

Sure

sdroege commented 1 year ago

Great, then let's get this in :) I can take care of gstreamer-rs once the others are in.