Skip to content

Scala 3 Documentation #1861

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 171 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
c6b25b5
Added empty initial files.
alvinj Sep 23, 2020
b39b7a4
This is an early draft to demonstrate my writing style.
alvinj Sep 25, 2020
4af19bb
This is an early draft to demonstrate my writing style.
alvinj Sep 25, 2020
61e26ed
Added more topics while reducing the descriptive text.
alvinj Sep 28, 2020
8a1d644
Worked on the first half of Jonathan's comments.
alvinj Sep 29, 2020
e4f2390
Update _overviews/overview/a-taste-of-scala.md
alvinj Sep 29, 2020
97e96f8
Update _overviews/overview/a-taste-of-scala.md
alvinj Sep 29, 2020
006dac9
Update _overviews/overview/a-taste-of-scala.md
alvinj Sep 29, 2020
e2b11c0
Update _overviews/overview/a-taste-of-scala.md
alvinj Sep 29, 2020
5cd4189
Update _overviews/overview/a-taste-of-scala.md
alvinj Sep 29, 2020
dd13390
Update _overviews/overview/a-taste-of-scala.md
alvinj Sep 29, 2020
1b6f549
Update _overviews/overview/a-taste-of-scala.md
alvinj Sep 29, 2020
842f785
Update _overviews/overview/a-taste-of-scala.md
alvinj Sep 29, 2020
b1c49b8
Merge pull request #1 from scalacenter/overview
alvinj Oct 4, 2020
13653e5
New versions of the Taste of Scala, Introduction, and Control Structu…
alvinj Oct 5, 2020
d288738
Added the initial version of the Scala Features document
alvinj Oct 7, 2020
8995017
Initial version of the ‘Interacting With Java’ document.
alvinj Oct 8, 2020
d53ad0e
Initial version of the ‘First Look at Types’ document.
alvinj Oct 8, 2020
8dc7054
Moved some of the Types content to the ‘First Look at Types’ document.
alvinj Oct 8, 2020
ab04eec
Initial version of the ‘Collections Classes and Methods’ document.
alvinj Oct 11, 2020
4e04959
Initial version of the ‘Scala for Java Developers’ document.
alvinj Oct 14, 2020
f0940ac
Initial versions of the ‘Methods’ and ‘Scala for Python Developers’ d…
alvinj Oct 21, 2020
eedcf95
Corrected miscellaneous spelling and syntax errors.
alvinj Oct 22, 2020
ae6cbbd
Adding four new Overview chapters.
alvinj Oct 29, 2020
26eb096
Initial versions of the ‘Main Methods’ and ‘Higher-Order Functions’ d…
alvinj Nov 1, 2020
9ac0fb7
Initial version of the ‘Packaging and Imports’ document.
alvinj Nov 1, 2020
8f3c91e
Renamed the ‘Packaging and Imports’ document.
alvinj Nov 1, 2020
a65106b
Didn’t make this shorter, but improved some areas.
alvinj Nov 2, 2020
f75875d
Initial version of the ‘Functional Programming’ document.
alvinj Nov 9, 2020
607dfd4
Add option to present page as Scala 3 docs
b-studios Nov 24, 2020
98baa72
Start to reorganize contents for inclusion of Scala 3 docs
b-studios Nov 24, 2020
ffc7482
Move language switch all the way to the top
b-studios Nov 25, 2020
07e8f60
Factor into smaller includes
b-studios Nov 25, 2020
b537746
Add new language page offering selection between scala2 and 3
b-studios Nov 25, 2020
76d33d1
Fix language marker in navigation
b-studios Nov 25, 2020
0a6e771
Port macro documentation
b-studios Nov 25, 2020
f95397d
Add stub pages for guides and getting started
b-studios Nov 25, 2020
cf3210b
Update links in navbar
b-studios Nov 25, 2020
0b5f8eb
Hide language specifier on small screens
b-studios Nov 25, 2020
05243e6
Add guides overview for Scala 3
b-studios Nov 25, 2020
e07c7aa
For now put Scala 2 first
b-studios Nov 25, 2020
c926bd8
Added the 'Modeling' chapters, updated the 'Scala for Java/Python' ch…
alvinj Nov 26, 2020
aac6dae
Change permalink structure
b-studios Nov 26, 2020
b2cc305
Add 'Preview' as suggested by Martin
b-studios Nov 26, 2020
b465ac9
Added the 'Contextual Abstractions' chapter as a series of sections.
alvinj Nov 27, 2020
83dba90
Forgot to remove this file.
alvinj Nov 27, 2020
5d968dd
Add scala3 as a default
b-studios Nov 27, 2020
e3dfabf
Add contribution to docs overview
b-studios Nov 27, 2020
ff0a16c
Adding the 'Types' chapter as a series of sections.
alvinj Nov 28, 2020
c81b267
Two new chapters, and two new Types sections.
alvinj Nov 30, 2020
7ca03ed
Don’t need numbers on the filenames any more.
alvinj Dec 2, 2020
d30cc94
Added num, previous-page and next-page to the Front Matter of all pages.
alvinj Dec 4, 2020
0f1e366
Added the Getting Started docs.
alvinj Dec 7, 2020
5485ae4
Make it clear that Scala 3 is not yet released
b-studios Dec 7, 2020
4f33dfb
Merge branch 'overview-docs' into scala3-unification
b-studios Dec 7, 2020
288c312
Move getting started guide
b-studios Dec 7, 2020
f5265f1
Revise getting started
b-studios Dec 7, 2020
7e6d788
Update compatible versions
b-studios Dec 7, 2020
be146ef
Use comment syntax
b-studios Dec 7, 2020
a1c6bf3
move book to scala3-book
b-studios Dec 7, 2020
86479e7
Delete different OS dependent instructions for now
b-studios Dec 7, 2020
0c46b26
Add a link to the reference
b-studios Dec 7, 2020
2120282
Change default to section to only mark chapters
b-studios Dec 8, 2020
a483b1d
Update links in first 4 sections
b-studios Dec 8, 2020
0308998
Updated the JavaScript content and the CSS.
alvinj Dec 8, 2020
d03fa63
Changed 'Overview' references to 'book'. Added a few links.
alvinj Dec 8, 2020
03ae684
Updated page hierarchy and some titles
alvinj Dec 8, 2020
61a2760
Starting to integrate comments
alvinj Dec 8, 2020
5a50882
Working through Jonathan’s comments and related issues
alvinj Dec 10, 2020
b88401f
Do not list h4 in TOC
b-studios Dec 10, 2020
b4e24f4
Make toc part of the section li and fix line-height
b-studios Dec 10, 2020
0636cbf
Disable sliding TOC in the Scala 3 part of the website
b-studios Dec 10, 2020
ce47f5f
Organized the Methods and Functions chapters
alvinj Dec 11, 2020
ca970d3
Quick review of the Methods and Functions chapters
alvinj Dec 11, 2020
d829a6f
Split the Collections chapter into sections
alvinj Dec 12, 2020
f53fe84
Separated the 'Taste of Scala' doc into sections
alvinj Dec 12, 2020
1c2155e
Domain Modeling is more accurate than Data Modeling
alvinj Dec 13, 2020
bdf6d0d
Broke the FP chapter into sections
alvinj Dec 13, 2020
0d7e5ae
A few updates in response to Jonathan’s initial comments
alvinj Dec 13, 2020
60a9b6c
More work on Jonathan’s initial comments
alvinj Dec 14, 2020
e608282
Rephrase intro
b-studios Dec 14, 2020
4e67a51
Add draft of new-in-scala3
b-studios Dec 14, 2020
b7a62d5
Streamline main page to put less focus on Scala 3
b-studios Dec 14, 2020
88111d8
Expand on meta programming
b-studios Dec 14, 2020
0027683
Updated the Scala Tools section, including the 'scala-3-version' setting
alvinj Dec 14, 2020
fb66cf1
Added Toplevel Definitions, made 'Taste of Scala' intro consistent wi…
alvinj Dec 14, 2020
8dc3235
Working through more of Jonathan’s initial comments
alvinj Dec 15, 2020
81c637a
Use globally configured scala 3 versions
b-studios Dec 15, 2020
32360db
Update scala3/index.md
b-studios Dec 15, 2020
43ea987
Update scala3/new-in-scala3.md
b-studios Dec 15, 2020
9ba323a
Remove getting started for now to ease review
b-studios Dec 15, 2020
8232993
Update scala3 macros to be on par with scala3-macro-tutorial
b-studios Dec 15, 2020
308ed17
Revise new-in-scala and add OO section
b-studios Dec 15, 2020
0639958
Add new in Scala 3 to the navigation bar
b-studios Dec 15, 2020
2b3d669
Fix icon headers on landing page
b-studios Dec 15, 2020
3c9ce36
Apply suggestions from code review
b-studios Dec 15, 2020
2e7befa
Apply suggestions from code review
b-studios Dec 15, 2020
6ebc157
Only whitespace fixes
b-studios Dec 15, 2020
c580703
Incorporate @sjrd's suggestions for the scala-for-js-devs section
b-studios Dec 15, 2020
a4a9ba6
Fix links in the contextual abstractions chapter
b-studios Dec 15, 2020
fbb2f50
Update given syntax as pointed out by @bishabosha
b-studios Dec 15, 2020
c810c68
Two more given syntax updates
b-studios Dec 15, 2020
7490ba9
Apply suggestions from code review by @vincenzobaz
b-studios Dec 15, 2020
928cf03
Apply suggestions from code review by @adpi2
b-studios Dec 15, 2020
03f2652
Apply suggestions from code review by @WojciechMazur
b-studios Dec 15, 2020
99255a6
Apply suggestions from code review by @tgodzik
b-studios Dec 15, 2020
53a7e7d
Apply suggestions from code review @bishabosha
b-studios Dec 15, 2020
cbe5d4d
Made the Getting Started page more concise
alvinj Dec 16, 2020
2528b49
Sketch Scala 3 hierarchy with Matchable
b-studios Dec 16, 2020
2dd22d3
Revise first-look-at-types
b-studios Dec 16, 2020
6e17bf0
Revise control-structures
b-studios Dec 16, 2020
f77c931
Revise modeling intro and tools
b-studios Dec 16, 2020
a0f7cdd
Add missing code fences
b-studios Dec 16, 2020
c2b7aec
Revise methods sections
b-studios Dec 16, 2020
bc00b1d
Streamline presentation of files a bit
b-studios Dec 16, 2020
ffbd2c1
Use import suggestions paragraph from @julienrf
b-studios Dec 16, 2020
b5cc84e
Revise oo design
b-studios Dec 16, 2020
3ab41f9
Mostly responded to comments by @tgodzik
alvinj Dec 17, 2020
2fecc4a
Resolved my own TODO items, or made them Jekyll comments
alvinj Dec 17, 2020
4b26c1f
Resolved most comments from @vincenzobaz and @b-studios
alvinj Dec 17, 2020
e95ed18
Replaced 'class' with 'type', per @vincenzobaz comments in other sect…
alvinj Dec 17, 2020
1fb1faa
Reviewed the OOP page
alvinj Dec 17, 2020
3a2e890
Revise FP modeling
b-studios Dec 17, 2020
a02c100
Revise type section up to Union types
b-studios Dec 17, 2020
3c831d6
Revise enum section
b-studios Dec 17, 2020
f46157f
Revise type class section
b-studios Dec 17, 2020
93f9c10
Fixing minor typos
b-studios Dec 17, 2020
76e8465
Revise variance section
b-studios Dec 17, 2020
c1caf6c
Drop those from the list since we do cover them (at least briefly)
b-studios Dec 17, 2020
74a45c8
Revise opaque types
b-studios Dec 17, 2020
7926c00
Add a quick example why we say 'leaky'
b-studios Dec 17, 2020
607410f
Updates for @vinz’s comments
alvinj Dec 17, 2020
ac0f935
Delete all HTML comments before going live
alvinj Dec 17, 2020
63533a2
Removed the Metaprogramming chapter and renumbered the files
alvinj Dec 17, 2020
b67dcaa
Responded to @vincenzobaz’s comments
alvinj Dec 18, 2020
42047b6
Responded to @sjrd’s comments
alvinj Dec 18, 2020
f0531f6
Seems like a good place to reference the Migration Guide
alvinj Dec 18, 2020
5a29693
Responding to more comments
alvinj Dec 18, 2020
3c56556
Reviewed the 'types' pages
alvinj Dec 18, 2020
ce4967b
Drop the links to Scala 2 and Scala 3 pages and integrate on landing …
b-studios Dec 18, 2020
87dde8a
Add a clearly visible disclaimer on every page
b-studios Dec 18, 2020
693cf3d
Slightly revise the getting started page
b-studios Dec 18, 2020
7a5a4f4
Remove text underline from docs link in the nav bar
b-studios Dec 18, 2020
5a01937
Fix multiple highlighted headlines in TOC
b-studios Dec 18, 2020
f0cdee4
Revise dependent function types
b-studios Dec 18, 2020
ac860f9
Revise contextual abstractions
b-studios Dec 18, 2020
75a3507
Minor fixes
b-studios Dec 18, 2020
042546e
Updates per @vincenzobaz’s comments
alvinj Dec 18, 2020
18edb35
Moved Type Classes to just after Givens
alvinj Dec 18, 2020
a077f63
Use current milestone
b-studios Dec 18, 2020
dceb41b
Update macros
b-studios Dec 18, 2020
8159550
All paragraphs are now separate lines to simplify PRs
alvinj Dec 18, 2020
f2c57cb
Added line breaks for easier comments and PRs
alvinj Dec 18, 2020
064782e
Use a consistent style on all blockquotes
alvinj Dec 18, 2020
371ae2c
Resolved ‘See the Reference docs’ lines that had nothing to link to
alvinj Dec 19, 2020
f378c0f
Fixed broken links
alvinj Dec 19, 2020
ec7077f
Reduced ‘Summary’ titles after recent ToC fix
alvinj Dec 19, 2020
a9a0ac3
Removed side-by-side tables
alvinj Dec 19, 2020
8cced66
First attempt at improving code block readability
alvinj Dec 19, 2020
ad3082e
Got the desired look using only CSS
alvinj Dec 20, 2020
f111c93
Updated the JavaScript page, put the CSS in one file
alvinj Dec 20, 2020
f6a545b
Updated the Python page, and the CSS
alvinj Dec 21, 2020
6b470ff
Working to resolve the Pure Function definition
alvinj Dec 21, 2020
d9cff8d
Fix link in navigation
b-studios Dec 21, 2020
be74175
Fix some links in macros tutorial
b-studios Dec 21, 2020
854b37d
Fix some more links
b-studios Dec 21, 2020
707ed21
Comment it out, if it is outdated
b-studios Dec 21, 2020
4c52788
Fix a few more broken links
b-studios Dec 21, 2020
5769941
Fix remaining broken links
b-studios Dec 21, 2020
1c02731
Change link of migration status
b-studios Dec 21, 2020
b3d04af
Also update migration status on contribute to docs page
b-studios Dec 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ keywords:

scala-version: 2.13.3
scala-212-version: 2.12.12
scala-3-version: 3.0.0-M3
scala-3-plugin-version: 0.5.1

collections:
style:
Expand Down Expand Up @@ -90,10 +92,37 @@ defaults:
type: "tour"
values:
overview-name: "Tour of Scala"
-
scope:
path: "_overviews/scala3-book"
values:
scala3: true
# num: 99 # to list them in the TOC, should be overwritten individually
partof: scala3-book
type: section
overview-name: "Scala 3 — Book"
layout: multipage-overview
permalink: "/scala3/book/:title.html"
-
scope:
path: "_overviews/scala3-macros"
values:
scala3: true
partof: scala3-macros
overview-name: "Macros in Scala 3"
layout: multipage-overview
permalink: "/scala3/guides/macros/:title.html"
-
scope:
path: "scala3"
values:
scala3: true


highlighter: rouge
permalink: /:categories/:title.html:output_ext
baseurl:
scala3ref: "https://dotty.epfl.ch/docs/reference"
exclude: ["vendor"]
plugins:
- jekyll-redirect-from
Expand Down
17 changes: 17 additions & 0 deletions _data/scala3-doc-nav-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- title: Learn
url: "#"
submenu:
- title: New in Scala 3
url: "/scala3/new-in-scala3.html"
- title: Getting Started
url: "/scala3/getting-started.html"
- title: Scala 3 Book
url: "/scala3/book/introduction.html"
- title: Macro Tutorial
url: "/scala3/guides/macros/index.html"
- title: Migrate
url: "https://scalacenter.github.io/scala-3-migration-guide"
- title: Reference
url: "https://dotty.epfl.ch/docs/reference/overview.html"
- title: API
url: "https://dotty.epfl.ch/api/index.html"
28 changes: 28 additions & 0 deletions _includes/documentation-sections.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="documentation">
{% for section in include.sections %}
<div class="section">
<h2 class="frontpage">{{ section.title }}</h2>
{% for link in section.links %}
<a href="{% if link.link contains '://' %}{{link.link}}{% else %}{{site.baseurl}}{{link.link}}{% endif %}" class="doc-item">
<div class="doc-item-header">
<i class="{{link.icon}}"></i>
<h5>{{link.title}}</h5>
</div>
<div class="doc-item-main">
<p>{{link.description}}</p>
</div>
</a>
{% endfor %}
</div>
<div class="more-resources">&nbsp;
{% if section.more-resources %}
<span class="heading">{{ page.more-resources-label }}: </span>
<ul>
{% for resource in section.more-resources %}
<li><a href="{{ site.baseurl }}{{ resource.url }}">{{ resource.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
</div>
4 changes: 4 additions & 0 deletions _includes/headertop.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<!DOCTYPE html>
{% if page.scala3 %}
<html class="scala3">
{% else %}
<html>
{% endif %}
<head>
<title>
{% if page.title %}{{ page.title }} | {% endif %}
Expand Down
29 changes: 1 addition & 28 deletions _includes/masthead-documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,7 @@
{% endif %}
</ul>

<div class="documentation">
{% for section in page.sections %}
<div class="section">
<h2 class="frontpage">{{ section.title }}</h2>
{% for link in section.links %}
<a href="{% if link.link contains '://' %}{{link.link}}{% else %}{{site.baseurl}}{{link.link}}{% endif %}" class="doc-item">
<div class="doc-item-header">
<i class="{{link.icon}}"></i>
<h5>{{link.title}}</h5>
</div>
<div class="doc-item-main">
<p>{{link.description}}</p>
</div>
</a>
{% endfor %}
</div>
<div class="more-resources">&nbsp;
{% if section.more-resources %}
<span class="heading">{{ page.more-resources-label }}: </span>
<ul>
{% for resource in section.more-resources %}
<li><a href="{{ site.baseurl }}{{ resource.url }}">{{ resource.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
</div>
{% include documentation-sections.html sections=page.sections %}
</div>
</div>
</section>
46 changes: 22 additions & 24 deletions _includes/navbar-inner.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
<header id="site-header">
<div class="wrap">
<nav class="navigation" role="menu">
<a href="http://scala-lang.org" class="navigation-bdand">
<img src="{{ site.baseurl }}/resources/img/frontpage/[email protected]" alt="">
</a>
<div class="navigation-panel-button">
<i class="fa fa-bars"></i>
</div>
<ul class="navigation-menu">
{% for navItem in site.data.nav-header %}
<li class="navigation-menu-item">
<a href="{% if navItem.url contains '://' %}{{navItem.url}}{% else %}{{site.baseurl}}{{navItem.url}}{% endif %}" {% if page.url contains navItem.url %}class="active"{% endif %}>{{navItem.title}}</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
</header>
{% if page.scala3 %}
{% assign navdata = site.data.scala3-doc-nav-header %}
{% else %}
{% assign navdata = site.data.doc-nav-header %}
{% endif %}

{% include site-header.html %}

{% if page.scala3 %}
<header id="doc-header" class="scala3">
{% else %}
<header id="doc-header">
{% endif %}
<div class="wrap" style="padding: 0px;">
<nav class="doc-navigation" role="menu">
{% assign docsRootTranslated = site[page.language] | where: 'partof', 'documentation' | first %}
<a href="{{ site.baseurl }}/{{ docsRootTranslated.language }}" class="navigation-bdand" >
<img src="{{ site.baseurl }}/resources/img/[email protected]" alt="">
<div class="navigation-bdand">
<a href="{{ site.baseurl }}/{{ docsRootTranslated.language }}">
<img src="{{ site.baseurl }}/resources/img/[email protected]" alt="docs">
</a>
<span class="doc-language-version">
— Scala {% if page.scala3 %} 3 {% else %} 2 {% endif %}
</span>
</div>
<div class="navigation-ellipsis">
<i class="fa fa-ellipsis-v"></i>
</div>
<ul class="navigation-menu">
{% for navItem in site.data.doc-nav-header %}
{% for navItem in navdata %}
<li class="navigation-menu-item">
{% capture translatedPageId %}/{{page.language}}{{navItem.url | remove_first: '.html' }}{% endcapture %}
{% assign navItemTranslated = site.documents | where: 'id', translatedPageId | first %}
Expand All @@ -49,7 +47,7 @@
</ul>
</nav>
<nav class="doc-navigation-submenus">
{% for navItem in site.data.doc-nav-header %}
{% for navItem in navdata %}
{% if navItem.submenu %}
<ul class="navigation-submenu" id="{{ navItem.title | downcase | strip }}" style="display: none;">
{% for subItem in navItem.submenu %}
Expand All @@ -61,7 +59,7 @@
{% endif %}
{% endfor %}
<ul class="navigation-submenu ellipsis-menu" style="display: none;">
{% for navItem in site.data.doc-nav-header %}
{% for navItem in navdata %}
{% if forloop.index > 3 %}
<li><a href="{% if navItem.url contains '://' %}{{navItem.url}}{% else %}{{site.baseurl}}{{navItem.url}}{% endif %}">{{ navItem.title }}</a></li>
{% endif %}
Expand Down
15 changes: 10 additions & 5 deletions _includes/sidebar-toc-multipage-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,30 @@ <h5 class="contents">Contents</h5>
<ul>
{% assign sorted = site.overviews | sort: 'num' %}
{% for pg in sorted %}
{% if pg.num == page.num %}
{% capture toc %}
<div id="toc"></div>
{% endcapture %}
{% endif %}

{% if pg.num and (page.partof == pg.partof) %}
{% if page.language %} <!-- if page is a translation, get the translated title -->
{% assign prefix = page.language | prepend: '/' %}
{% assign localizedId = pg.id | prepend: prefix %}
{% for lpg in site.[page.language] %}
{% if lpg.id == localizedId %}
<li><a {% if page.title == lpg.title %}class="active"{% endif %} href="/{{ site.baseurl }}{{ page.language }}{{ pg.url }}">{{ lpg.title }}</a></li>
<li><a {% if page.title == lpg.title %}class="active"{% endif %} href="/{{ site.baseurl }}{{ page.language }}{{ pg.url }}">{{ lpg.title }}</a>
{{ toc }}</li>
{% endif %}
{% endfor %}
{% else %} <!-- this must be English, so get the other documents' titles -->

{% 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 -->
<li class="type-{{ pg.type }}"><a {% if page.title == pg.title %}class="active"{% endif %} href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a></li>
<li class="type-{{ pg.type }}"><a {% if page.num == pg.num %}class="active"{% endif %} href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a>{{toc}}</li>
{% else %}
<li><a {% if page.title == pg.title %}class="active"{% endif %} href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a></li>
<li><a {% if page.num == pg.num %}class="active"{% endif %} href="{{ site.baseurl }}{{ pg.url }}">{{ pg.title }}</a>{{toc}}</li>
{% endif %}

{% endif %}
{% if pg.num == page.num %}<div id="toc"></div>{% endif %}
{% endif %}
{% endfor %}
</ul>
Expand Down
19 changes: 19 additions & 0 deletions _includes/site-header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<header id="site-header">
<div class="wrap">
<nav class="navigation" role="menu">
<a href="http://scala-lang.org" class="navigation-bdand">
<img src="{{ site.baseurl }}/resources/img/frontpage/[email protected]" alt="">
</a>
<div class="navigation-panel-button">
<i class="fa fa-bars"></i>
</div>
<ul class="navigation-menu">
{% for navItem in site.data.nav-header %}
<li class="navigation-menu-item">
<a href="{% if navItem.url contains '://' %}{{navItem.url}}{% else %}{{site.baseurl}}{{navItem.url}}{% endif %}" {% if page.url contains navItem.url %}class="active"{% endif %}>{{navItem.title}}</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
</header>
56 changes: 56 additions & 0 deletions _layouts/documentation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
---
{% include headertop.html %} {% include headerbottom.html %}
{% if page.new-version %}<a class="new-version-notice" href="{{ page.new-version }}">This page has a new version.</a>{% endif %}

<div class="navigation-fade-screen"></div>

{% include site-header.html %}

<main id="inner-main" class="landing-page">

<section class="title-page">
<div class="wrap">
<div class="content-title-documentation">

<h1>{{page.title}}</h1>
<div class="search-container">
<div class="icon-search">
<i class="fa fa-search"></i>
</div>
<input type="text" class="doc-search" id="doc-search-bar" placeholder="Search in doc...">
<ul class="result-container" id="result-container" style="display: none;"></ul>
</div>
</div>
</div>
</section>

<section class="table-of-content content-primary">
<div class="wrap scala2">
<div class="language-header">
<h1>Scala 2</h1>
</div>
<div class="inner-box">
{% include documentation-sections.html sections=page.scala2-sections %}
</div>
</div>

<div class="wrap scala3">
<div class="language-header">
<h1>Scala 3 (Preview)</h1>
</div>
<div class="inner-box">
<blockquote>
Scala 3 has not been released, yet. We are still in the process of writing the documentation for Scala 3.<br/>
You can <a href="/scala3/contribute-to-docs.html">help us to improve the documentation</a>.
</blockquote>
{% include documentation-sections.html sections=page.scala3-sections %}
</div>
</div>
</section>

{{content}}

</main>

{% include footer.html %}
15 changes: 14 additions & 1 deletion _layouts/inner-page-parent-dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@
{% include headerbottom.html %}
{% if page.new-version %}<a class="new-version-notice" href="{{ page.new-version }}">This page has a new version.</a>{% endif %}



<div class="navigation-fade-screen"></div>

{% include navbar-inner.html %}

<main id="inner-main">

<!-- Title -->
<section class="title-page">
<div class="wrap">
<div class="content-title-documentation">
{% if page.scala3 %}
<div class="wip-notice">
<h4>Work in Progress</h4>
<p>
Scala 3 has not been released, yet.
We are still in the process of writing the documentation for Scala 3.
You can <a href="/scala3/contribute-to-docs.html">help us</a> to improve the documentation.
</p>
<p>Are you searching for the <a href="/">Scala 2 documentation</a>?</p>
</div>
{% endif %}

<div class="titles">
{% if page.overview-name %}
<div class="supertitle">{{ page.overview-name }}</div>
Expand Down
Loading