rust-lang/rust

The Standard Library Documentation Checklist

Closed this issue ยท 27 comments

I've been doing work on random parts of the standard library, but it's time to get systematic.

Here's a list of all of the top-level modules in std, with separate tracking issues for each part. Documentation is never done, but I'd at least like to ensure that every module is seen at least once.

PRs will be sent for consistency, more examples, better explanations, all the usual stuff. But here's how we can track progress.

One specific area where we can do much better is linking of types to their docs in text explanations.

durka commented

One specific area where we can do much better is linking of types to their docs in text explanations.

Regarding this, is there any hope of extending Markdown with a way to reference Rust items, so you don't have to rely on knowing the URL structure?

I'm not aware of CommonMark having extension capabilities, but yeah, let's just say that there's nothing close enough on the horizon to actually use.

let's just say that there's nothing close enough on the horizon to actually use.

But why not add a thin layer in rustdoc which could translate links of the form, say, rustdoc://std::collections::BinaryHeap into /std/collections/struct.BinaryHeap.html before passing it to the markdown parser?

@cristicbz such would be nice

@tshepang think you got the wrong guy

yeah

Replacing hoedown with https://github.com/google/pulldown-cmark should make these translations trivial because it exposes a token-stream-like interface that can be mapped over.

@steveklabnik @gankro ๐Ÿ‘

Has anyone started working on replacing with pulldown-cmark?

I was looking at librustdoc source, didn't get the flow of parsing... I'll take a better look later -- an interaction diagram would have helped a lot.

(Interaction diagrams of building the compiler would also be a nice-to-have -- could replace nitty-gritty.)

I don't believe so, no. Rustdoc in general needs a ton of help.

The flow of parsing is bananas and involves recording events using thread-local statics. I believe @alexcrichton wants to address the problem of Rust depending on external crates in tandem with this project.

I'm going to take a look as soon as I can.

I toggled the added docs. All up to date now.

Has anyone started working on replacing [hoedown] with pulldown-cmark?

This is almost done now, except for rendering of books. Once the buildsystem is moved to Cargo-based, I think we should also think about supporting custom links.

@critiqjo oh wow! That's awesome

@steveklabnik Looks like io, num, std::slice, and vec are closed and can be checked off.

Suggestion: Turn this into a Project? (Might help in gaining visibility, or just to test if the workflow helps?)

@critiqjo I like that idea! Is anybody against it? I would put one up but it seems that project creation is restricted.

I think I went over every items. Once I have time, I'll try to check if I missed any.

We haven't, as a matter of project policy, decided if we're using projects, and for what.

We should talk about it at the next docs meeting.

Opened an issue for moving to pulldown-cmark: #38400

Update: I'm going to go through all of the ones that are still open today and elaborate on exactly what they need to have done to be considered closed.

Update:

  • env is checked off, but probably shouldn't be, as #29351 is open
  • the issues for hash, net, and std::str have been closed, so these can be checked off
  • path isn't listed currently (#29368)
  • ascii isn't listed currently either; #29341 is still open, but can be closed, so this should probably be checked off as well
  • option was already checked off somehow, but the issue is still open; as for ascii though, it has been addressed and can be closed as far as I can tell

Unchecked env.
Checked hash, net, and std::str.

path and ascii still need to be added.

@steveklabnik update checklist please:
convert, done
env, done

Updated.

I think this issue has served its use. There's only a few things left, and we can track them in their own issues.

Thank you to everyone who pitched in and made the standard library docs better over the last three years! โค๏ธ