Skip to content

Fixes that should go into #13130 #13170

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 1 commit into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
BooleanSetting("-Ygenerate-inkuire", "Generates InkuireDB and enables Hoogle-like searches", false)

val apiSubdirectory: Setting[Boolean] =
BooleanSetting("-Yapi-subdirectory", "Keep all api member inside `api` directory", false)
BooleanSetting("-Yapi-subdirectory", "Put the API documentation pages inside a directory `api/`", false)

def scaladocSpecificSettings: Set[Setting[_]] =
Set(sourceLinks, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent, snippetCompiler, snippetCompilerDebug, generateInkuire)
11 changes: 6 additions & 5 deletions scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ class HtmlRenderer(rootPackage: Member, val members: Map[DRI, Member])(using ctx
children = Nil
))
case Some(siteContext) =>
// In case that we do not have an index page and we do not have any API entries
// In case that we do not have an index page and we do not have any API entries
// we want to create empty index page, so there is one
val actualIndexTemplate = siteContext.indexTemplates() match
case Nil if effectiveMembers.isEmpty => Seq(siteContext.emptyIndexTemplate)
case templates => templates
val actualIndexTemplate = siteContext.indexTemplate() match {
case None if effectiveMembers.isEmpty => Seq(siteContext.emptyIndexTemplate)
case templates => templates.toSeq
}

(siteContext.orphanedTemplates ++ actualIndexTemplate).map(templateToPage(_, siteContext))
(siteContext.orphanedTemplates ++ actualIndexTemplate).map(templateToPage(_, siteContext))

/**
* Here we have to retrive index pages from hidden pages and replace fake index pages in navigable page tree.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ class StaticSiteContext(
if files.size > 1 then
val msg = s"ERROR: Multiple root index pages found: ${files.map(_.getAbsolutePath)}"
report.error(msg)
files

files.headOption

def hasIndexFile = indexFiles.nonEmpty

def emptyIndexTemplate =
val fakeFile = new File(root, "index.html")
LoadedTemplate(emptyTemplate(fakeFile, "index"), List.empty, fakeFile)

def indexTemplates(): Seq[LoadedTemplate] = indexFiles.flatMap(loadTemplate(_, isBlog = false))
def indexTemplate(): Option[LoadedTemplate] =
indexFiles.flatMap(loadTemplate(_, isBlog = false))

lazy val layouts: Map[String, TemplateFile] =
val layoutRoot = new File(root, "_layouts")
Expand Down