aclysma / rafx

Multi-backend renderer with asset pipeline. The objective of this repo is to build a scalable, flexible, data driven renderer.
Apache License 2.0
640 stars 32 forks source link

Add Features to Docs.rs & Inline Re-exported Crates #165

Closed zicklag closed 3 years ago

zicklag commented 3 years ago

Also updates some presumably out-of-date docs.

aclysma commented 3 years ago

The cargo.toml change is fine. For the lib.rs:

aclysma commented 3 years ago

Just looked up doc(inline). I think the way it presents in rustdoc now is fine (but if you want to paste a screenshot of what it would look like after the change, happy to look with an open mind!)

FYI while rafx-api did get a pretty decent pass on rustdoc (as I think rafx-api is pretty mature and unlikely to change significantly, there is little to no rustdoc comments in the higher-level code, and I don't plan on making a pass to improve this until it is more mature.

zicklag commented 3 years ago

I prefer the flat module layout (For a project in this phase of maturity I usually avoid renames/moves unless it's a substantial improvement in clarity. I think we might just go in circles otherwise.)

Makes sense. 👍

I would keep the first doc comment explaining how to generate full docs. (Even with the feature flags in the cargo.toml, it's still not really complete since the end-user can pick other docs.)

There I put that back in there.

Just looked up doc(inline). I think the way it presents in rustdoc now is fine (but if you want to paste a screenshot of what it would look like after the change, happy to look with an open mind!)

Here's with the inlined docs:

image

And here's without:

image

It's subjectively "nicer" looking without the re-exports section and you also get the descriptions of the re-exported modules. For instance, with the framework module, you can see the description of it in the inlined version, but you would have to click on it in the re-exports section.

The biggest reason to inline the docs, though, is for searching. If you search RafxApi on docs.rs/rafx right now it will not find anything because RafxApi is in the api re-export. If you inline the docs, though, you can search RafxApi and it will it in rafx::api::RafxApi because it treats api like an inline module instead of a separate crate.

FYI while rafx-api did get a pretty decent pass on rustdoc (as I think rafx-api is pretty mature and unlikely to change significantly, there is little to no rustdoc comments in the higher-level code, and I don't plan on making a pass to improve this until it is more mature.

OK, sounds good.

aclysma commented 3 years ago

Sorry for the delay on this, I've been busy with prototyping a blender export workflow for models and scenes and not looking at GitHub, and I forgot about this :)