rustdoc icon indicating copy to clipboard operation
rustdoc copied to clipboard

Serve docs directly from `rustdoc`command

Open hardvain opened this issue 7 years ago • 7 comments

It would be nice to have something like rustdoc servecommand that generates the documentation and also serves the documentation from a local server. Auto reload for changes would be a still more nice to have.

Acceptance Criteria:

  • A command that builds the documentation and also serves it from a locally started server
  • Watch the files for changes and auto reload the documentation on changes (Extremely nice to have)

hardvain avatar Sep 21 '17 06:09 hardvain

Yup, this is certainly a thing we've thought about, possibly even as the way you look at docs locally.

steveklabnik avatar Sep 21 '17 14:09 steveklabnik

This is similar to #153 but not exactly the same.

mgattozzi avatar Sep 21 '17 17:09 mgattozzi

I'm 👎 on requiring a server to view docs locally, but I guess ember requires it?

euclio avatar Sep 21 '17 19:09 euclio

It does not require it. There are some things that are nicer with one, like pretty URLs, but that's a browser/standards issue, not an Ember thing.

steveklabnik avatar Sep 21 '17 21:09 steveklabnik

I'd be interested in giving this a shot! What's the best way to serve files? Would hyper be too low level?

TheDan64 avatar Sep 23 '17 22:09 TheDan64

So, this is kinda an open question! Given that it's local, I would argue that the smaller, the better.

There are several "simple file servers" in Rust; I even have one of my own: https://github.com/steveklabnik/simple-server/ I'm not saying mine would be the right choice, but I think whatever is simplest is the best option. We don't need to worry about things like scalability when we're talking about browsing docs locally.

steveklabnik avatar Sep 24 '17 00:09 steveklabnik

Good point! I'll be sure to check them out. I'm trying out the notify crate for watching directories. My initial foray is here.

TheDan64 avatar Sep 24 '17 00:09 TheDan64