docfx icon indicating copy to clipboard operation
docfx copied to clipboard

Being able to scroll through "in this article" for larger/partial classes

Open Reddevildragg opened this issue 4 years ago • 3 comments

Operation System: windows

DocFX Version Used: 2.51

Template used: default

Steps to Reproduce:

  1. Create a class with a large number of methods (in my case was an extension class)
  2. Generate the class with Docfx

Expected Behavior: "In this Article" section behaviour to scroll up to be able to cycle though the methods quickly from this panel.

Actual Behavior: Only shows the number of entries it can fit in before it runs out of space. Screenshot_1

This is more of a question of is there a way to do this/a request if there is not than a issue.

Reddevildragg avatar Mar 25 '20 17:03 Reddevildragg

In my case, I edited some CSS properties as follows:

.affix {
  height: auto;
}

.sideaffix {
  width: 250px;
  overflow-x: hidden;
  overflow-y: auto;
}

.affix > ul.level1 {
  overflow: inherit;
}

I tested in 2.56.1.

WonyoungChoi avatar Jul 09 '20 11:07 WonyoungChoi

@WonyoungChoi thanks a lot for this workaround, it works beautfifully! As a further improvement in my case, I found that I was able to avoid specifying the size of the sideaffix if I let the text wrap around (which has the further advantage that you can actually read the complete method signatures).

.affix {
  height: auto;
}
  
.sideaffix {
  overflow-x: hidden;
  overflow-y: auto;
}

.affix > ul.level1 {
  overflow: inherit;
}

.affix ul > li.active > ul,
.affix ul > li.active > a:before,
.affix ul > li > a:hover:before {
  display: block;
  white-space: inherit;
}

glopesdev avatar Dec 29 '21 02:12 glopesdev

Your solution worked great - thank you! (Of course, for a novice like me, I also needed https://dotnet.github.io/docfx/tutorial/walkthrough/advanced_walkthrough.html to know how to use these new properties - I just added them to the end of the default docfx.css.)

Is there any reason this vertical scrollbar in the sidebar is not included in the default/styles/docfx.css?

pwm1234-sri avatar May 18 '22 15:05 pwm1234-sri