Skip to content

Commit a5bc166

Browse files
committed
Add indexes to reference chapters
1 parent 0d357b2 commit a5bc166

File tree

16 files changed

+35
-186
lines changed

16 files changed

+35
-186
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ jobs:
473473
DOTTY_WEBSITE_BOT_TOKEN: ${{ secrets.BOT_TOKEN }} # If you need to change this:
474474
# Generate one at https://github.com/settings/tokens
475475
# Make sure you have the write permissions to the repo: https://github.com/lampepfl/dotty-website
476-
DOCS_SCALALANG_BOT_TOKEN: ${{ secrets.DOCS_SCALALANG_BOT_TOKEN }} # If you need to change this:
476+
# Currently unused token, no need to deploy anything to docs.scala-lang
477+
# DOCS_SCALALANG_BOT_TOKEN: ${{ secrets.DOCS_SCALALANG_BOT_TOKEN }} # If you need to change this:
477478
# Generate one at https://github.com/settings/tokens
478479
# Make sure you have the write permissions to the repo: https://github.com/scala/docs.scala-lang
479480

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,7 @@ cs
102102

103103
# Coursier test product
104104
compiler/test-coursier/run/*.jar
105+
106+
# docs related
107+
contributors.js
108+
content-contributors.css

docs/docs/reference/changed-features/index.md

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

docs/docs/reference/contextual.md renamed to docs/docs/reference/contextual/contextual.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,25 @@ Existing Scala programmers by and large have gotten used to the status quo and s
5050

5151
The following pages introduce a redesign of contextual abstractions in Scala. They introduce four fundamental changes:
5252

53-
1. [Given Instances](./contextual/givens.md) are a new way to define basic terms that can be synthesized. They replace implicit definitions. The core principle of the proposal is that, rather than mixing the `implicit` modifier with a large number of features, we have a single way to define terms that can be synthesized for types.
53+
1. [Given Instances](./givens.md) are a new way to define basic terms that can be synthesized. They replace implicit definitions. The core principle of the proposal is that, rather than mixing the `implicit` modifier with a large number of features, we have a single way to define terms that can be synthesized for types.
5454

55-
2. [Using Clauses](./contextual/using-clauses.md) are a new syntax for implicit _parameters_ and their _arguments_. It unambiguously aligns parameters and arguments, solving a number of language warts. It also allows us to have several `using` clauses in a definition.
55+
2. [Using Clauses](./using-clauses.md) are a new syntax for implicit _parameters_ and their _arguments_. It unambiguously aligns parameters and arguments, solving a number of language warts. It also allows us to have several `using` clauses in a definition.
5656

57-
3. ["Given" Imports](./contextual/given-imports.md) are a new class of import selectors that specifically import
57+
3. ["Given" Imports](./given-imports.md) are a new class of import selectors that specifically import
5858
givens and nothing else.
5959

60-
4. [Implicit Conversions](./contextual/conversions.md) are now expressed as given instances of a standard `Conversion` class. All other forms of implicit conversions will be phased out.
60+
4. [Implicit Conversions](./conversions.md) are now expressed as given instances of a standard `Conversion` class. All other forms of implicit conversions will be phased out.
6161

6262
This section also contains pages describing other language features that are related to context abstraction. These are:
6363

64-
- [Context Bounds](./contextual/context-bounds.md), which carry over unchanged.
65-
- [Extension Methods](./contextual/extension-methods.md) replace implicit classes in a way that integrates better with type classes.
66-
- [Implementing Type Classes](./contextual/type-classes.md) demonstrates how some common type classes can be implemented using the new constructs.
67-
- [Type Class Derivation](./contextual/derivation.md) introduces constructs to automatically derive type class instances for ADTs.
68-
- [Multiversal Equality](./contextual/multiversal-equality.md) introduces a special type class to support type safe equality.
69-
- [Context Functions](./contextual/context-functions.md) provide a way to abstract over context parameters.
70-
- [By-Name Context Parameters](./contextual/by-name-context-parameters.md) are an essential tool to define recursive synthesized values without looping.
71-
- [Relationship with Scala 2 Implicits](./contextual/relationship-implicits.md) discusses the relationship between old-style implicits and new-style givens and how to migrate from one to the other.
64+
- [Context Bounds](./context-bounds.md), which carry over unchanged.
65+
- [Extension Methods](./extension-methods.md) replace implicit classes in a way that integrates better with type classes.
66+
- [Implementing Type Classes](./type-classes.md) demonstrates how some common type classes can be implemented using the new constructs.
67+
- [Type Class Derivation](./derivation.md) introduces constructs to automatically derive type class instances for ADTs.
68+
- [Multiversal Equality](./multiversal-equality.md) introduces a special type class to support type safe equality.
69+
- [Context Functions](./context-functions.md) provide a way to abstract over context parameters.
70+
- [By-Name Context Parameters](./by-name-context-parameters.md) are an essential tool to define recursive synthesized values without looping.
71+
- [Relationship with Scala 2 Implicits](./relationship-implicits.md) discusses the relationship between old-style implicits and new-style givens and how to migrate from one to the other.
7272

7373
Overall, the new design achieves a better separation of term inference from the rest of the language: There is a single way to define givens instead of a multitude of forms all taking an `implicit` modifier. There is a single way to introduce implicit parameters and arguments instead of conflating implicit with normal arguments. There is a separate way to import givens that does not allow them to hide in a sea of normal imports. And there is a single way to define an implicit conversion which is clearly marked as such and does not require special syntax.
7474

docs/docs/reference/contextual/derivation-macro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ and an age of type `Int`, the equality check we want to generate is the followin
109109

110110
## Calling the derived method inside the macro
111111

112-
Following the rules in [Macros](../metaprogramming.md) we create two methods.
112+
Following the rules in [Macros](../metaprogramming/metaprogramming.md) we create two methods.
113113
One that hosts the top-level splice `eqv` and one that is the implementation.
114114
Alternatively and what is shown below is that we can call the `eqv` method
115115
directly. The `eqGen` can trigger the derivation.

docs/docs/reference/metaprogramming.md renamed to docs/docs/reference/metaprogramming/metaprogramming.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ movedTo: https://docs.scala-lang.org/scala3/reference/metaprogramming.html
77
The following pages introduce the redesign of metaprogramming in Scala. They
88
introduce the following fundamental facilities:
99

10-
1. [`inline`](./metaprogramming/inline.md) is a new modifier that guarantees that
10+
1. [`inline`](./inline.md) is a new modifier that guarantees that
1111
a definition will be inlined at the point of use. The primary motivation
1212
behind inline is to reduce the overhead behind function calls and access to
1313
values. The expansion will be performed by the Scala compiler during the
@@ -18,30 +18,30 @@ introduce the following fundamental facilities:
1818
programming), macros (enabling compile-time, generative, metaprogramming) and
1919
runtime code generation (multi-stage programming).
2020

21-
2. [Compile-time ops](./metaprogramming/compiletime-ops.md) are helper definitions in the
21+
2. [Compile-time ops](./compiletime-ops.md) are helper definitions in the
2222
standard library that provide support for compile-time operations over values and types.
2323

24-
3. [Macros](./metaprogramming/macros.md) are built on two well-known fundamental
24+
3. [Macros](./macros.md) are built on two well-known fundamental
2525
operations: quotation and splicing. Quotation converts program code to
2626
data, specifically, a (tree-like) representation of this code. It is
2727
expressed as `'{...}` for expressions and as `'[...]` for types. Splicing,
2828
expressed as `${ ... }`, goes the other way: it converts a program's representation
2929
to program code. Together with `inline`, these two abstractions allow
3030
to construct program code programmatically.
3131

32-
4. [Runtime Staging](./metaprogramming/staging.md) Where macros construct code at _compile-time_,
32+
4. [Runtime Staging](./staging.md) Where macros construct code at _compile-time_,
3333
staging lets programs construct new code at _runtime_. That way,
3434
code generation can depend not only on static data but also on data available at runtime. This splits the evaluation of the program in two or more phases or ...
3535
stages. Consequently, this method of generative programming is called "Multi-Stage Programming". Staging is built on the same foundations as macros. It uses
3636
quotes and splices, but leaves out `inline`.
3737

38-
5. [Reflection](./metaprogramming/reflection.md) Quotations are a "black-box"
38+
5. [Reflection](./reflection.md) Quotations are a "black-box"
3939
representation of code. They can be parameterized and composed using
4040
splices, but their structure cannot be analyzed from the outside. TASTy
4141
reflection gives a way to analyze code structure by partly revealing the representation type of a piece of code in a standard API. The representation
4242
type is a form of typed abstract syntax tree, which gives rise to the `TASTy`
4343
moniker.
4444

45-
6. [TASTy Inspection](./metaprogramming/tasty-inspect.md) Typed abstract syntax trees are serialized
45+
6. [TASTy Inspection](./tasty-inspect.md) Typed abstract syntax trees are serialized
4646
in a custom compressed binary format stored in `.tasty` files. TASTy inspection allows
4747
to load these files and analyze their content's tree structure.

docs/sidebar.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sidebar:
1010
subsection:
1111
- page: docs/reference/overview.md
1212
- title: New Types
13+
index: docs/reference/new-types/new-types.md
1314
subsection:
1415
- page: docs/reference/new-types/intersection-types.md
1516
- page: docs/reference/new-types/union-types.md
@@ -18,13 +19,14 @@ sidebar:
1819
- page: docs/reference/new-types/dependent-function-types.md
1920
- page: docs/reference/new-types/polymorphic-function-types.md
2021
- title: Enums
22+
index: docs/reference/enums/enums-index.md
2123
subsection:
2224
- page: docs/reference/enums/enums.md
2325
- page: docs/reference/enums/adts.md
2426
- page: docs/reference/enums/desugarEnums.md
2527
- title: Contextual Abstractions
28+
index: docs/reference/contextual/contextual.md
2629
subsection:
27-
- page: docs/reference/contextual.md
2830
- page: docs/reference/contextual/givens.md
2931
- page: docs/reference/contextual/using-clauses.md
3032
- page: docs/reference/contextual/context-bounds.md
@@ -38,15 +40,16 @@ sidebar:
3840
- page: docs/reference/contextual/by-name-context-parameters.md
3941
- page: docs/reference/contextual/relationship-implicits.md
4042
- title: Metaprogramming
43+
index: docs/reference/metaprogramming/metaprogramming.md
4144
subsection:
42-
- page: docs/reference/metaprogramming.md
4345
- page: docs/reference/metaprogramming/inline.md
4446
- page: docs/reference/metaprogramming/compiletime-ops.md
4547
- page: docs/reference/metaprogramming/macros.md
4648
- page: docs/reference/metaprogramming/staging.md
4749
- page: docs/reference/metaprogramming/reflection.md
4850
- page: docs/reference/metaprogramming/tasty-inspect.md
4951
- title: Other New Features
52+
index: docs/reference/other-new-features/other-new-types.md
5053
subsection:
5154
- page: docs/reference/other-new-features/trait-parameters.md
5255
- page: docs/reference/other-new-features/transparent-traits.md
@@ -66,6 +69,7 @@ sidebar:
6669
- page: docs/reference/other-new-features/type-test.md
6770
- page: docs/reference/other-new-features/experimental-defs.md
6871
- title: Other Changed Features
72+
index: docs/reference/changed-features/changed-features.md
6973
subsection:
7074
- page: docs/reference/changed-features/numeric-literals.md
7175
- page: docs/reference/changed-features/structural-types.md
@@ -86,6 +90,7 @@ sidebar:
8690
- page: docs/reference/changed-features/lazy-vals-init.md
8791
- page: docs/reference/changed-features/main-functions.md
8892
- title: Dropped Features
93+
index: docs/reference/dropped-features/dropped-features.md
8994
subsection:
9095
- page: docs/reference/dropped-features/delayed-init.md
9196
- page: docs/reference/dropped-features/macros.md

project/Build.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,6 @@ object Build {
13221322
name,
13231323
scalaSrcLink(stdLibVersion, srcManaged(dottyNonBootstrappedVersion, "scala") + "="),
13241324
dottySrcLink(referenceVersion, srcManaged(dottyNonBootstrappedVersion, "dotty") + "=", "#library/src"),
1325-
dottySrcLink(referenceVersion, "docs-for-dotty-page=", "#docs"),
13261325
dottySrcLink(referenceVersion),
13271326
"-Ygenerate-inkuire",
13281327
) ++ scalacOptionsDocSettings(includeExternalMappings) ++ revision ++ params ++ targets
@@ -1383,7 +1382,6 @@ object Build {
13831382
val dest = file(extraArgs.headOption.getOrElse("scaladoc/output/scala3")).getAbsoluteFile
13841383
val justAPI = extraArgs.drop(1).headOption == Some("--justAPI")
13851384
val majorVersion = (LocalProject("scala3-library-bootstrapped") / scalaBinaryVersion).value
1386-
CopyDocs.copyDocs() // invoke copying function form `project/CopyDocs.scala`
13871385
val dottyJars: Seq[java.io.File] = Seq(
13881386
(`stdlib-bootstrapped`/Compile/products).value,
13891387
(`scala3-interfaces`/Compile/products).value,
@@ -1414,7 +1412,7 @@ object Build {
14141412
"https://scala-lang.org/api/versions.json",
14151413
"-Ydocument-synthetic-types",
14161414
s"-snippet-compiler:${dottyLibRoot}/scala/quoted=compile,${dottyLibRoot}/scala/compiletime=compile"
1417-
) ++ (if (justAPI) Nil else Seq("-siteroot", "docs-for-dotty-page", "-Yapi-subdirectory")), includeExternalMappings = false)
1415+
) ++ (if (justAPI) Nil else Seq("-siteroot", "docs", "-Yapi-subdirectory")), includeExternalMappings = false)
14181416

14191417
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
14201418
else if (justAPI) generateDocTask

project/CopyDocs.scala

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

project/DocumentationWebsite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object DocumentationWebsite {
1414

1515

1616
val contributorsTestcasesDestinationFile = Paths.get("scaladoc-testcases", "docs", "js", "contributors.js").toFile
17-
val contributorsDestinationFile = Paths.get("docs-for-dotty-page", "js", "contributors.js").toFile
17+
val contributorsDestinationFile = Paths.get("docs", "js", "contributors.js").toFile
1818
sbt.IO.copyFile(contributorsFile, contributorsTestcasesDestinationFile)
1919
sbt.IO.copyFile(contributorsFile, contributorsDestinationFile)
2020

@@ -25,7 +25,7 @@ object DocumentationWebsite {
2525
val cssCodeSnippetsSourceFile = cssSourceFileBase / "code-snippets.css"
2626
sbt.IO.copyFile(cssCodeSnippetsSourceFile, cssCodeSnippetsDesitnationFile)
2727

28-
val cssContentContributorsTestcasesDesitnationFile = Paths.get("docs-for-dotty-page", "css", "content-contributors.css").toFile
28+
val cssContentContributorsTestcasesDesitnationFile = Paths.get("docs", "css", "content-contributors.css").toFile
2929
val cssContentContributorsDesitnationFile = Paths.get("scaladoc-testcases", "docs", "css", "content-contributors.css").toFile
3030
val cssContentContributorsSourceFile = cssContentContributorsSourceBaseFile / "content-contributors.css"
3131
sbt.IO.copyFile(cssContentContributorsSourceFile, cssContentContributorsTestcasesDesitnationFile)

0 commit comments

Comments
 (0)