|
@@ -3,22 +3,41 @@ module Docs
|
|
|
self.name = 'Scala'
|
|
self.name = 'Scala'
|
|
|
self.type = 'scala'
|
|
self.type = 'scala'
|
|
|
self.links = {
|
|
self.links = {
|
|
|
- home: 'http://www.scala-lang.org/',
|
|
|
|
|
|
|
+ home: 'https://www.scala-lang.org/',
|
|
|
code: 'https://github.com/scala/scala'
|
|
code: 'https://github.com/scala/scala'
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- options[:container] = '#content-container'
|
|
|
|
|
options[:attribution] = <<-HTML
|
|
options[:attribution] = <<-HTML
|
|
|
- © 2002-2019 EPFL, with contributions from Lightbend.<br>
|
|
|
|
|
|
|
+ © 2002-2022 EPFL, with contributions from Lightbend.<br>
|
|
|
Licensed under the Apache License, Version 2.0.
|
|
Licensed under the Apache License, Version 2.0.
|
|
|
HTML
|
|
HTML
|
|
|
|
|
|
|
|
|
|
+ # For Scala 3, there is no official download link for the documentation
|
|
|
|
|
+ # (see https://contributors.scala-lang.org/t/5537).
|
|
|
|
|
+ #
|
|
|
|
|
+ # We currently need to build the docs ourselves. To do so:
|
|
|
|
|
+ # 1. Make sure that Scala 3 and sbt are installed
|
|
|
|
|
+ # (https://www.scala-lang.org/download/scala3.html)
|
|
|
|
|
+ # 2. Clone the Scala 3 (Dotty) repository (https://github.com/lampepfl/dotty)
|
|
|
|
|
+ # 3. From the Dotty folder, run this command in the terminal:
|
|
|
|
|
+ # $ sbt scaladoc/generateScalaDocumentation
|
|
|
|
|
+ # 4. Extract scaladoc/output/scala3/api/ into docs/scala~3.1
|
|
|
|
|
+ version '3.1' do
|
|
|
|
|
+ self.release = '3.1.1'
|
|
|
|
|
+ self.base_url = 'https://scala-lang.org/api/3.1.1/'
|
|
|
|
|
+ self.root_path = 'index.html'
|
|
|
|
|
+ # options[:container] = '#main-content'
|
|
|
|
|
+
|
|
|
|
|
+ html_filters.push 'scala/entries_v3', 'scala/clean_html_v3'
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
# https://downloads.lightbend.com/scala/2.13.0/scala-docs-2.13.0.zip
|
|
# https://downloads.lightbend.com/scala/2.13.0/scala-docs-2.13.0.zip
|
|
|
# Extract api/scala-library into docs/scala~2.13_library
|
|
# Extract api/scala-library into docs/scala~2.13_library
|
|
|
version '2.13 Library' do
|
|
version '2.13 Library' do
|
|
|
self.release = '2.13.0'
|
|
self.release = '2.13.0'
|
|
|
self.base_url = 'https://www.scala-lang.org/api/2.13.0/'
|
|
self.base_url = 'https://www.scala-lang.org/api/2.13.0/'
|
|
|
self.root_path = 'index.html'
|
|
self.root_path = 'index.html'
|
|
|
|
|
+ options[:container] = '#content-container'
|
|
|
|
|
|
|
|
html_filters.push 'scala/entries_v2', 'scala/clean_html_v2'
|
|
html_filters.push 'scala/entries_v2', 'scala/clean_html_v2'
|
|
|
end
|
|
end
|
|
@@ -29,6 +48,7 @@ module Docs
|
|
|
self.release = '2.13.0'
|
|
self.release = '2.13.0'
|
|
|
self.base_url = 'https://www.scala-lang.org/api/2.13.0/scala-reflect/'
|
|
self.base_url = 'https://www.scala-lang.org/api/2.13.0/scala-reflect/'
|
|
|
self.root_path = 'index.html'
|
|
self.root_path = 'index.html'
|
|
|
|
|
+ options[:container] = '#content-container'
|
|
|
|
|
|
|
|
html_filters.push 'scala/entries_v2', 'scala/clean_html_v2'
|
|
html_filters.push 'scala/entries_v2', 'scala/clean_html_v2'
|
|
|
end
|
|
end
|
|
@@ -39,6 +59,7 @@ module Docs
|
|
|
self.release = '2.12.9'
|
|
self.release = '2.12.9'
|
|
|
self.base_url = 'https://www.scala-lang.org/api/2.12.9/'
|
|
self.base_url = 'https://www.scala-lang.org/api/2.12.9/'
|
|
|
self.root_path = 'index.html'
|
|
self.root_path = 'index.html'
|
|
|
|
|
+ options[:container] = '#content-container'
|
|
|
|
|
|
|
|
html_filters.push 'scala/entries_v2', 'scala/clean_html_v2'
|
|
html_filters.push 'scala/entries_v2', 'scala/clean_html_v2'
|
|
|
end
|
|
end
|
|
@@ -49,13 +70,14 @@ module Docs
|
|
|
self.release = '2.12.9'
|
|
self.release = '2.12.9'
|
|
|
self.base_url = 'https://www.scala-lang.org/api/2.12.9/scala-reflect/'
|
|
self.base_url = 'https://www.scala-lang.org/api/2.12.9/scala-reflect/'
|
|
|
self.root_path = 'index.html'
|
|
self.root_path = 'index.html'
|
|
|
|
|
+ options[:container] = '#content-container'
|
|
|
|
|
|
|
|
html_filters.push 'scala/entries_v2', 'scala/clean_html_v2'
|
|
html_filters.push 'scala/entries_v2', 'scala/clean_html_v2'
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
def get_latest_version(opts)
|
|
def get_latest_version(opts)
|
|
|
- doc = fetch_doc('https://www.scala-lang.org/api/current/', opts)
|
|
|
|
|
- doc.at_css('#doc-version').content
|
|
|
|
|
|
|
+ doc = fetch_doc('https://www.scala-lang.org/api/3.x/', opts)
|
|
|
|
|
+ doc.at_css('.projectVersion').content
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|