Skip to content

Commit f6b6e50

Browse files
authored
Scaladoc features parity with old scaladoc/docs.scala-lang (#13954)
* POC * Walk in order and collect previous/next * Add `Edit on Github` button and `Contriubuted` sections * Polish gathering the contributors. CSSes fixes. * Fix tooltipping snippets * Fix handling relative links for static site * Add redirects mechanism for scaladoc * Fix leftover * Fix tests * Fix gathering index html for sections without explicit index * Apply requested changes to scaladoc * Decouple Scala.js jses. Move contributors to be independent asset/ * Add support for multiple redirects * Apply requested changes. Add static site for testcases. Fix minor bugs in scaladoc. * Fix tests
1 parent 51828cc commit f6b6e50

File tree

65 files changed

+718
-177
lines changed

Some content is hidden

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

65 files changed

+718
-177
lines changed

.github/workflows/scaladoc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
java-version: 11
3737

3838
- name: Compile and test scala3doc-js
39-
run: ./project/scripts/sbt scaladoc-js/test
39+
run: ./project/scripts/sbt scaladoc-js-main/test
4040

4141
- name: Compile and test
4242
run: |

build.sbt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
2020
val `tasty-core-scala2` = Build.`tasty-core-scala2`
2121
val scaladoc = Build.scaladoc
2222
val `scaladoc-testcases` = Build.`scaladoc-testcases`
23-
val `scaladoc-js` = Build.`scaladoc-js`
23+
val `scaladoc-js-common` = Build.`scaladoc-js-common`
24+
val `scaladoc-js-main` = Build.`scaladoc-js-main`
25+
val `scaladoc-js-markdown` = Build.`scaladoc-js-markdown`
26+
val `scaladoc-js-contributors` = Build.`scaladoc-js-contributors`
2427
val `scala3-bench-run` = Build.`scala3-bench-run`
2528
val dist = Build.dist
2629
val `community-build` = Build.`community-build`

docs/_layouts/blog-page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
layout: main
2+
layout: static-site-main
33
---
4-
<main class="container">
4+
<main>
55
<header>
66
<h1>{{ page.title }}</h1>
77
<div class="byline">

docs/_layouts/doc-page.html

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
---
2-
layout: main
2+
layout: static-site-main
33
---
4-
<main class="container">
5-
<header>
6-
<h1>{{ page.title }}</h1>
7-
</header>
8-
{{ content }}
4+
<main>
5+
<header>
6+
<h1>{{ page.title }}</h1>
7+
{% if urls.editSource %}
8+
<div class="byline">
9+
<a href="{{ urls.editSource }}">
10+
<i class="far fa-edit"></i>
11+
Edit this page on GitHub
12+
</a>
13+
</div>
14+
{% endif %}
15+
</header>
16+
{{ content }}
17+
<div class="content-contributors hidden">
18+
<h5>Contributors to this page:</h5>
19+
<div id="documentation-contributors" class="contributors-container"></div>
20+
</div>
921
</main>
22+

docs/_layouts/main.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
layout: base
3+
extraJS:
4+
- js/contributors.js
5+
extraCSS:
6+
- css/content-contributors.css
37
---
48
<div id="content-wrapper">
5-
{% if page.movedTo %}
6-
<aside class="warning">
7-
The content of this page is outdated. Click <a href="{{ page.movedTo }}">here</a> to find the up to date version of this page.
8-
</aside>
9-
{% endif %}
10-
{{ content }}
9+
{{ content }}
1110
</div>
1211
<script>
1312
((window.gitter = {}).chat = {}).options = {

docs/_layouts/redirect.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
hasFrame: false
3+
---
4+
<!DOCTYPE html>
5+
<html lang="en-US">
6+
<meta charset="utf-8">
7+
<title>Redirecting&hellip;</title>
8+
<link rel="canonical" href="{{ redirectTo }}">
9+
<script>location="{{ redirectTo }}"</script>
10+
<meta http-equiv="refresh" content="0; url={{ redirectTo }}">
11+
<meta name="robots" content="noindex">
12+
<h1>Redirecting&hellip;</h1>
13+
<a href="{{ redirectTo }}">Click here if you were not redirected.</a>
14+
</html>

docs/_layouts/static-site-main.html

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
layout: main
3+
---
4+
<div class="container">
5+
<div id="site-header">
6+
<div class="wrap">
7+
<nav class="navigation" role="menu">
8+
<ul class="navigation-menu">
9+
<li class="navigation-menu-item">
10+
<a href="https://docs.scala-lang.org/" class="active">Documentation</a>
11+
</li>
12+
<li class="navigation-menu-item">
13+
<a href="https://www.scala-lang.org/download/">Download</a>
14+
</li>
15+
<li class="navigation-menu-item">
16+
<a href="https://www.scala-lang.org/community/">Community</a>
17+
</li>
18+
<li class="navigation-menu-item">
19+
<a href="https://index.scala-lang.org">Libraries</a>
20+
</li>
21+
<li class="navigation-menu-item">
22+
<a href="https://www.scala-lang.org/contribute/">Contribute</a>
23+
</li>
24+
<li class="navigation-menu-item">
25+
<a href="https://www.scala-lang.org/blog/">Blog</a>
26+
</li>
27+
</ul>
28+
</nav>
29+
</div>
30+
</div>
31+
{% if page.movedTo %}
32+
<aside class="warning">
33+
The content of this page is outdated. Click <a href="{{ page.movedTo }}">here</a> to find the up to date version of this page.
34+
</aside>
35+
{% endif %}
36+
{{ content }}
37+
<nav class="arrows-wrapper" aria-label="Page navigation">
38+
{% if page.previous %}
39+
<a rel="prev" href="{{ page.previous }}" class="arrows previous" aria-keyshortcuts="Left">
40+
<i class="fa fa-angle-left"></i>
41+
</a>
42+
{% endif %}
43+
{% if page.next %}
44+
<a rel="next" href="{{ page.next }}" class="arrows next" aria-keyshortcuts="Right">
45+
<i class="fa fa-angle-right"></i>
46+
</a>
47+
{% endif %}
48+
</nav>
49+
</div>

docs/blog/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: main
2+
layout: static-site-main
33
title: Blog
44
---
55
<main class="container">

docs/css/dottydoc.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ main > h1 {
2525
margin-bottom: 20px;
2626
}
2727

28+
.byline {
29+
font-size: 14px;
30+
}
31+
2832
.byline, .byline a {
2933
color: grey;
3034
}
@@ -265,4 +269,4 @@ aside.success {
265269
header {
266270
position: static !important;
267271
width: 100% !important;
268-
}
272+
}

docs/docs/reference/experimental/named-typeargs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: singlepage-overview
33
scala3: true
44
title: "Named Type Arguments"
5+
redirectFrom: reference/other-new-features/named-typeargs.html
56
---
67

78
**Note:** This feature is implemented in Scala 3, but is not expected to be part of Scala 3.0.

0 commit comments

Comments
 (0)