Skip to content

Commit 5dd029e

Browse files
committed
Reuse sidebar of overviews and reactivate toc for adding sub-heading to content table
toc css will impact multiple pages, not only scala book
1 parent ae052b5 commit 5dd029e

Some content is hidden

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

58 files changed

+67
-146
lines changed

_includes/sidebar-toc-multipage-book.html

Lines changed: 0 additions & 51 deletions
This file was deleted.

_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 %}

_layouts/multipage-book.html

Lines changed: 0 additions & 33 deletions
This file was deleted.

_overviews/scala-book/abstract-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
type: section
3-
layout: multipage-book
3+
layout: multipage-overview
44
title: Abstract Classes
55
description: This page shows how to use abstract classes, including when and why you should use abstract classes.
66
partof: scala_book

_overviews/scala-book/anonymous-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
type: section
3-
layout: multipage-book
3+
layout: multipage-overview
44
title: Anonymous Functions
55
description: This page shows how to use anonymous functions in Scala, including examples with the List class 'map' and 'filter' functions.
66
partof: scala_book

_overviews/scala-book/arraybuffer-examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
type: section
3-
layout: multipage-book
3+
layout: multipage-overview
44
title: The ArrayBuffer Class
55
description: This page provides examples of how to use the Scala ArrayBuffer class, including adding and removing elements.
66
partof: scala_book

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
type: section
3-
layout: multipage-book
3+
layout: multipage-overview
44
title: A Few Built-In Types
55
description: A brief introduction to Scala's built-in types.
66
partof: scala_book

_overviews/scala-book/case-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
type: section
3-
layout: multipage-book
3+
layout: multipage-overview
44
title: Case Classes
55
description: This lesson provides an introduction to 'case classes' in Scala.
66
partof: scala_book

_overviews/scala-book/case-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
type: section
3-
layout: multipage-book
3+
layout: multipage-overview
44
title: Case Objects
55
description: This lesson introduces Scala 'case objects', which are used to create singletons with a few additional features.
66
partof: scala_book

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
type: section
3-
layout: multipage-book
3+
layout: multipage-overview
44
title: Auxiliary Class Constructors
55
description: This page shows how to write auxiliary Scala class constructors, including several examples of the syntax.
66
partof: scala_book

0 commit comments

Comments
 (0)