Skip to content

Commit 323df5e

Browse files
authored
Merge pull request #2430 from bishabosha/merge-scala2-scala3
Merge scala 2 and scala 3 themes and guides
2 parents e4132d2 + 19811f9 commit 323df5e

File tree

88 files changed

+392
-688
lines changed

Some content is hidden

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

88 files changed

+392
-688
lines changed

_config.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,42 @@ defaults:
9696
type: "tour"
9797
values:
9898
overview-name: "Tour of Scala"
99+
-
100+
scope:
101+
path: "_overviews/macros"
102+
values:
103+
scala2: true
104+
versionSpecific: true
105+
-
106+
scope:
107+
path: "_overviews/reflection"
108+
values:
109+
scala2: true
110+
versionSpecific: true
111+
-
112+
scope:
113+
path: "_overviews/quasiquotes"
114+
values:
115+
scala2: true
116+
versionSpecific: true
117+
-
118+
scope:
119+
path: "_overviews/repl"
120+
values:
121+
scala2: true
122+
versionSpecific: true
123+
-
124+
scope:
125+
path: "_overviews/plugins"
126+
values:
127+
scala2: true
128+
versionSpecific: true
129+
-
130+
scope:
131+
path: "_overviews/compiler-options"
132+
values:
133+
scala2: true
134+
versionSpecific: true
99135
-
100136
scope:
101137
path: "_overviews/scala3-book"
@@ -141,6 +177,7 @@ defaults:
141177
path: "_overviews/scala3-macros"
142178
values:
143179
scala3: true
180+
versionSpecific: true
144181
partof: scala3-macros
145182
overview-name: "Macros in Scala 3"
146183
layout: multipage-overview
@@ -150,6 +187,7 @@ defaults:
150187
path: "_overviews/scala3-scaladoc"
151188
values:
152189
scala3: true
190+
versionSpecific: true
153191
partof: scala3-scaladoc
154192
overview-name: "Scaladoc"
155193
layout: multipage-overview

_data/doc-nav-header.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
- title: Getting Started
22
url: "/getting-started/index.html"
3+
- title: Scala 3
4+
url: "#"
5+
submenu:
6+
- title: What's New?
7+
url: "/scala3/new-in-scala3.html"
8+
- title: Migrating From Scala 2
9+
url: "/scala3/guides/migration/compatibility-intro.html"
10+
- title: New Features for Scaladoc
11+
url: "/scala3/scaladoc.html"
12+
- title: Videos and Talks
13+
url: "/scala3/talks.html"
314
- title: Learn
415
url: "#"
516
submenu:
617
- title: Tour of Scala
718
url: "/tour/tour-of-scala.html"
8-
- title: Scala Book
19+
- title: Scala 3 Book
20+
url: "/scala3/book/introduction.html"
21+
- title: Scala 2 Book
922
url: "/overviews/scala-book/introduction.html"
1023
- title: Online Courses
1124
url: "/online-courses.html"
@@ -33,22 +46,21 @@
3346
url: "/books.html"
3447
- title: Scala FAQ
3548
url: "/tutorials/FAQ/index.html"
36-
- title: Language Specification
49+
- title: Scala Language Specification
3750
url: http://scala-lang.org/files/archive/spec/2.13/
38-
- title: Contribution Guide
51+
- title: Scala 3 Language Reference
52+
url: "https://docs.scala-lang.org/scala3/reference"
53+
- title: Scala Contribution Guide
3954
url: "/contribute/"
55+
- title: Scala 3 Compiler Contributing Guide
56+
url: "/scala3/guides/contribution/contribution-intro.html"
4057
- title: Style Guide
4158
url: "/style/index.html"
4259
- title: Cheatsheet
4360
url: "/cheatsheets/index.html"
4461
- title: Glossary
4562
url: "/glossary/index.html"
4663
- title: API
47-
url: "#"
48-
submenu:
49-
- title: Current
50-
url: https://www.scala-lang.org/api/current/
51-
- title: All Versions
52-
url: "/api/all.html"
64+
url: "/api/all.html"
5365
- title: SIPs
5466
url: "/sips/index.html"

_data/overviews.yml

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
- category: Standard Library
32
description: "Guides and overviews covering the Scala standard library."
43
overviews:
@@ -60,6 +59,31 @@
6059
- category: Language
6160
description: "Guides and overviews covering features in the Scala language."
6261
overviews:
62+
- title: "Migration from Scala 2 to Scala 3"
63+
by: Adrien Piquerez
64+
icon: suitcase
65+
root: "scala3/guides/"
66+
url: "migration/compatibility-intro.html"
67+
description: "Everything you need to know about compatibility and migration to Scala 3."
68+
- title: Scala 3 Macros
69+
by: Nicolas Stucki
70+
icon: magic
71+
root: "scala3/guides/"
72+
url: "macros"
73+
description: "A detailed tutorial to cover all the features involved in writing macros in Scala 3."
74+
label-text: new in Scala 3
75+
- title: Value Classes and Universal Traits
76+
by: Mark Harrah
77+
description: "Value classes are a new mechanism in Scala to avoid allocating runtime objects. This is accomplished through the definition of new AnyVal subclasses."
78+
icon: gem
79+
url: "core/value-classes.html"
80+
- title: An Overview of TASTy
81+
by: Alvin Alexander
82+
icon: birthday-cake
83+
label-text: new in Scala 3
84+
root: "scala3/guides/"
85+
url: "tasty-overview.html"
86+
description: "An overview over the TASTy format aimed at end-users of the Scala language."
6387
- title: String Interpolation
6488
icon: dollar-sign
6589
url: "core/string-interpolation.html"
@@ -72,11 +96,15 @@
7296
by: Josh Suereth
7397
description: "Scala 2.10 introduced a new feature called implicit classes. An implicit class is a class marked with the implicit keyword. This keyword makes the class’ primary constructor available for implicit conversions when the class is in scope."
7498
url: "core/implicit-classes.html"
75-
- title: Value Classes and Universal Traits
76-
by: Mark Harrah
77-
description: "Value classes are a new mechanism in Scala to avoid allocating runtime objects. This is accomplished through the definition of new AnyVal subclasses."
78-
icon: gem
79-
url: "core/value-classes.html"
99+
- title: The Scala Book
100+
by: Alvin Alexander
101+
icon: book
102+
label-color: "#899295"
103+
label-text: archived
104+
url: "scala-book/introduction.html"
105+
description: >
106+
A light introduction to the Scala language, focused on Scala 2.
107+
<a href="/scala3/book/introduction.html">Now updated for Scala 3</a>, we are in the process of merging the two.
80108
81109
- category: Authoring Libraries
82110
description: "Guides for contributing open source libraries to the Scala ecosystem."
@@ -137,13 +165,20 @@
137165
- category: "Tools"
138166
description: "Reference material on core Scala tools like the Scala REPL and Scaladoc generation."
139167
overviews:
140-
- title: Scala REPL
168+
- title: Scala 2 REPL
141169
icon: terminal
142170
url: "repl/overview.html"
143171
description: |
144172
The Scala REPL is a tool (<code>scala</code>) for evaluating expressions in Scala.
145173
<br><br>
146174
The <code>scala</code> command will execute a source script by wrapping it in a template and then compiling and executing the resulting program
175+
- title: Scaladoc For Scala 3
176+
by: Krzysztof Romanowski, Aleksander Boruch-Gruszecki, Andrzej Ratajczak, Kacper Korban, Filip Zybała
177+
icon: book
178+
root: "scala3/guides/"
179+
url: "scaladoc"
180+
description: "Updates in Scala 3 to Scala’s API documentation generation tool."
181+
label-text: updated
147182
- title: Scaladoc
148183
url: "scaladoc/overview.html"
149184
icon: book
@@ -159,12 +194,18 @@
159194
- category: Compiler
160195
description: "Guides and overviews covering the Scala compiler: compiler plugins, reflection, and metaprogramming tools such as macros."
161196
overviews:
162-
- title: Reflection
197+
- title: "Scala 3 Contributing Guide"
198+
by: Jamie Thompson, Anatolii Kmetiuk
199+
icon: cogs
200+
root: "scala3/guides/"
201+
url: "contribution/contribution-intro.html"
202+
description: "Guide to the Scala 3 Compiler and fixing an issue"
203+
- title: Scala 2 Reflection
163204
by: Heather Miller, Eugene Burmako, and Philipp Haller
164205
icon: binoculars
165206
url: "reflection/overview.html"
166207
description: Scala's runtime/compile-time reflection framework.
167-
label-text: experimental
208+
label-text: removed in Scala 3
168209
subdocs:
169210
- title: Overview
170211
url: "reflection/overview.html"
@@ -180,12 +221,12 @@
180221
url: "reflection/thread-safety.html"
181222
- title: Changes in Scala 2.11
182223
url: "reflection/changelog211.html"
183-
- title: Macros
224+
- title: Scala 2 Macros
184225
by: Eugene Burmako
185226
icon: magic
186227
url: "macros/usecases.html"
187228
description: "Scala's metaprogramming framework."
188-
label-text: experimental
229+
label-text: removed in Scala 3
189230
subdocs:
190231
- title: Use Cases
191232
url: "macros/usecases.html"
@@ -211,12 +252,12 @@
211252
url: "macros/roadmap.html"
212253
- title: Changes in 2.11
213254
url: "macros/changelog211.html"
214-
- title: Quasiquotes
255+
- title: Quasiquotes in Scala 2
215256
by: Denys Shabalin
216257
icon: quote-left
217258
url: "quasiquotes/setup.html"
218259
description: "Quasiquotes are a convenient way to manipulate Scala syntax trees."
219-
label-text: experimental
260+
label-text: removed in Scala 3
220261
subdocs:
221262
- title: Dependencies and setup
222263
url: "quasiquotes/setup.html"
@@ -244,12 +285,12 @@
244285
url: "quasiquotes/terminology.html"
245286
- title: Future prospects
246287
url: "quasiquotes/future.html"
247-
- title: Compiler Plugins
288+
- title: Scala 2 Compiler Plugins
248289
by: Lex Spoon and Seth Tisue
249290
icon: puzzle-piece
250291
url: "plugins/index.html"
251292
description: "Compiler plugins permit customizing and extending the Scala compiler. This tutorial describes the plugin facility and walks you through how to create a simple plugin."
252-
- title: Compiler Options
293+
- title: Scala 2 Compiler Options
253294
by: Community
254295
icon: cog
255296
url: "compiler-options/index.html"
@@ -265,7 +306,6 @@
265306
url: "compiler-options/optimizer.html"
266307
description: "The compiler can perform various optimizations."
267308

268-
269309
- category: Legacy
270310
description: "Guides covering features no longer relevant to recent Scala versions (2.12+)."
271311
overviews:

_data/scala3-doc-nav-header.yml

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

_getting-started/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ partof: getting-started
55
languages: [fr, ja, uk]
66
includeTOC: true
77

8-
redirect_from: "/getting-started.html"
8+
redirect_from:
9+
- /getting-started.html
10+
- /scala3/getting-started.html # we deleted the scala 3 version of this page
911
---
1012

1113
{% include getting-started.md %}

_includes/documentation-sections.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,5 @@ <h5>{{link.title}}</h5>
1414
</a>
1515
{% endfor %}
1616
</div>
17-
<div class="more-resources">&nbsp;
18-
{% if section.more-resources %}
19-
<span class="heading">{{ page.more-resources-label }}: </span>
20-
<ul>
21-
{% for resource in section.more-resources %}
22-
<li><a href="{{ site.baseurl }}{{ resource.url }}">{{ resource.title }}</a></li>
23-
{% endfor %}
24-
</ul>
25-
{% endif %}
26-
</div>
2717
{% endfor %}
2818
</div>

_includes/headertop.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
<!DOCTYPE html>
2-
{% if page.scala3 %}
3-
<html class="scala3">
2+
{% if page.scala3 or page.new-version %}
3+
{% assign classes='' %}
4+
{% if page.scala3 %}
5+
{% assign classes= classes | append: ' scala3' %}
6+
{% endif %}
7+
{% if page.new-version %}
8+
{% assign classes= classes | append: ' outdated-page' %}
9+
{% endif %}
10+
<html class="{{classes}}">
411
{% else %}
5-
<html>
12+
<html>
613
{% endif %}
714
<head>
815
<title>

_includes/navbar-inner.html

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
{% if page.scala3 %}
2-
{% assign navdata = site.data.scala3-doc-nav-header %}
3-
{% else %}
4-
{% assign navdata = site.data.doc-nav-header %}
5-
{% endif %}
1+
{% assign navdata = site.data.doc-nav-header %}
62

73
{% include site-header.html %}
84

@@ -18,9 +14,6 @@
1814
<a href="{{ site.baseurl }}/{{ docsRootTranslated.language }}">
1915
<img src="{{ site.baseurl }}/resources/img/[email protected]" alt="docs">
2016
</a>
21-
<span class="doc-language-version">
22-
— Scala {% if page.scala3 %} 3 {% else %} 2 {% endif %}
23-
</span>
2417
</div>
2518
<div class="navigation-ellipsis">
2619
<i class="fa fa-ellipsis-v"></i>

_includes/sidebar-toc-multipage-overview.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
{% assign pagetype = page.type %}
12
<div class="content-nav">
2-
<div class="inner-box sidebar-toc-wrapper" style="">
3+
<div class="inner-box sidebar-toc-wrapper {% if pagetype %}book{% endif %}" style="">
34
<h5 class="contents">Contents</h5>
4-
{% assign type = page.type %}
5-
{% if type %}
6-
<div class="inner-toc book" id="sidebar-toc">
7-
{% else %}
8-
<div class="inner-toc" id="sidebar-toc">
9-
{% endif %}
10-
5+
{% if pagetype %}
6+
<div class="inner-toc book" id="sidebar-toc">
7+
{% else %}
8+
<div class="inner-toc" id="sidebar-toc">
9+
{% endif %}
1110
<ul>
1211
{% assign sorted = site[page.collection] | sort: 'num' %}
1312
{% for pg in sorted %}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% if include.language %}
2+
<blockquote class="help-info">
3+
<i class="fa fa-info"></i><span style="margin-left: 0.5rem">
4+
{% if include.language == 'scala3' %}
5+
This doc page is specific to Scala 3,
6+
and may cover new concepts not available in Scala 2.
7+
{% else if include.language == 'scala2' %}
8+
This doc page is specific to features shipped in Scala 2,
9+
which have either been removed in Scala 3 or replaced by an alternative.
10+
{% endif %}
11+
</span>
12+
</blockquote>
13+
{% endif %}

0 commit comments

Comments
 (0)