Skip to content

Commit f598740

Browse files
committed
Fix various small bugs in scaladoc
1 parent 51f3487 commit f598740

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

docs/docs/usage/scaladoc/site-versioning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ doc / scalacOptions ++= Seq("-versions-dictionary-url", "https://dotty.epfl.ch/v
3333

3434
Providing a JSON file via `-versions-dictionary-url` enables scaladoc to link between versions. It is also convenient to be able to change the revision label in the drop-down menu. Everything will change automatically.
3535

36-
![](../../../images/scaladoc/nightly.gif)
36+
![](images/scaladoc/nightly.gif)

scaladoc/resources/dotty_res/styles/scalastyle.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ th {
163163
#logo>span>img {
164164
max-height: 40px;
165165
max-width: 40px;
166-
padding: 16px 8px 8px 16px;
166+
margin: 16px 8px 8px 16px;
167167
cursor: pointer;
168168
}
169169

@@ -1011,4 +1011,4 @@ footer .socials {
10111011

10121012
.breadcrumbs a:first-child {
10131013
margin: 0 8px 0 0;
1014-
}
1014+
}

scaladoc/src/dotty/tools/scaladoc/SourceLinks.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ case class TemplateSourceLink(val urlTemplate: String) extends SourceLink:
3737
case class WebBasedSourceLink(prefix: String, revision: String, subPath: String) extends SourceLink:
3838
override val path: Option[Path] = None
3939
override def render(memberName: String, path: Path, operation: String, line: Option[Int]): String =
40-
val action = if operation == "view" then "blob" else operation
40+
val (action, revisionOrMaster) = if operation == "view" then ("blob", revision) else (operation, "master")
4141
val linePart = line.fold("")(l => s"#L$l")
42-
s"$prefix/$action/$revision$subPath/${pathToString(path)}$linePart"
42+
s"$prefix/$action/$revisionOrMaster$subPath/${pathToString(path)}$linePart"
4343

4444
class SourceLinkParser(revision: Option[String]) extends ArgParser[SourceLink]:
4545
val KnownProvider = raw"(\w+):\/\/([^\/#]+)\/([^\/#]+)(\/[^\/#]+)?(#.+)?".r

scaladoc/src/dotty/tools/scaladoc/renderers/Locations.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ trait Locations(using ctx: DocContext):
2626
cache.get(dri) match
2727
case null =>
2828
val path = dri match
29-
case `docsDRI` => List("docs", "index")
30-
case `docsRootDRI` => List("index")
29+
case `docsRootDRI` => List("docs", "index")
3130
case `apiPageDRI` => List("api", "index")
3231
case dri if dri.isStaticFile =>
3332
Paths.get(dri.location).iterator.asScala.map(_.toString).toList
3433
case dri =>
3534
val loc = dri.location
3635
val fqn = loc.split(Array('.')).toList match
37-
case "<empty>" :: Nil => "_empty_" :: Nil
36+
case "<empty>" :: Nil => "_empty_" :: Nil
3837
case "<empty>" :: tail => "_empty_" :: tail
3938
case other => other
4039

scaladoc/src/dotty/tools/scaladoc/renderers/Writer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ trait Writer(using ctx: DocContext) extends Locations:
3333

3434
def copy(from: InputStream, to: String): String =
3535
Files.copy(from, dest(to))
36-
to
36+
to

scaladoc/src/dotty/tools/scaladoc/site/common.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import com.vladsch.flexmark.ext.wikilink.WikiLinkExtension
1717

1818
import scala.collection.JavaConverters._
1919

20-
val docsRootDRI: DRI = DRI(location = "index.md")
21-
val docsDRI: DRI = DRI(location = "docs/index.md")
20+
val docsRootDRI: DRI = DRI(location = "docs", symbolUUID = staticFileSymbolUUID)
2221
val apiPageDRI: DRI = DRI(location = "api")
2322

2423
val defaultMarkdownOptions: DataHolder =

scaladoc/src/dotty/tools/scaladoc/site/templates.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ case class TemplateFile(
106106
layoutTemplate match
107107
case None => ResolvedPage(code, resources ++ ctx.resources)
108108
case Some(layoutTemplate) =>
109-
layoutTemplate.resolveInner(ctx.nest(code, file, resources))
109+
layoutTemplate.resolveInner(ctx.nest(code, file, resources))

0 commit comments

Comments
 (0)