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: Add tooltips to sidebar (v3) #20221

Merged
merged 5 commits into from Jan 23, 2015

Conversation

@liigo
Copy link
Contributor

commented Dec 25, 2014

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,v2) PRs of this serise, which have been closed for technical reasons. Thank you.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Dec 25, 2014

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

commented Dec 29, 2014

Re-assigning to @alexcrichton since he was cited in the text (or @steveklabnik )

@frewsxcv

This comment has been minimized.

Copy link
Member

commented Jan 3, 2015

Needs a rebase

@liigo liigo force-pushed the liigo:rustdoc-sidebar-tooltips-v3 branch 2 times, most recently from 1ee163c to e788b09 Jan 9, 2015
@liigo

This comment has been minimized.

Copy link
Contributor Author

commented Jan 9, 2015

rebased

'"' => result.push_str("&quot;"),
'\'' => result.push_str("&#39;"),
_ => result.push(c),
}

This comment has been minimized.

Copy link
@alexcrichton

alexcrichton Jan 13, 2015

Member

Could this use rustdoc::html::escape instead of duplicating logic?

@@ -451,9 +479,63 @@ impl<'a> fmt::String for MarkdownWithToc<'a> {
}
}

pub fn plain_summary_line(md: &str) -> String {

This comment has been minimized.

Copy link
@alexcrichton

alexcrichton Jan 13, 2015

Member

This is a clever idea, nice thinking!

@@ -451,9 +479,63 @@ impl<'a> fmt::String for MarkdownWithToc<'a> {
}
}

pub fn plain_summary_line(md: &str) -> String {
extern "C" fn link(_ob: *mut hoedown_buffer,

This comment has been minimized.

Copy link
@alexcrichton

alexcrichton Jan 13, 2015

Member

I generally try to avoid "C" wherever possible (as it's the default).

if !content.is_null() && (*content).size > 0 {
// FIXME(liigo): I don't know why the parameter `_ob` is
// not the value passed in by `hoedown_document_render`.
// I have to manually pass in `ob` through `opaque` currently.

This comment has been minimized.

Copy link
@alexcrichton

alexcrichton Jan 13, 2015

Member

I think this is ok to remove, I believe that hoedown generally passes around intermediate buffers as the first argument as it's frequently rendering into other elements, so in this case you're just redirecting all output to one known location instead of intermediate locations.

This comment has been minimized.

Copy link
@liigo

liigo Jan 15, 2015

Author Contributor

Thank you Alex for review this! But unfortunately I'm on holiday, perhaps
I'll have time to address comments untill next week.

This comment has been minimized.

Copy link
@alexcrichton

alexcrichton Jan 15, 2015

Member

No worries!

@liigo liigo force-pushed the liigo:rustdoc-sidebar-tooltips-v3 branch from e788b09 to d22f03a Jan 17, 2015
@liigo liigo force-pushed the liigo:rustdoc-sidebar-tooltips-v3 branch from d22f03a to 2b11a80 Jan 21, 2015
@liigo

This comment has been minimized.

Copy link
Contributor Author

commented Jan 21, 2015

@alexcrichton I've addressed all your review comments in latest commit, and rebased. Sorry for the delay.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Jan 22, 2015

@bors: r+ 2b11a80

Thanks!

@bors

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2015

⌛️ Testing commit 2b11a80 with merge 9a0042b...

bors added a commit that referenced this pull request Jan 22, 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](#13014)) PRs of this serise, which have been closed for technical reasons. Thank you.
@bors

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2015

💔 Test failed - auto-win-32-nopt-t

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Jan 22, 2015

@bors: retry

@bors

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2015

⌛️ Testing commit 2b11a80 with merge 65cc262...

bors added a commit that referenced this pull request Jan 22, 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](#13014)) PRs of this serise, which have been closed for technical reasons. Thank you.
@bors

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2015

💔 Test failed - auto-win-32-nopt-t

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Jan 22, 2015

@bors: retry

@bors

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2015

⌛️ Testing commit 2b11a80 with merge cb5b1f1...

bors added a commit that referenced this pull request Jan 22, 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](#13014)) PRs of this serise, which have been closed for technical reasons. Thank you.
@bors

This comment has been minimized.

Copy link
Contributor

commented Jan 23, 2015

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Jan 23, 2015

@bors: retry

@bors

This comment has been minimized.

Copy link
Contributor

commented Jan 23, 2015

⌛️ Testing commit 2b11a80 with merge d8d5e4d...

bors added a commit that 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](#13014)) PRs of this serise, which have been closed for technical reasons. Thank you.
@bors bors merged commit 2b11a80 into rust-lang:master Jan 23, 2015
1 of 2 checks passed
1 of 2 checks passed
homu Testing commit 2b11a80 with merge d8d5e4d...
Details
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.