diff --git a/doc-tool/resources/_includes/toolbar.html b/doc-tool/resources/_includes/toolbar.html index cf19bbbab0c5..a2d3c1487501 100644 --- a/doc-tool/resources/_includes/toolbar.html +++ b/doc-tool/resources/_includes/toolbar.html @@ -3,7 +3,7 @@ {% include "scala-logo.svg" %}
-

{{ site.project }} Documentation

+

{{ site.project }} Documentation

{{ site.version }}

diff --git a/doc-tool/resources/_layouts/doc-page.html b/doc-tool/resources/_layouts/doc-page.html index 051ac9540fc9..c1d15a8fdd10 100644 --- a/doc-tool/resources/_layouts/doc-page.html +++ b/doc-tool/resources/_layouts/doc-page.html @@ -13,6 +13,9 @@ {% include "sidebar" %}
+ + Edit this page on GitHub +

{{ page.title }}


diff --git a/doc-tool/resources/_layouts/search.html b/doc-tool/resources/_layouts/search.html index a9001dde4f3f..703e47b799fd 100644 --- a/doc-tool/resources/_layouts/search.html +++ b/doc-tool/resources/_layouts/search.html @@ -147,14 +147,18 @@

Member Results

var paramLists = !member.paramLists ? "" : ( member.paramLists .map(renderParamList) - .reduce(concatenateStrings, "") + .reduce(concatenateStrings, "") + ': ' + ); + + var returnValue = !member.returnValue ? "" : ( + member.returnValue ); div.innerHTML = '
'+ member.kind +'
' + '
'+ member.name +'
' + - '
' + paramLists + ':
' + - '
'+ member.returnValue +'
' + '
' + paramLists + '
' + + '
'+ returnValue +'
' li.appendChild(div); }; diff --git a/doc-tool/resources/css/dottydoc.css b/doc-tool/resources/css/dottydoc.css index 42864102dd04..dc432fb41f64 100644 --- a/doc-tool/resources/css/dottydoc.css +++ b/doc-tool/resources/css/dottydoc.css @@ -1,4 +1,5 @@ @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700); +@import url(https://fonts.googleapis.com/css?family=Titillium+Web:200,300,400,600); @import url(https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700); html, body { @@ -34,6 +35,24 @@ div#content-wrapper div#content-body { transition: all .25s ease-out; } +div#content-body > a#edit-on-github { + border-left: 1px solid #fff; + position: absolute; + top: 47px; + padding-left: 10px; + right: 250px; + font-size: 14px; + color: #373a3c; + font-family: "Titillium Web", sans-serif; + text-transform: uppercase; +} + +div#content-body > a#edit-on-github:hover, +div#content-body > a#edit-on-github:focus { + text-decoration: none; + border-left: 1px solid #0fa00f; +} + div#content-wrapper button#menu-toggle { background: rgba(244, 243, 244, 0.4) none; border: 1px solid transparent; diff --git a/doc-tool/resources/css/search.css b/doc-tool/resources/css/search.css index 1432144acd29..be15f1fd4dd1 100644 --- a/doc-tool/resources/css/search.css +++ b/doc-tool/resources/css/search.css @@ -127,14 +127,27 @@ div.results li.entity-result-li:hover { } div.results li.entity-result-li > div.member-result { + overflow: hidden; padding-top: 3px; display: block; - width: 100%; - min-height: 30px; + width: calc(100% - 105px); + margin-bottom: 10px; transition: all 0.2s ease; margin-left: 105px; } +div.results li.entity-result-li:hover > div.member-result { + width: calc(100% - 65px); +} + +div.results li.entity-result-li.with-companion:hover > div.member-result { + width: calc(100% - 23px); +} + +div.results li.entity-result-li:not(.with-companion) > div.member-result { + margin-left: 65px; +} + div.results li.entity-result-li:hover > div.member-result { margin-left: 23px; } @@ -144,8 +157,11 @@ div.results li.entity-result-li > div.member-result > div.member-kind { font-weight: 400; } +div.results li.entity-result-li > div.member-result > div.member-param-lists { + margin-right: 5px; +} + div.results li.entity-result-li > div.member-result > div.member-return { - margin-left: 5px; font-weight: 400; white-space: nowrap; } diff --git a/doc-tool/resources/css/toolbar.css b/doc-tool/resources/css/toolbar.css index 61637e46d075..995427ce6a2a 100644 --- a/doc-tool/resources/css/toolbar.css +++ b/doc-tool/resources/css/toolbar.css @@ -48,21 +48,31 @@ div#toolbar > div#project-details:before { } div#toolbar > div#project-details > h1#project-name { - font-size: 20px; - font-weight: 300; - margin-bottom: 3px; + font-size: 20px; + font-weight: 300; + margin-bottom: 3px; +} + +div#toolbar > div#project-details > h1#project-name > a { + color: #fff; +} + +div#toolbar > div#project-details > h1#project-name > a:hover, +div#toolbar > div#project-details > h1#project-name > a:focus { + text-decoration: none; + color: rgba(255, 255, 255, 0.8); } div#toolbar > div#project-details > h2#project-version { - font-size: 12px; - font-weight: 200; - margin-left: 1px; + font-size: 12px; + font-weight: 200; + margin-left: 1px; } div#toolbar > a#github-link { - color: #fff; - position: absolute; - top: 7px; - right: 15px; - font-size: 40px; + color: #fff; + position: absolute; + top: 7px; + right: 15px; + font-size: 40px; } diff --git a/doc-tool/src/dotty/tools/dottydoc/model/references.scala b/doc-tool/src/dotty/tools/dottydoc/model/references.scala index f111842641c9..a1241cf53305 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/references.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/references.scala @@ -51,7 +51,7 @@ object references { if (args.isEmpty) "() => " + ret.showReference else if (args.tail.isEmpty) - args.head + " => " + ret.showReference + args.head.showReference + " => " + ret.showReference else args.mkString("(", ",", s") => ${ret.showReference}") diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala index 5307416cd811..4ddd2449a010 100644 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala +++ b/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala @@ -39,7 +39,8 @@ case class DefaultParams( "posts" -> site.posts.map(_.toMap), "project" -> site.projectTitle, "version" -> site.projectVersion, - "projectUrl" -> site.projectUrl + "projectUrl" -> site.projectUrl, + "root" -> site.root ).asJava, "sidebar" -> sidebar.titles.asJava @@ -55,7 +56,7 @@ case class DefaultParams( def withPosts(posts: Array[BlogPost]): DefaultParams = copy(site = SiteInfo( - site.baseurl, site.projectTitle, site.projectVersion, site.projectUrl, posts)) + site.baseurl, site.projectTitle, site.projectVersion, site.projectUrl, posts, site.root)) def withUrl(url: String): DefaultParams = copy(page = PageInfo(url)) @@ -74,7 +75,8 @@ case class SiteInfo( projectTitle: String, projectVersion: String, projectUrl: String, - posts: Array[BlogPost] + posts: Array[BlogPost], + root: String ) case class Sidebar(titles: List[Title]) diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala index 2f1756783c54..0f273f5c9f09 100644 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala +++ b/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala @@ -172,7 +172,10 @@ case class Site( DefaultParams( docs, docsFlattened, documentation, PageInfo(pathFromRoot), - SiteInfo(baseUrl, projectTitle, projectVersion, projectUrl, Array()), + SiteInfo( + baseUrl, projectTitle, projectVersion, projectUrl, Array(), + root.toString + ), sidebar ) } @@ -290,7 +293,7 @@ case class Site( * // given that root is: /some/root * ``` */ - def stripRoot(f: JFile): String = { + def stripRoot(f: JFile, root: JFile = root): String = { val rootLen = root.getAbsolutePath.length + 1 f.getAbsolutePath.drop(rootLen) } diff --git a/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala b/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala index db54c94cb3e0..7c08c98ccfbe 100644 --- a/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala +++ b/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala @@ -78,8 +78,8 @@ class SiteTests extends DottyDocTest with SourceFileOps { } @Test def siteStructure = { - val assets = site.staticAssets.map(site.stripRoot).toSet - val compd = site.compilableFiles.map(site.stripRoot).toSet + val assets = site.staticAssets.map(site.stripRoot(_)).toSet + val compd = site.compilableFiles.map(site.stripRoot(_)).toSet val expectedAssets = Set( "css/toolbar.css", diff --git a/docs/sidebar.yml b/docs/sidebar.yml index 75ccf28fb2bf..90e950134636 100644 --- a/docs/sidebar.yml +++ b/docs/sidebar.yml @@ -1,8 +1,6 @@ sidebar: - title: Blog url: blog/index.html - - title: Docs - url: docs/index.html - title: Usage subsection: - title: cbt-projects @@ -54,4 +52,4 @@ sidebar: - title: Resources subsection: - title: Talks - url: docs/resources/talks.html \ No newline at end of file + url: docs/resources/talks.html