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

rustdoc: improve sidebar, add to crate root page, add tooltips #13014

Closed
wants to merge 1 commit into from

Conversation

liigo
Copy link
Contributor

@liigo liigo commented Mar 19, 2014

  • Add sidebar to crate root index.html, to preview the structure of
    the crate quickly.

    If there are too many documents in the crate root, such as log
    index.html, you can't find any informations of its mods and types,
    unless and untill you scroll down to the bottom of the page.

  • Add tooltips to links of sidebar, showing shortened doc-comments.

Preview:
http://liigo.com/tmp/rust/doc/std/index.html
http://liigo.com/tmp/rust/doc/log/index.html

- Add sidebar to crate root index.html, to preview the structure of
  the crate quickly.

  If there are too many documents in the crate root, such as log\
  index.html, you can't find any informations of its mods and types,
  unless and untill you scroll down to the bottom of the page.

- Add tooltips to links of sidebar, showing shortened doc-comments.
@alexcrichton
Copy link
Member

This deviates from the current design that the current module's items are at the bottom while the containing module's items are on the left. This puts everything on the left for exactly one thing, the crate, while everything else still "suffers" by having things at the bottom. I would prefer that we stay consistent rather than special casing one level of the hierarchy.

@liigo
Copy link
Contributor Author

liigo commented Mar 19, 2014

If no sidebar in crate root page, users always "suffers" by have to scroll
down to find some items to navigate to.

In non-root pages, uses can always navigate from sidebar. But in root
pages, there's no sidebar. It was inconsistent.
2014年3月19日 下午11:26于 "Alex Crichton" [email protected]写道:

This deviates from the current design that the current module's items are
at the bottom while the containing module's items are on the left. This
puts everything on the left for exactly one thing, the crate, while
everything else still "suffers" by having things at the bottom. I would
prefer that we stay consistent rather than special casing one level of the
hierarchy.


Reply to this email directly or view it on GitHubhttps://github.com//pull/13014#issuecomment-38064151
.

@alexcrichton
Copy link
Member

In non-root pages, uses can always navigate from sidebar

Yes, they can navigate the parent's contents, not their contents. The root page navigates the directory of crates, which it currently does.

@liigo
Copy link
Contributor Author

liigo commented Mar 20, 2014

This makes difficulty in use. People open std/index.html, must scroll down and search items from long text.

2014年3月20日 上午7:24于 "Alex Crichton" [email protected]写道:

In non-root pages, uses can always navigate from sidebar

Yes, they can navigate the parent's contents, not their contents. The
root page navigates the directory of crates, which it currently does.


Reply to this email directly or view it on GitHubhttps://github.com//pull/13014#issuecomment-38119832
.

@alexcrichton
Copy link
Member

It sounds like you're describing what you think is a general problem with rustdoc. You have fixed it in one case here, not in all cases. It will be expected that all pages have their contents on the left, not just the root page.

@liigo
Copy link
Contributor Author

liigo commented Mar 21, 2014

I got it. I'll try to update this PR. Thank you!

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with a rebase!

bors referenced this pull request Jan 23, 2015
This pull request add tooltips to most links of sidebar.
The tooltips display "summary line" of items' document.

Some lengthy/annoying raw markdown code are eliminated, such as links and headers.
- `[Rust](http://rust-lang.org)` displays as `Rust` (no URLs)
- `# header` displays as `header` (no `#`s)

Some inline spans, e.g. ``` `code` ``` and ```*emphasis*```, are kept as they are, for better readable.

I've make sure `&` `'` `"` `<` and `>` are properly displayed in tooltips, for example, `&'a Option<T>`.

Online preview: http://liigo.com/tmp/tooltips/std/index.html

@alexcrichton @steveklabnik since you have reviewed my previous ([v1](https://github.com/rust-lang/rust/pull/13014),[v2](https://github.com/rust-lang/rust/pull/16448)) PRs of this serise, which have been closed for technical reasons. Thank you.
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 16, 2022
minor: Simplify `GlobalState::handle_event`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants