- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
rustdoc: Hide item contents, not items #83337
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
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            16 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      c96f86d
              
                rustdoc: Stop hiding entire item declarations
              
              
                Manishearth 71c52ac
              
                rustdoc: hide variants of enums > 5
              
              
                Manishearth f146b97
              
                rustdoc: hide fields of structs/unions > 5
              
              
                Manishearth 173cbec
              
                rustdoc: smartly hide associated items of traits if there are too man…
              
              
                Manishearth 256e594
              
                rustdoc: Add setting for hiding large items
              
              
                Manishearth e2f59f4
              
                Update src/librustdoc/html/render/print_item.rs
              
              
                Manishearth 846a4e9
              
                Update src/librustdoc/html/render/print_item.rs
              
              
                Manishearth def144c
              
                Improve CSS for "hide contents, not items"
              
              
                jsha 8e9882d
              
                Add css classes
              
              
                Manishearth 01afa07
              
                should_hide_fields > 12
              
              
                Manishearth b40bd5a
              
                Add test for item hiding
              
              
                Manishearth 97cd30d
              
                Wrap toggle_open()
              
              
                Manishearth 05d1e72
              
                & -> &&
              
              
                Manishearth 942ed31
              
                Move color to themes
              
              
                Manishearth 5c2820b
              
                +ignore-tidy-filelength
              
              
                Manishearth 55b2944
              
                Update attribute tests
              
              
                Manishearth File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
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.
Looking at the code, I'd feel much better if we handled it using a closure like it was suggested. It seems very easy to forget... :-/
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 don't think it's possible to have a closure for more complex things like the trait. I could use a drop guard so that it ICEs instead, but that's about it.
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.
What's preventing to have something like:
? I might miss something obvious here. :-/
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.
Look at the trait code; it calls
toggle_openat three different points, andtoggle_closeonce.Again, I tried this, it was too ugly and even more confusing, so I decided not to. I don't think this is too bad. We could add a destructor bomb but honestly we're using this a couple times and shouldn't have to yet. I'd rather get the entire toggle stuff revamped first.