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

API Docs: env #29351

Closed
4 tasks done
steveklabnik opened this issue Oct 26, 2015 · 21 comments
Closed
4 tasks done

API Docs: env #29351

steveklabnik opened this issue Oct 26, 2015 · 21 comments
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. P-high High priority

Comments

@steveklabnik
Copy link
Member

steveklabnik commented Oct 26, 2015

Part of #29329

http://doc.rust-lang.org/std/env/

@GuillaumeGomez
Copy link
Member

Seems the docs are all good here.

@steveklabnik
Copy link
Member Author

There's still a bunch to do here; the module documentation is very sparse, not everything has examples, not all types are linked correctly.

@steveklabnik steveklabnik reopened this Jul 11, 2016
@GuillaumeGomez
Copy link
Member

I'll try to look for the missing ones then.

@steveklabnik steveklabnik added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Mar 8, 2017
@steveklabnik
Copy link
Member Author

I am happy to mentor anyone who wants to tackle this issue.

@steveklabnik steveklabnik added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Mar 10, 2017
@steveklabnik steveklabnik added E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. P-medium Medium priority and removed A-docs labels Mar 24, 2017
@mp4096
Copy link
Contributor

mp4096 commented Apr 17, 2017

I'd like to work on this one. Here are some ideas:

  • Hoist some examples (e.g. using env vars or command line args) to the module-level documentation
  • Explain the difference between os and non-os structs and methods
  • Add explanation text for example snippets

@steveklabnik Maybe you have more ideas for a checklist? Thanks!

@steveklabnik
Copy link
Member Author

@mp4096 ah yes, I don't know how I missed this one for the checklist! Those all seem like good changes. Ill try to come up with my own list sometime soonish, but until then, PRs for any/all of those things would be great 👍

@maccoda
Copy link
Contributor

maccoda commented May 16, 2017

I wouldn't mind lending a hand here either.
@mp4096 what have managed to tackle? Don't want to step on your toes here 😄

@mp4096
Copy link
Contributor

mp4096 commented May 16, 2017

TBH I'm having a block here. Help would be greatly appreciated!

@maccoda
Copy link
Contributor

maccoda commented May 16, 2017

Alright let's give this a go then 👍
@mp4096 if you don't mind I might try some of the points you raised as I think they would greatly help!
@steveklabnik when you are talking about the Iterator boilerplate, what exact part of that link are you referring to?

@steveklabnik
Copy link
Member Author

@steveklabnik when you are talking about the Iterator boilerplate, what exact part of that link are you referring to?

This text:

An iterator that maps the values of iter with f.

This struct is created by the map() method on Iterator. See its documentation for more.

See these iterators for example:

@maccoda
Copy link
Contributor

maccoda commented May 16, 2017

Perfect. Thank you.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 20, 2017
Improving std::env docs

Addresses rust-lang#29351.
Hopefully this addresses the following points:
> -  iterators should use the standard iterator boilerplate like https://doc.rust-lang.org/std/iter/struct.Map.html, this applies to all structs except for JoinPathsError
> -  JoinPathsError should properly link the function it comes from and use language similar to https://doc.rust-lang.org/std/io/struct.Error.html
> -  same wording issues with VarError
> - functions need to ensure linkage to things they refer to in their descriptions
> - Explain the difference between `os` and non-`os` structs and methods
@steveklabnik steveklabnik self-assigned this Jun 7, 2017
@steveklabnik steveklabnik added P-high High priority and removed P-medium Medium priority labels Jun 7, 2017
@steveklabnik
Copy link
Member Author

Moving to p-high and assigning myself; i'd like to get this resolved in the next release cycle.

@mp4096 @maccoda I would still love your help if you have the time, but no worries if you don't!

@maccoda
Copy link
Contributor

maccoda commented Jun 7, 2017

@steveklabnik I am definitely keen to help close this off. What points are remaining to be addressed?

@steveklabnik
Copy link
Member Author

Hey @maccoda , thanks for all the stuff you've done so far 😄

  • Args and ArgsOs need the iterator boilerplate still.
  • I just noticed a missing period with SplitPaths, after 'function': This structure is created by the std::env::split_paths function See its documentation for more.

That actually looks like it, I think you got the rest of them! Do you want to knock those out?

@maccoda
Copy link
Contributor

maccoda commented Jun 8, 2017

No worries at all @steveklabnik.

Easy done I will target to get them done by the end of the the weekend! 😄

@maccoda
Copy link
Contributor

maccoda commented Jun 8, 2017

@steveklabnik I am just looking at the Args and ArgsOs documentation and I think the only part missing is the See its documentation for more., does that sound right to you?

This what we currently have for Args

An iterator over the arguments of a process, yielding a String value for each argument.

This structure is created through the std::env::args function.

This appears to have the general boilerplate for the remaining aspects I believe of:

  1. Describe what type of iterator it is

    An iterator over the arguments ...

  2. State how this iterator type is able to be obtained

    This structure is created through the std::env::args function.

@steveklabnik
Copy link
Member Author

I think the only part missing is the See its documentation for more., does that sound right to you?

Yeah, basically I really like the consistency of having the exact same language everywhere. So a sort of "template" is

An iterator that {what it does}.

This struct is created by the {foo} method[ on {trait}]. See its documentation for more.

where the on trait bit is optional, filling in the rest between the {}s. Make sense?

So it'd be turning

This structure is created through the std::env::args function.

into

This struct is created by the std::env::args function. See its documentation for more.

This is extremely nitpicky, but I think this kind of detail-oriented polish takes the docs from 👍 to 💯

@maccoda
Copy link
Contributor

maccoda commented Jun 10, 2017

No this is good, always easier to produce good documentation when there is a template. Will have to note this one down somewhere to remember 😄

@steveklabnik
Copy link
Member Author

Will have to note this one down somewhere to remember 😄

We do need better docs for writing docs.... ha!

frewsxcv added a commit to frewsxcv/rust that referenced this issue Jun 12, 2017
…abnik

env docs completion.

Should be closing rust-lang#29351 with the alignment of the iterators to the template.
@maccoda
Copy link
Contributor

maccoda commented Jun 12, 2017

Haha! Been keeping a reference for myself! 😄

@Mark-Simulacrum Mark-Simulacrum added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Jul 24, 2017
@steveklabnik
Copy link
Member Author

This was closed by #42579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. P-high High priority
Projects
None yet
Development

No branches or pull requests

5 participants