diff --git a/project/Build.scala b/project/Build.scala index daba197295b5..ab6671ddc0c6 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1466,21 +1466,23 @@ object Build { def joinProducts(products: Seq[java.io.File]): String = products.iterator.map(_.getAbsolutePath.toString).mkString(java.io.File.pathSeparator) + val dokkaVersion = "1.4.10.2" + project.settings(commonBootstrappedSettings). dependsOn(`scala3-compiler-bootstrapped`). dependsOn(`scala3-tasty-inspector`). settings( // Needed to download dokka and its dependencies resolvers += Resolver.jcenterRepo, - // Needed to download dokka-site - resolvers += Resolver.bintrayRepo("virtuslab", "dokka"), libraryDependencies ++= Seq( - "com.virtuslab.dokka" % "dokka-site" % "0.1.9", + "org.jetbrains.dokka" % "dokka-core" % dokkaVersion, + "org.jetbrains.dokka" % "dokka-base" % dokkaVersion, + "org.jetbrains.kotlinx" % "kotlinx-html-jvm" % "0.7.2", // Needs update when dokka version changes "com.vladsch.flexmark" % "flexmark-all" % "0.42.12", "nl.big-o" % "liqp" % "0.6.7", "args4j" % "args4j" % "2.33", - "org.jetbrains.dokka" % "dokka-test-api" % "1.4.10.2" % "test", + "org.jetbrains.dokka" % "dokka-test-api" % dokkaVersion % "test", "com.novocode" % "junit-interface" % "0.11" % "test", ), Test / test := (Test / test).dependsOn(compile.in(Compile).in(`scala3doc-testcases`)).value, diff --git a/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala b/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala index 09b1356dd023..368560276a26 100644 --- a/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala +++ b/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala @@ -358,10 +358,7 @@ object DottyPlugin extends AutoPlugin { }.value, // Configuration for the doctool - resolvers ++= (if(!useScala3doc.value) Nil else Seq( - Resolver.jcenterRepo, - Resolver.bintrayRepo("virtuslab", "dokka"), - )), + resolvers ++= (if(!useScala3doc.value) Nil else Seq(Resolver.jcenterRepo)), useScala3doc := false, scala3docOptions := Nil, Compile / doc / scalacOptions := { diff --git a/scala3doc/dotty-docs/docs/index.html b/scala3doc/dotty-docs/docs/index.html index f31017f8e264..b0065cf5d2c8 100644 --- a/scala3doc/dotty-docs/docs/index.html +++ b/scala3doc/dotty-docs/docs/index.html @@ -49,158 +49,31 @@
If you are a Mac user, you can install Dotty with brew:
-brew install lampepfl/brew/dotty
+ If you are a Mac user, you can install Dotty with brew:
+brew install lampepfl/brew/dotty
- If you are a Linux or Windows user, download the latest release. Optionally add path of the folder bin/
to the system environment variable PATH
.
If you are a Linux or Windows user, download the latest release. Optionally add path of the folder bin/
to the system environment variable PATH
.
Now you can compile Scala source code:
-dotc hello.scala
+ Now you can compile Scala source code:
+scalac hello.scala
- To start the REPL, run: dotr
.
To start the REPL, run: scala
.
Or, you can try Dotty in your browser with Scastie.
+Or, you can try Dotty in your browser with Scastie.
-The fastest way to create a new project in Dotty is using sbt (1.1.4+).
+The fastest way to create a new project in Dotty is using sbt (1.1.4+).
-Create a Dotty project:
-sbt new lampepfl/dotty.g8
+ Create a Dotty project:
+sbt new lampepfl/dotty.g8
- Or a Dotty project that cross compiles with Scala 2:
-sbt new lampepfl/dotty-cross.g8
+ Or a Dotty project that cross compiles with Scala 2:
+sbt new lampepfl/dotty-cross.g8
- For documentation see the Dotty Example Project.
-For documentation see the Dotty Example Project.
+Intersection Types | -Implemented | -
Union Types | -Implemented | -
Type lambdas | -Implemented | -
Context query | -Implemented | -
Trait parameters | -Implemented | -
Implied Instances | -Implemented | -
Inferable parameters | -Implemented | -
Extension Methods | -Implemented | -
Opaque Type Aliases | -Implemented | -
Toplevel definitions | -Implemented | -
Export clauses | -Implemented | -
Vararg patterns | -Implemented | -
Creator applications | -Implemented | -
@static methods and fields | -Implemented | -
SBT incremental build | -Implemented | -
Option-less pattern matching | -Implemented | -
Multiversal equality | -Implemented | -
Erased Terms | -Implemented | -
Auto-Specialization | -In progress | -
Whole program optimizer | -In progress | -
HList & HMaps/Record types | -In progress | -
- | - |
Effects | -Considered | -
…and many more, check the overview page for a comprehensive list | -- |
That’s great! We have more details on the docs and please join our Gitter channel!
-Ala ma kota w paski from here. Hej with link!
""" + + testTemplates( + Map("p1" -> "paski", "p2" -> "Hej"), + List(base -> "html", content -> "md") + ) { it => + assertEquals( + expected, + fullRender(it.layouts("content"), it) + ) + } + + @Test + def layout(): Unit = + val base = + """--- + |title: myTitle + |name: base + |--- + |Ala {{ content }}. {{p2}}! + |""".stripMargin + + val content = + """--- + |layout: base + |name: content + |--- + |ma kota w **{{ p1 }}** + |""".stripMargin + + + val expected = """Ala ma kota w paski. Hej!
""".stripMargin + + testTemplates( + Map("p1" -> "paski", "p2" -> "Hej"), + List(base -> "html", content -> "md") + ) { it => + assertEquals( + expected, + fullRender(it.layouts("content"), it) + ) + } + + @Test + def nestedLayout_htmlMdHtml(): Unit = + val toplevel = + """--- + |name: toplevel + |--- + |[div id="root"]{{ content }}[/div] + |""".stripMargin + + val basePage = + """--- + |layout: toplevel + |name: basePage + |--- + |# {{ pageName }} + | + |{{content}} + | + |## {{ pageName }} end + |""".stripMargin + + val content = + """--- + |layout: basePage + |name: content + |--- + |Hello {{ name }}! + |""".stripMargin + + + val expected = + """[div id="root"][h1]Test page[/h1] + |[p]Hello world!![/p] + |[h2]Test page end[/h2] + |[/div]""".stripMargin + + testTemplates( + Map("pageName" -> "Test page", "name" -> "world!"), + List( + toplevel -> "html", + basePage -> "md", + content -> "md" + ) + ) (it => fullRender(it.layouts("content"), it)) + + @Test + def nestedLayout_mdHtmlMd(): Unit = + val toplevel = + """--- + |name: toplevel + |--- + |Hello world!!
+ |