Skip to content

Add missing features to scala3doc to match dotty docs #10320

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

Merged
merged 14 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1455,10 +1455,11 @@ object Build {

def asScala3doc: Project = {
def generateDocumentation(targets: String, name: String, outDir: String, params: String = "") = Def.taskDyn {
val sourcesAndRevision = "-s github://lampepfl/dotty --revision master"
val projectVersion = version.value
val sourcesAndRevision = s"-s github://lampepfl/dotty --revision master --projectVersion $projectVersion"
run.in(Compile).toTask(
s""" -d output/$outDir -t $targets -n "$name" $sourcesAndRevision $params"""
)
s""" -d scala3doc/output/$outDir -t $targets -n "$name" $sourcesAndRevision $params"""
)
}

def joinProducts(products: Seq[java.io.File]): String =
Expand Down Expand Up @@ -1491,8 +1492,13 @@ object Build {
Compile / mainClass := Some("dotty.dokka.Main"),
// There is a bug in dokka that prevents parallel tests withing the same jvm
fork.in(test) := true,
baseDirectory.in(run) := baseDirectory.in(ThisBuild).value,
generateSelfDocumentation := Def.taskDyn {
generateDocumentation(classDirectory.in(Compile).value.getAbsolutePath, "scala3doc", "self", "-p documentation")
generateDocumentation(
classDirectory.in(Compile).value.getAbsolutePath,
"scala3doc", "self",
"-p scala3doc/documentation --projectLogo scala3doc/documentation/logo.svg",
)
}.value,
generateScala3Documentation := Def.taskDyn {
val dottyJars: Seq[java.io.File] = Seq(
Expand All @@ -1506,7 +1512,7 @@ object Build {
val roots = joinProducts(dottyJars)

if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
else generateDocumentation(roots, "Scala 3", "scala3", "-p scala3-docs")
else generateDocumentation(roots, "Scala 3", "scala3", "-p scala3doc/scala3-docs --projectLogo scala3doc/scala3-docs/logo.svg")
}.value,
generateTestcasesDocumentation := Def.taskDyn {
generateDocumentation(Build.testcasesOutputDir.in(Test).value, "Scala3doc testcases", "testcases")
Expand Down
1 change: 1 addition & 0 deletions scala3doc/documentation/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scala3doc/resources/dotty_res/images/scala3doc_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 23 additions & 12 deletions scala3doc/resources/dotty_res/styles/scalastyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,33 @@ th {
#paneSearch {
display: none;
}
#logo {
background-size: contain;
background-repeat: no-repeat;
background-image: url(../images/dotty-logo-white.svg);
background-origin: content-box;
padding: 8px 0 8px 16px;
height: 42px;
#logo>span {
display: inline-block;
padding: 8px 8px 8px 8px;
vertical-align: middle;
}

#logo img {
max-height: 54px;
max-width: 54px;
cursor: pointer;
}
#logo::after {

#logo .projectName {
color: var(--leftbar-fg);
font-size: 22px;
content: "Scala3doc";
margin-left: 42px;
line-height: 42px;
font-size: 28px;
font-weight: bold;
}

#logo .projectVersion {
color: var(--leftbar-fg);
font-size: 12px;
}

.scala3doc_logo {
width: 116px;
}

.sideMenuPart {
padding-left: 1em;
}
Expand Down
2 changes: 1 addition & 1 deletion scala3doc/resources/dotty_res/styles/search-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.search-content {
padding: 0;
margin: var(--content-padding);
position: absolute;
position: fixed;
top: 0;
right: 0;
z-index: 5;
Expand Down
2 changes: 1 addition & 1 deletion scala3doc/scala3-docs/_layouts/doc-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<header>
<h1>{{ page.title }}</h1>
<div class="byline">
<a href="{{ site.projectUrl }}/edit/master/{{ site.root }}/{{ page.url }}">
<a href="{{ urls.editSource }}">
<i class="far fa-edit"></i>
Edit this page on GitHub
</a>
Expand Down
Loading