rust-prometheus icon indicating copy to clipboard operation
rust-prometheus copied to clipboard

Make a pass over documentation

Open brson opened this issue 6 years ago • 6 comments

Something I would personally like to do. Needed prior to 1.0.

brson avatar Jan 30 '19 19:01 brson

Maybe I'm just being dense but it seems like docs.rs doesn't have any mention of the push feature except the aside in the prose on the first page. The example worked fine, of course, once I found it.

acdha avatar Mar 25 '19 14:03 acdha

One notable problem in current documentation is that, the documentation (like members functions) of alias types are not shown. (example) This makes it very unfriendly for our most commonly used metrics because most of them are defined using an type alias over a generic type.

@nrc @brson Do you have some ideas about how we can improve it?

breezewish avatar Mar 29 '19 13:03 breezewish

Do you have some ideas about how we can improve it?

Could use newtypes instead of type aliases? (That would have other advantages too) Otherwise, you could link to the docs for the aliased type in the documentation for the alias (you can already click through, but by adding text you could point users to the docs more explicitly). You could also discuss with the rustdoc team whether they would take a PR to change the behaviour (I expect that for type Bar = Foo<f32>, showing the docs for Foo would be very easy, but showing the docs for Foo<f32> would be pretty difficult).

nrc avatar Apr 01 '19 05:04 nrc

Newtypes do look pretty reasonable though there are a number of impls to fill in.

But also it seems a reasonable idea to me that rustdoc should duplicate the appropriate impls in the newtype docs. Someone could file a feature request upstream and see if they are open to it.

brson avatar Apr 01 '19 22:04 brson

@nrc

Could use new types instead of type aliases?

Thanks for the suggestion! I will try it!

breezewish avatar Apr 07 '19 13:04 breezewish

I've unassigned myself since I've been doing nothing on this for so long.

brson avatar Apr 26 '19 01:04 brson