10000 Merge pull request #1667 from mlachkar/scala-book-sidebar · aksingh30/docs.scala-lang@2bad10a · GitHub
[go: up one dir, main page]

Skip to content

Commit 2bad10a

Browse files
authored
Merge pull request scala#1667 from mlachkar/scala-book-sidebar
Improve Scala book sidebar to reflect the book structure
2 parents 0ae2685 + 5dd029e commit 2bad10a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+76
-8
lines changed

_includes/sidebar-toc-multipage-overview.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="content-nav">
22
<div class="inner-box sidebar-toc-wrapper" style="">
33
<h5 class="contents">Contents</h5>
4-
<div class="inner-toc" id="sidebar-toc">
4+
<div class="inner-toc" id="sidebar-toc">
55

66
<ul>
77
{% assign sorted = site.overviews | sort: 'num' %}
@@ -16,7 +16,13 @@ <h5 class="contents">Contents</h5>
1616
{% endif %}
1717
{% endfor %}
1818
{% else %} <!-- this must be English, so get the other documents' titles -->
19-
<li><a {% if page.title == pg.title %}class="active"{% endif %} href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a></li>
19+
20+
{% if pg.type %} <!-- if a type is set in a document, we add it as a class. Used in Scala book to diff between chapter and section -->
21+
<li class="type-{{ pg.type }}"><a {% if page.title == pg.title %}class="active"{% endif %} href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a></li>
22+
{% else %}
23+
<li><a {% if page.title == pg.title %}class="active"{% endif %} href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a></li>
24+
{% endif %}
25+
2026
{% endif %}
2127
{% if pg.num == page.num %}<div id="toc"></div>{% endif %}
2228
{% endif %}

_overviews/scala-book/abstract-classes.md

Lines changed: 1 addition & 0 deletions

_overviews/scala-book/anonymous-functions.md

Lines changed: 1 addition & 0 deletions

_overviews/scala-book/arraybuffer-examples.md

Lines changed: 1 addition & 0 deletions

_overviews/scala-book/built-in-types.md

Lines changed: 1 addition & 0 deletions

_overviews/scala-book/case-classes.md

Lines changed: 1 addition & 0 deletions

_overviews/scala-book/case-objects.md

Lines changed: 1 addition & 0 deletions

_overviews/scala-book/classes-aux-constructors.md

Lines changed: 1 addition & 0 deletions

_overviews/scala-book/classes.md

Lines changed: 1 addition & 0 deletions

_overviews/scala-book/collections-101.md

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)
0