Skip to content

Commit 470413c

Browse files
committed
Use provided name, logo and projectVersion
also expost it as fields in static site
1 parent 52d238e commit 470413c

File tree

11 files changed

+97
-30
lines changed

11 files changed

+97
-30
lines changed

project/Build.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,10 +1455,11 @@ object Build {
14551455

14561456
def asScala3doc: Project = {
14571457
def generateDocumentation(targets: String, name: String, outDir: String, params: String = "") = Def.taskDyn {
1458-
val sourcesAndRevision = "-s github://lampepfl/dotty --revision master"
1458+
val projectVersion = version.value
1459+
val sourcesAndRevision = s"-s github://lampepfl/dotty --revision master --projectVersion $projectVersion"
14591460
run.in(Compile).toTask(
14601461
s""" -d output/$outDir -t $targets -n "$name" $sourcesAndRevision $params"""
1461-
)
1462+
)
14621463
}
14631464

14641465
def joinProducts(products: Seq[java.io.File]): String =
@@ -1492,7 +1493,11 @@ object Build {
14921493
// There is a bug in dokka that prevents parallel tests withing the same jvm
14931494
fork.in(test) := true,
14941495
generateSelfDocumentation := Def.taskDyn {
1495-
generateDocumentation(classDirectory.in(Compile).value.getAbsolutePath, "scala3doc", "self", "-p documentation")
1496+
generateDocumentation(
1497+
classDirectory.in(Compile).value.getAbsolutePath,
1498+
"scala3doc", "self",
1499+
"-p documentation --projectLogo documentation/logo.svg",
1500+
)
14961501
}.value,
14971502
generateScala3Documentation := Def.taskDyn {
14981503
val dottyJars: Seq[java.io.File] = Seq(
@@ -1506,7 +1511,7 @@ object Build {
15061511
val roots = joinProducts(dottyJars)
15071512

15081513
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
1509-
else generateDocumentation(roots, "Scala 3", "scala3", "-p scala3-docs")
1514+
else generateDocumentation(roots, "Scala 3", "scala3", "-p scala3-docs --projectLogo scala3-docs/logo.svg")
15101515
}.value,
15111516
generateTestcasesDocumentation := Def.taskDyn {
15121517
generateDocumentation(Build.testcasesOutputDir.in(Test).value, "Scala3doc testcases", "testcases")

scala3doc/documentation/logo.svg

Lines changed: 1 addition & 0 deletions
Loading

scala3doc/resources/dotty_res/styles/scalastyle.css

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,25 @@ th {
129129
#paneSearch {
130130
display: none;
131131
}
132-
#logo {
133-
background-size: contain;
134-
background-repeat: no-repeat;
135-
background-image: url(../images/dotty-logo-white.svg);
136-
background-origin: content-box;
137-
padding: 8px 0 8px 16px;
138-
height: 42px;
132+
#logo>span {
133+
display: inline-block;
134+
padding: 8px 8px 8px 8px;
135+
vertical-align: middle;
136+
}
137+
#logo img{
138+
max-height: 54px;
139+
max-width: 54px;
139140
cursor: pointer;
140141
}
141-
#logo::after {
142+
#logo .projectName {
142143
color: var(--leftbar-fg);
143-
font-size: 22px;
144-
content: "Scala3doc";
145-
margin-left: 42px;
146-
line-height: 42px;
144+
font-size: 28px;
145+
font-weight: bold;
146+
}
147+
148+
#logo .projectVersion {
149+
color: var(--leftbar-fg);
150+
font-size: 12px;
147151
}
148152

149153
.scala3doc_logo {

0 commit comments

Comments
 (0)