- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Make the line numbers of the source code clickable #20092
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
Conversation
| r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) | 
76c1437    to
    9dc1e1c      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change, while good, is totally unrelated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was in worry of opening another PR to handle such a minor change. (It felt like spamming.) May I open a new one anyways?
| Our actual highlighting script supports ranges: http://doc.rust-lang.org/src/core/slice.rs.html#456-470, which Github's UI supports through shift-clicking line numbers. Possible? | 
9dc1e1c    to
    2169702      
    Compare
  
    | @gankro Challenge accepted. I've pushed a new implementation. Currently running tests. | 
6374597    to
    5bce14b      
    Compare
  
    | This is cool! Would it be possible to publish an example somewhere so we can experiment? (If you don't have an alternative, you can use github pages: e.g. commit a generated copy to a  | 
| Awesome! Could you also put the new JS wad into  | 
01ea47e    to
    a5617b6      
    Compare
  
    | @huonw I've uploaded them to https://barosl.com/tmp/rust/doc/src/std/lib.rs.html @alexcrichton Oops, sorry. I should have considered that. It is fixed now. | 
| I've changed a bit more, using the HTML5 history API(pushState) if the browser supports it. This prevents the page from being scrolled. Also, I also removed the unused  | 
a5617b6    to
    9bf309a      
    Compare
  
            
          
                src/librustdoc/html/static/main.css
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this CSS rule was also used for clicking on headers in documentation. That may be covered elsewhere, but can you make sure that if you click on a header that it still gets highlighted?
9bf309a    to
    87d4444      
    Compare
  
    extra library -> standard library
87d4444    to
    739f74b      
    Compare
  
    While talking on IRC, someone wanted to post a link to the Rust source code, but while the lines of the rendered source code do have anchors (`<span id="[line number]">`), there is no convenient way to make links as they are not clickable. This PR makes them clickable. Also, a minor fix of the FAQ is included.
While talking on IRC, someone wanted to post a link to the Rust source code, but while the lines of the rendered source code do have anchors (`<span id="[line number]">`), there is no convenient way to make links as they are not clickable. This PR makes them clickable. Also, a minor fix of the FAQ is included.
Due to the CSS changes done by the previous patch to make the line numbers clickable (rust-lang#20092), the sidebar became unclickable. This commit reverts the changes and adopts an alternative approach.
Due to the CSS changes done by the previous patch to make the line numbers clickable (rust-lang#20092), the sidebar became unclickable. This PR reverts the changes and adopts an alternative approach. I'm very sorry for having broken things.
Drop rustc workspace loading error, if we don't needs its sources
Drop rustc workspace loading error, if we don't needs its sources
While talking on IRC, someone wanted to post a link to the Rust source code, but while the lines of the rendered source code do have anchors (
<span id="[line number]">), there is no convenient way to make links as they are not clickable. This PR makes them clickable.Also, a minor fix of the FAQ is included.