Skip to content

Commit 3f6efd9

Browse files
authored
Merge pull request #10290 from BarkingBad/blogposts
Fix handling interpolated properties
2 parents d8fc06c + 59ef0f6 commit 3f6efd9

15 files changed

+119
-56
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
---
2+
layout: doc-page
3+
title: "Import Implied"
4+
---
5+
16
The contents of this page have [moved](./given-imports.md).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
---
2+
layout: doc-page
3+
title: "Inferable-By-Name Parameters"
4+
---
5+
16
The contents of this page have [moved](./by-name-context-parameters.md).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
---
2+
layout: doc-page
3+
title: "Inferable Params"
4+
---
5+
16
The contents of this page have [moved](./using-clauses.md).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
---
2+
layout: doc-page
3+
title: "Givens"
4+
---
5+
16
The contents of this page have [moved](./givens.md).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
---
2+
layout: doc-page
3+
title: "Query Types Spec"
4+
---
5+
16
The contents of this page have [moved](./context-functions-spec.md).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
---
2+
layout: doc-page
3+
title: "Query Types"
4+
---
5+
16
The contents of this page have [moved](./context-functions.md).

scala3doc/src/dotty/dokka/compat.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ def JList[T](e: T*): JList[T] = e.asJava
2222
def JSet[T](e: T*): JSet[T] = e.toSet.asJava
2323
def JMap[K, V](e: (K, V)*): JMap[K, V] = e.toMap.asJava
2424
def JMap2[K, V](): JMap[K, V] = ??? // e.toMap.asJava
25+
def newHMap[K, V](m: JMap[K, V]): HMap[K, V] = new HMap[K, V](m)
2526

2627
type JList[T] = java.util.List[T]
2728
type JSet[T] = java.util.Set[T]
2829
type JMap[K, V] = java.util.Map[K, V]
30+
type HMap[K, V] = java.util.HashMap[K, V]
2931

3032
type SourceSetWrapper = DokkaConfiguration$DokkaSourceSet
3133
type DokkaSourceSet = DokkaConfiguration.DokkaSourceSet

scala3doc/src/dotty/dokka/site/SidebarParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ object Sidebar:
3232
val mapper = ObjectMapper(YAMLFactory())
3333
val raw = mapper.readValue(content, RawTypeRef)
3434

35-
raw.get("sidebar").asScala.toList.map(toSidebar)
35+
raw.get("sidebar").asScala.toList.map(toSidebar)

scala3doc/src/dotty/dokka/site/StaticPageNode.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ case class StaticPageNode(
2222
) extends ContentPage:
2323
override def getDocumentable: Documentable = null
2424

25-
def title(): String = template.title()
26-
def hasFrame(): Boolean = template.hasFrame()
25+
def title(): String = template.title
26+
def hasFrame(): Boolean = template.hasFrame
2727

2828
override def modified(
2929
name: String,
@@ -38,4 +38,4 @@ case class StaticPageNode(
3838

3939
def resources(): List[String] = getContent match
4040
case p: PartiallyRenderedContent => p.resolved.resources
41-
case _ => Nil
41+
case _ => Nil

scala3doc/src/dotty/dokka/site/StaticSiteContext.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class StaticSiteContext(val root: File, sourceSets: Set[SourceSetWrapper]):
3232
lazy val layouts: Map[String, TemplateFile] =
3333
val layoutRoot = new File(root, "_layouts")
3434
val dirs: Array[File] = Option(layoutRoot.listFiles()).getOrElse(Array())
35-
dirs.map { it => loadTemplateFile(it) }.map { it => it.name() -> it }.toMap
35+
dirs.map { it => loadTemplateFile(it) }.map { it => it.name -> it }.toMap
3636

3737
lazy val sideBarConfig =
3838
val sidebarFile = root.toPath.resolve("sidebar.yml")
@@ -82,7 +82,7 @@ class StaticSiteContext(val root: File, sourceSets: Set[SourceSetWrapper]):
8282
def loadIndexPage(): TemplateFile =
8383
val indexFiles = from.listFiles { file =>file.getName == "index.md" || file.getName == "index.html" }
8484
indexFiles.size match
85-
case 0 => emptyTemplate(from)
85+
case 0 => emptyTemplate(from, from.getName)
8686
case 1 => loadTemplateFile(indexFiles.head).copy(file = from)
8787
case _ =>
8888
val msg = s"ERROR: Multiple index pages found under ${from.toPath}"
@@ -111,11 +111,11 @@ class StaticSiteContext(val root: File, sourceSets: Set[SourceSetWrapper]):
111111
val path = if isBlog then "blog" else url.stripSuffix(".html") + ".md"
112112
val file = root.toPath.resolve(path) // Add support for .html files!
113113
val LoadedTemplate(template, children, tFile) = loadTemplate(file.toFile, isBlog).get // Add proper logging if file does not exisits
114-
LoadedTemplate(template.copy(settings = template.settings + ("title" -> List(title))), children, tFile)
114+
LoadedTemplate(template.copy(settings = template.settings + ("title" -> title)), children, tFile)
115115
case Sidebar.Category(title, nested) =>
116116
// Add support for index.html/index.md files!
117117
val fakeFile = new File(root, title)
118-
LoadedTemplate(emptyTemplate(fakeFile), nested.map(loadSidebarContent), fakeFile)
118+
LoadedTemplate(emptyTemplate(fakeFile, title), nested.map(loadSidebarContent), fakeFile)
119119

120120
private def loadAllFiles() =
121121
def dir(name: String)= List(new File(root, name)).filter(_.isDirectory)
@@ -141,9 +141,9 @@ class StaticSiteContext(val root: File, sourceSets: Set[SourceSetWrapper]):
141141
)
142142
StaticPageNode(
143143
myTemplate.templateFile,
144-
myTemplate.templateFile.title(),
144+
myTemplate.templateFile.title,
145145
content,
146146
JSet(dri),
147147
JList(),
148148
(myTemplate.children.map(templateToPage)).asJava
149-
)
149+
)

0 commit comments

Comments
 (0)