Skip to content

Commit e3ca418

Browse files
committed
Add fallback typefaces for monospaced sections in scaladoc
This commit will also fix the `Filter All Members` input appearing if there are no members - please see root for an example. There's also a small CSS fix that addresses a vertical scrollbar on smaller viewports (footer was not responsively resized). review: @VladUreche lol
1 parent 0f0afb5 commit e3ca418

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ trait EntityPage extends HtmlPage {
173173
</div>
174174

175175
val valueMembers =
176-
tpl.methods ++ tpl.values ++ tpl.templates.filter(x => x.isObject || x.isPackage) sorted
176+
tpl.methods ++ tpl.values ++ tpl.templates.filter(x => x.isObject) sorted
177177

178178
val (absValueMembers, nonAbsValueMembers) =
179179
valueMembers partition (_.isAbstract)
@@ -232,6 +232,7 @@ trait EntityPage extends HtmlPage {
232232

233233
{ memberToCommentHtml(tpl, tpl.inTemplate, isSelf = true) }
234234

235+
{ if (valueMembers.filterNot(_.kind == "package").isEmpty) NodeSeq.Empty else
235236
<div id="mbrsel">
236237
<div class='toggle'></div>
237238
<div id='memberfilter'>
@@ -241,25 +242,25 @@ trait EntityPage extends HtmlPage {
241242
</span>
242243
<i class="clear material-icons">&#xE14C;</i>
243244
</div>
244-
<div id='filterby'>
245-
<div id="order">
246-
<span class="filtertype">Ordering</span>
247-
<ol>
248-
{
249-
if (!universe.settings.docGroups.value || (tpl.members.map(_.group).distinct.length == 1))
250-
NodeSeq.Empty
251-
else
252-
<li class="group out"><span>Grouped</span></li>
253-
}
254-
<li class="alpha in"><span>Alphabetic</span></li>
255-
{
256-
if (tpl.linearizationTemplates.isEmpty && tpl.conversions.isEmpty)
257-
NodeSeq.Empty
258-
else
259-
<li class="inherit out"><span>By Inheritance</span></li>
260-
}
261-
</ol>
262-
</div>
245+
<div id='filterby'>
246+
<div id="order">
247+
<span class="filtertype">Ordering</span>
248+
<ol>
249+
{
250+
if (!universe.settings.docGroups.value || (tpl.members.map(_.group).distinct.length == 1))
251+
NodeSeq.Empty
252+
else
253+
<li class="group out"><span>Grouped</span></li>
254+
}
255+
<li class="alpha in"><span>Alphabetic</span></li>
256+
{
257+
if (tpl.linearizationTemplates.isEmpty && tpl.conversions.isEmpty)
258+
NodeSeq.Empty
259+
else
260+
<li class="inherit out"><span>By Inheritance</span></li>
261+
}
262+
</ol>
263+
</div>
263264
{ if (tpl.linearizationTemplates.isEmpty && tpl.conversions.isEmpty) NodeSeq.Empty else
264265
{
265266
if (!tpl.linearizationTemplates.isEmpty)
@@ -303,6 +304,7 @@ trait EntityPage extends HtmlPage {
303304
}
304305
</div>
305306
</div>
307+
}
306308

307309
<div id="template">
308310
<div id="allMembers">
@@ -333,7 +335,6 @@ trait EntityPage extends HtmlPage {
333335
<ol>
334336
{
335337
concValueMembers
336-
.filter(_.kind != "package")
337338
.map(memberToHtml(_, tpl))
338339
}
339340
</ol>

src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ div#content-container {
412412
div#content-container > div#content {
413413
-webkit-overflow-scrolling: touch;
414414
display: block;
415-
overflow-y: auto;
415+
overflow-y: hidden;
416416
max-width: 1140px;
417417
margin: 4em auto 0;
418418
}
@@ -488,7 +488,7 @@ div#packages > ul > li > a.abstract.type {
488488
div#packages > ul > li > a {
489489
text-decoration: none !important;
490490
margin-left: 1px;
491-
font-family: "Source Code Pro";
491+
font-family: "Source Code Pro", "Monaco", "Ubuntu Mono Regular", "Lucida Console", monospace;
492492
font-size: 0.9em;
493493
}
494494

@@ -678,7 +678,7 @@ div#results-content > div#member-results > ul.entities > li > ul.members > li >
678678
div#results-content > div#entity-results > ul.entities > li > ul.members > li > span.kind,
679679
div#results-content > div#entity-results > ul.entities > li > ul.members > li > span.tail {
680680
margin-right: 0.6em;
681-
font-family: "Source Code Pro";
681+
font-family: "Source Code Pro", "Monaco", "Ubuntu Mono Regular", "Lucida Console", monospace;
682682
}
683683

684684
div#results-content > div#member-results > ul.entities > li > ul.members > li > span.kind {
@@ -688,7 +688,7 @@ div#results-content > div#member-results > ul.entities > li > ul.members > li >
688688
div#results-content > div#member-results > ul.entities > li > ul.members > li > a.label,
689689
div#results-content > div#entity-results > ul.entities > li > ul.members > li > a.label {
690690
color: #2C3D9B;
691-
font-family: "Source Code Pro";
691+
font-family: "Source Code Pro", "Monaco", "Ubuntu Mono Regular", "Lucida Console", monospace;
692692
}
693693

694694
/** Scrollpane settings needed for jquery.scrollpane.min.js */

src/scaladoc/scala/tools/nsc/doc/html/resource/lib/template.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ body {
4040
text-align: center;
4141
color: #858484;
4242
bottom: 0;
43-
height: 20px;
43+
min-height: 20px;
4444
margin: 0 1em 0.5em;
4545
}
4646

@@ -367,15 +367,15 @@ div.members > ol > li:last-child {
367367
}
368368

369369
.signature {
370-
font-family: "Source Code Pro";
370+
font-family: "Source Code Pro", "Monaco", "Ubuntu Mono Regular", "Lucida Console", monospace;
371371
font-size: 0.8rem;
372372
line-height: 18px;
373373
clear: both;
374374
display: block;
375375
}
376376

377377
.modifier_kind {
378-
font-family: "Source Code Pro";
378+
font-family: "Source Code Pro", "Monaco", "Ubuntu Mono Regular", "Lucida Console", monospace;
379379
font-size: 0.8rem;
380380
padding-right: 0.5em;
381381
text-align: right;
@@ -385,7 +385,7 @@ div.members > ol > li:last-child {
385385
}
386386

387387
.symbol {
388-
font-family: "Source Code Pro";
388+
font-family: "Source Code Pro", "Monaco", "Ubuntu Mono Regular", "Lucida Console", monospace;
389389
}
390390

391391
a > .symbol > .name {
@@ -511,7 +511,7 @@ div#definition > h4#signature > span.modifier_kind > i.unfold-arrow,
511511

512512
#definition .morelinks {
513513
text-align: right;
514-
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
514+
font-family: "Source Code Pro", "Monaco", "Ubuntu Mono Regular", "Lucida Console", monospace;
515515
}
516516

517517
#definition .morelinks a {
@@ -593,7 +593,7 @@ div#definition > h4#signature > span.modifier_kind > i.unfold-arrow,
593593
background-color: #fff;
594594
margin: 5px 0;
595595
display: block;
596-
font-family: "Source Code Pro";
596+
font-family: "Source Code Pro", "Monaco", "Ubuntu Mono Regular", "Lucida Console", monospace;
597597
border-radius: 0.2em;
598598
overflow-x: auto;
599599
}

0 commit comments

Comments
 (0)