diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-01-24 17:33:27 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-01-31 14:32:41 +0100 |
commit | e59241a2852eab53bdc0e22ea5b2dd394b231913 (patch) | |
tree | 34cefdccf17b9fd32af7dee25ba5e987f5ad6515 /doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala | |
parent | 269c24b92a2cf15e90344430291b74ee30441d3a (diff) | |
download | dotty-e59241a2852eab53bdc0e22ea5b2dd394b231913.tar.gz dotty-e59241a2852eab53bdc0e22ea5b2dd394b231913.tar.bz2 dotty-e59241a2852eab53bdc0e22ea5b2dd394b231913.zip |
Allow links in static site to reference API entities
Diffstat (limited to 'doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala')
-rw-r--r-- | doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala index de16293a1..ace52725d 100644 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala +++ b/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala @@ -85,7 +85,7 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma val fileContents = Source.fromFile(file).mkString val params = defaultParams(file, 2).withUrl(s"/blog/$year/$month/$day/$name.html").toMap val page = - if (ext == "md") new MarkdownPage(fileContents, params, includes) + if (ext == "md") new MarkdownPage(fileContents, params, includes, documentation) else new HtmlPage(fileContents, params, includes) BlogPost(file, page) } @@ -154,8 +154,8 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma else (".html", 0) val target = mkdirs(fs.getPath(outDir.getAbsolutePath + "/api/" + e.path.mkString("/") + suffix)) - val params = defaultParams(target.toFile, -1).withPosts(blogInfo).withEntity(e) - val page = new HtmlPage(layouts("api-page"), params.toMap, includes) + val params = defaultParams(target.toFile, -1).withPosts(blogInfo).withEntity(e).toMap + val page = new HtmlPage(layouts("api-page"), params, includes) val rendered = render(page) val source = new ByteArrayInputStream(rendered.getBytes(StandardCharsets.UTF_8)) @@ -180,7 +180,7 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma val fileContents = Source.fromFile(asset).mkString val params = defaultParams(asset).withPosts(blogInfo).toMap val page = - if (asset.getName.endsWith(".md")) new MarkdownPage(fileContents, params, includes) + if (asset.getName.endsWith(".md")) new MarkdownPage(fileContents, params, includes, documentation) else new HtmlPage(fileContents, params, includes) val renderedPage = render(page) @@ -199,7 +199,7 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma val date = s"$year-$month-$day 00:00:00" val params = defaultParams(file, 2).withPosts(blogInfo).withDate(date).toMap val page = - if (ext == "md") new MarkdownPage(fileContents, params, includes) + if (ext == "md") new MarkdownPage(fileContents, params, includes, documentation) else new HtmlPage(fileContents, params, includes) |