Commit Graph

12 Commits

Author SHA1 Message Date
Steven Fackler
d6d31d788d Make Rustdoc strip private fields
In addition, the renderer will add comments to structs and enums saying
that fields or variants have been stripped.
2013-10-13 22:28:45 -07:00
Alex Crichton
d06043ba0b rustdoc: Generate hyperlinks between crates
The general idea of hyperlinking between crates is that it should require as
little configuration as possible, if any at all. In this vein, there are two
separate ways to generate hyperlinks between crates:

1. When you're generating documentation for a crate 'foo' into folder 'doc',
   then if foo's external crate dependencies already have documented in the
   folder 'doc', then hyperlinks will be generated. This will work because all
   documentation is in the same folder, allowing links to work seamlessly both
   on the web and on the local filesystem browser.

   The rationale for this use case is a package with multiple libraries/crates
   that all want to link to one another, and you don't want to have to deal with
   going to the web. In theory this could be extended to have a RUST_PATH-style
   searching situtation, but I'm not sure that it would work seamlessly on the
   web as it does on the local filesystem, so I'm not attempting to explore this
   case in this pull request. I believe to fully realize this potential rustdoc
   would have to be acting as a server instead of a static site generator.

2. One of foo's external dependencies has a #[doc(html_root_url = "...")]
   attribute. This means that all hyperlinks to the dependency will be rooted at
   this url.

   This use case encompasses all packages using libstd/libextra. These two
   crates now have this attribute encoded (currently at the /doc/master url) and
   will be read by anything which has a dependency on libstd/libextra. This
   should also work for arbitrary crates in the wild that have online
   documentation. I don't like how the version is hard-wired into the url, but I
   think that this may be a case-by-case thing which doesn't end up being too
   bad in the long run.

Closes #9539
2013-10-02 16:17:08 -07:00
Alex Crichton
a7f19f36be rustdoc: Remove usage of fmt! 2013-09-30 23:21:19 -07:00
Alex Crichton
88866a4c20 rustdoc: Show type parameters on external paths
This removes the internal type representation of an `External` type and instead
relies on passing around DefId structures and interpreting them accordingly.

Progress on #9539, but there's still the problem of a crate => url mapping.
2013-09-28 13:43:43 -07:00
Alex Crichton
6a277dc4ba rustdoc: Strip implementations of private traits
Closes #5416
2013-09-26 12:27:38 -07:00
Alex Crichton
ca697d3705 rustdoc: Generate documentation for foreign items
This slurps up everything inside of an 'extern' block into the enclosing module
in order to document them. The documentation must be on the items themselves,
and they'll show up next to everything else on the module index pages.

Closes #5953
2013-09-26 11:57:25 -07:00
Alex Crichton
38eab97d16 rustdoc: Fix an unindentation bug when collapsing
Turns out eagerly trimming comes back to bite you :(
2013-09-25 14:27:43 -07:00
Alex Crichton
bcb8657842 rustdoc: Collapse before unindenting
Doesn't make much sense to unindent each line individually and *then* collapse
them all together.
2013-09-25 14:27:43 -07:00
Alex Crichton
e7fa081c18 rustdoc: Reduce ambiguity with clean::Type
The "Unresolved" variant could be completely removed becuase it turns out that
the interim state only very briefly lives.
2013-09-25 14:27:43 -07:00
Alex Crichton
c838351ba6 rustdoc: Implement stripping based on privacy
This will probably need to get tweaked once the privacy rules have been fully
agreed on, but for now this has all of the infrastructure necessary for
filtering out private items.

Closes #9410
2013-09-25 14:27:42 -07:00
Alex Crichton
eaaf2bd41f rustdoc: Add the ability to list all passes
In doing so, also remove the collapse-privacy pass because it's a little
over-zealous and may not be right 100% of the time (not used right now as well)
2013-09-25 14:27:42 -07:00
Alex Crichton
7b24efd6f3 rustdoc: Out with the old, in with the new
Removes old rustdoc, moves rustdoc_ng into its place instead (plus drops the _ng
suffix). Also shreds all reference to rustdoc_ng from the Makefile rules.
2013-09-22 09:51:15 -07:00