Skip to content
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

Merge scala 2 and scala 3 themes and guides #2430

Merged
merged 23 commits into from Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions _config.yml
Expand Up @@ -96,6 +96,42 @@ defaults:
type: "tour"
values:
overview-name: "Tour of Scala"
-
scope:
path: "_overviews/macros"
values:
scala2: true
versionSpecific: true
-
scope:
path: "_overviews/reflection"
values:
scala2: true
versionSpecific: true
-
scope:
path: "_overviews/quasiquotes"
values:
scala2: true
versionSpecific: true
-
scope:
path: "_overviews/repl"
values:
scala2: true
versionSpecific: true
-
scope:
path: "_overviews/plugins"
values:
scala2: true
versionSpecific: true
-
scope:
path: "_overviews/compiler-options"
values:
scala2: true
versionSpecific: true
-
scope:
path: "_overviews/scala3-book"
Expand Down Expand Up @@ -141,6 +177,7 @@ defaults:
path: "_overviews/scala3-macros"
values:
scala3: true
versionSpecific: true
partof: scala3-macros
overview-name: "Macros in Scala 3"
layout: multipage-overview
Expand All @@ -150,6 +187,7 @@ defaults:
path: "_overviews/scala3-scaladoc"
values:
scala3: true
versionSpecific: true
partof: scala3-scaladoc
overview-name: "Scaladoc"
layout: multipage-overview
Expand Down
30 changes: 21 additions & 9 deletions _data/doc-nav-header.yml
@@ -1,11 +1,24 @@
- title: Getting Started
url: "/getting-started/index.html"
- title: Scala 3
url: "#"
submenu:
- title: What's New?
url: "/scala3/new-in-scala3.html"
- title: Migrating From Scala 2
url: "/scala3/guides/migration/compatibility-intro.html"
- title: New Features for Scaladoc
url: "/scala3/scaladoc.html"
- title: Videos and Talks
url: "/scala3/talks.html"
- title: Learn
url: "#"
submenu:
- title: Tour of Scala
url: "/tour/tour-of-scala.html"
- title: Scala Book
- title: Scala 3 Book
url: "/scala3/book/introduction.html"
- title: Scala 2 Book
url: "/overviews/scala-book/introduction.html"
- title: Online Courses
url: "/online-courses.html"
Expand Down Expand Up @@ -33,22 +46,21 @@
url: "/books.html"
- title: Scala FAQ
url: "/tutorials/FAQ/index.html"
- title: Language Specification
- title: Scala Language Specification
url: http://scala-lang.org/files/archive/spec/2.13/
- title: Contribution Guide
- title: Scala 3 Language Reference
url: "https://docs.scala-lang.org/scala3/reference"
- title: Scala Contribution Guide
url: "/contribute/"
- title: Scala 3 Compiler Contributing Guide
url: "/scala3/guides/contribution/contribution-intro.html"
- title: Style Guide
url: "/style/index.html"
- title: Cheatsheet
url: "/cheatsheets/index.html"
- title: Glossary
url: "/glossary/index.html"
- title: API
url: "#"
submenu:
- title: Current
url: https://www.scala-lang.org/api/current/
- title: All Versions
url: "/api/all.html"
url: "/api/all.html"
- title: SIPs
url: "/sips/index.html"
72 changes: 56 additions & 16 deletions _data/overviews.yml
@@ -1,4 +1,3 @@

- category: Standard Library
description: "Guides and overviews covering the Scala standard library."
overviews:
Expand Down Expand Up @@ -60,6 +59,31 @@
- category: Language
description: "Guides and overviews covering features in the Scala language."
overviews:
- title: "Migration from Scala 2 to Scala 3"
by: Adrien Piquerez
icon: suitcase
root: "scala3/guides/"
url: "migration/compatibility-intro.html"
description: "Everything you need to know about compatibility and migration to Scala 3."
- title: Scala 3 Macros
by: Nicolas Stucki
icon: magic
root: "scala3/guides/"
url: "macros"
description: "A detailed tutorial to cover all the features involved in writing macros in Scala 3."
label-text: new in Scala 3
- title: Value Classes and Universal Traits
by: Mark Harrah
description: "Value classes are a new mechanism in Scala to avoid allocating runtime objects. This is accomplished through the definition of new AnyVal subclasses."
icon: gem
url: "core/value-classes.html"
- title: An Overview of TASTy
by: Alvin Alexander
icon: birthday-cake
label-text: new in Scala 3
root: "scala3/guides/"
url: "tasty-overview.html"
description: "An overview over the TASTy format aimed at end-users of the Scala language."
- title: String Interpolation
icon: dollar-sign
url: "core/string-interpolation.html"
Expand All @@ -72,11 +96,15 @@
by: Josh Suereth
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."
url: "core/implicit-classes.html"
- title: Value Classes and Universal Traits
by: Mark Harrah
description: "Value classes are a new mechanism in Scala to avoid allocating runtime objects. This is accomplished through the definition of new AnyVal subclasses."
icon: gem
url: "core/value-classes.html"
- title: The Scala Book
by: Alvin Alexander
icon: book
label-color: "#899295"
label-text: archived
url: "scala-book/introduction.html"
description: >
A light introduction to the Scala language, focused on Scala 2.
<a href="/scala3/book/introduction.html">Now updated for Scala 3</a>, we are in the process of merging the two.

- category: Authoring Libraries
description: "Guides for contributing open source libraries to the Scala ecosystem."
Expand Down Expand Up @@ -137,13 +165,20 @@
- category: "Tools"
description: "Reference material on core Scala tools like the Scala REPL and Scaladoc generation."
overviews:
- title: Scala REPL
- title: Scala 2 REPL
icon: terminal
url: "repl/overview.html"
description: |
The Scala REPL is a tool (<code>scala</code>) for evaluating expressions in Scala.
<br><br>
The <code>scala</code> command will execute a source script by wrapping it in a template and then compiling and executing the resulting program
- title: Scaladoc For Scala 3
by: Krzysztof Romanowski, Aleksander Boruch-Gruszecki, Andrzej Ratajczak, Kacper Korban, Filip Zybała
icon: book
root: "scala3/guides/"
url: "scaladoc"
description: "Updates in Scala 3 to Scala’s API documentation generation tool."
label-text: updated
- title: Scaladoc
url: "scaladoc/overview.html"
icon: book
Expand All @@ -159,12 +194,18 @@
- category: Compiler
description: "Guides and overviews covering the Scala compiler: compiler plugins, reflection, and metaprogramming tools such as macros."
overviews:
- title: Reflection
- title: "Scala 3 Contributing Guide"
by: Jamie Thompson, Anatolii Kmetiuk
icon: cogs
root: "scala3/guides/"
url: "contribution/contribution-intro.html"
description: "Guide to the Scala 3 Compiler and fixing an issue"
- title: Scala 2 Reflection
by: Heather Miller, Eugene Burmako, and Philipp Haller
icon: binoculars
url: "reflection/overview.html"
description: Scala's runtime/compile-time reflection framework.
label-text: experimental
label-text: removed in Scala 3
subdocs:
- title: Overview
url: "reflection/overview.html"
Expand All @@ -180,12 +221,12 @@
url: "reflection/thread-safety.html"
- title: Changes in Scala 2.11
url: "reflection/changelog211.html"
- title: Macros
- title: Scala 2 Macros
by: Eugene Burmako
icon: magic
url: "macros/usecases.html"
description: "Scala's metaprogramming framework."
label-text: experimental
label-text: removed in Scala 3
subdocs:
- title: Use Cases
url: "macros/usecases.html"
Expand All @@ -211,12 +252,12 @@
url: "macros/roadmap.html"
- title: Changes in 2.11
url: "macros/changelog211.html"
- title: Quasiquotes
- title: Quasiquotes in Scala 2
by: Denys Shabalin
icon: quote-left
url: "quasiquotes/setup.html"
description: "Quasiquotes are a convenient way to manipulate Scala syntax trees."
label-text: experimental
label-text: removed in Scala 3
subdocs:
- title: Dependencies and setup
url: "quasiquotes/setup.html"
Expand Down Expand Up @@ -244,12 +285,12 @@
url: "quasiquotes/terminology.html"
- title: Future prospects
url: "quasiquotes/future.html"
- title: Compiler Plugins
- title: Scala 2 Compiler Plugins
by: Lex Spoon and Seth Tisue
icon: puzzle-piece
url: "plugins/index.html"
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."
- title: Compiler Options
- title: Scala 2 Compiler Options
by: Community
icon: cog
url: "compiler-options/index.html"
Expand All @@ -265,7 +306,6 @@
url: "compiler-options/optimizer.html"
description: "The compiler can perform various optimizations."


- category: Legacy
description: "Guides covering features no longer relevant to recent Scala versions (2.12+)."
overviews:
Expand Down
24 changes: 0 additions & 24 deletions _data/scala3-doc-nav-header.yml

This file was deleted.

4 changes: 3 additions & 1 deletion _getting-started/index.md
Expand Up @@ -5,7 +5,9 @@ partof: getting-started
languages: [fr, ja, uk]
includeTOC: true

redirect_from: "/getting-started.html"
redirect_from:
- /getting-started.html
- /scala3/getting-started.html # we deleted the scala 3 version of this page
---

{% include getting-started.md %}
10 changes: 0 additions & 10 deletions _includes/documentation-sections.html
Expand Up @@ -14,15 +14,5 @@ <h5>{{link.title}}</h5>
</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>
13 changes: 10 additions & 3 deletions _includes/headertop.html
@@ -1,8 +1,15 @@
<!DOCTYPE html>
{% if page.scala3 %}
<html class="scala3">
{% if page.scala3 or page.new-version %}
{% assign classes='' %}
{% if page.scala3 %}
{% assign classes= classes | append: ' scala3' %}
{% endif %}
{% if page.new-version %}
{% assign classes= classes | append: ' outdated-page' %}
{% endif %}
<html class="{{classes}}">
{% else %}
<html>
<html>
{% endif %}
<head>
<title>
Expand Down
9 changes: 1 addition & 8 deletions _includes/navbar-inner.html
@@ -1,8 +1,4 @@
{% if page.scala3 %}
{% assign navdata = site.data.scala3-doc-nav-header %}
{% else %}
{% assign navdata = site.data.doc-nav-header %}
{% endif %}
{% assign navdata = site.data.doc-nav-header %}

{% include site-header.html %}

Expand All @@ -18,9 +14,6 @@
<a href="{{ site.baseurl }}/{{ docsRootTranslated.language }}">
<img src="{{ site.baseurl }}/resources/img/documentation-logo@2x.png" 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>
Expand Down
15 changes: 7 additions & 8 deletions _includes/sidebar-toc-multipage-overview.html
@@ -1,13 +1,12 @@
{% assign pagetype = page.type %}
<div class="content-nav">
<div class="inner-box sidebar-toc-wrapper" style="">
<div class="inner-box sidebar-toc-wrapper {% if pagetype %}book{% endif %}" style="">
<h5 class="contents">Contents</h5>
{% assign type = page.type %}
{% if type %}
<div class="inner-toc book" id="sidebar-toc">
{% else %}
<div class="inner-toc" id="sidebar-toc">
{% endif %}

{% if pagetype %}
<div class="inner-toc book" id="sidebar-toc">
{% else %}
<div class="inner-toc" id="sidebar-toc">
{% endif %}
<ul>
{% assign sorted = site[page.collection] | sort: 'num' %}
{% for pg in sorted %}
Expand Down
13 changes: 13 additions & 0 deletions _includes/version-specific-notice.html
@@ -0,0 +1,13 @@
{% if include.language %}
<blockquote class="help-info">
<i class="fa fa-info"></i><span style="margin-left: 0.5rem">
{% if include.language == 'scala3' %}
This doc page is specific to Scala 3,
and may cover new concepts not available in Scala 2.
{% else if include.language == 'scala2' %}
This doc page is specific to features shipped in Scala 2,
which have either been removed in Scala 3 or replaced by an alternative.
{% endif %}
</span>
</blockquote>
{% endif %}