diff --git a/CONTRIBUTING.md b/CONTRIBUTING similarity index 100% rename from CONTRIBUTING.md rename to CONTRIBUTING diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index ca7f9773463c..b0cdb71843ae 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -123,5 +123,12 @@ class ScalaSettings extends Settings.SettingGroup { sys.props("user.dir").split(File.separatorChar).last ) + val projectVersion = StringSetting ( + "-project-version", + "project version", + "The current version of your project", + "" + ) + val wikiSyntax = BooleanSetting("-Xwiki-syntax", "Retains the Scala2 behavior of using Wiki Syntax in Scaladoc") } diff --git a/doc-tool/resources/_includes/scala-logo.svg b/doc-tool/resources/_includes/scala-logo.svg index 88268ccbe113..c0561a17f4e9 100644 --- a/doc-tool/resources/_includes/scala-logo.svg +++ b/doc-tool/resources/_includes/scala-logo.svg @@ -1,4 +1,4 @@ - + diff --git a/doc-tool/resources/_includes/sidebar.html b/doc-tool/resources/_includes/sidebar.html new file mode 100644 index 000000000000..3ebfd44232c9 --- /dev/null +++ b/doc-tool/resources/_includes/sidebar.html @@ -0,0 +1,38 @@ +
+ + + +
diff --git a/doc-tool/resources/_includes/toc.html b/doc-tool/resources/_includes/toc.html deleted file mode 100644 index 15952ef78095..000000000000 --- a/doc-tool/resources/_includes/toc.html +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/doc-tool/resources/_includes/toolbar.html b/doc-tool/resources/_includes/toolbar.html new file mode 100644 index 000000000000..4625e51508ed --- /dev/null +++ b/doc-tool/resources/_includes/toolbar.html @@ -0,0 +1,9 @@ +
+ + {% include "scala-logo.svg" %} + +
+

{{ site.project }} Documentation

+

{{ site.version }}

+
+
diff --git a/doc-tool/resources/_layouts/api-page.html b/doc-tool/resources/_layouts/api-page.html index 2d2f0265a92a..fb2d466b43b1 100644 --- a/doc-tool/resources/_layouts/api-page.html +++ b/doc-tool/resources/_layouts/api-page.html @@ -1,184 +1,196 @@ --- -layout: sidebar +layout: main extraCSS: + - css/sidebar.css + - css/toolbar.css - css/api-page.css --- - - -
-
- - {% for annot in entity.annotations %}@{{ annot | split: '.' | last }} {% endfor %} - - - {{ entity.modifiers | join: " " }} - - - {{ entity.kind }} - - - {{ entity.name }} - - {% if entity.typeParams.size > 0 %} - - [ - {% for param in entity.typeParams %} - - {% if forloop.last %} - {{ param }} - {% else %} - {{ param }}, - {% endif %} - - {% endfor %} - ] - - {% endif %} - {% if entity.superTypes.size > 0 %} -
- {% for super in entity.superTypes %} - {% if forloop.first %} - extends - {% else %} - with - {% endif %} - {% renderLink super %} - {% endfor %} -
- {% endif %} -
+{% include "toolbar" %} - {% if entity.comment.body %} -
- {{ entity.comment.body }} -
- {% endif %} - -

- Constructors -

- -
- {% for constructor in entity.constructors %} - {% for plist in constructor %} -
-
- {{ entity.name }} - ( - {% if plist.isImplicit %} - implicit - {% endif %} - {% for namedRef in plist.list %} - - {{ namedRef.title }}:{% if namedRef.isByName %} =>{% endif %} - - {% renderRef namedRef.ref %} - {% if forloop.last != true %} - , - {% endif %} - {% endfor %} - ) -
-
- {% endfor %} - {% endfor %} -
+
+ {% assign sidebarTop = "75px" %} + {% include "sidebar" %} -

- Members -

- -
- {% for member in entity.members %} -
-
- [+] - - {% for annot in member.annotations %}@{{ annot | split: '.' | last }} {% endfor %} + + +
+
+
+ + {% for annot in entity.annotations %}@{{ annot | split: '.' | last }} {% endfor %} - - {{ member.modifiers | join: " " }} + + {{ entity.modifiers | join: " " }} - - {{ member.kind }} + + {{ entity.kind }} - - {% if member.kind == "class" or member.kind == "case class" or member.kind == "object" or member.kind == "trait" %} - {{ member.name }} - {% elsif member.kind == "package" %} - {{ member.name }} - {% else %} - {{ member.name }} - {% endif %} + + {{ entity.name }} - - {% if member.kind == "def" and member.paramLists.size > 0 %} - {% for plist in member.paramLists %} - ( - {% if plist.isImplicit %} - implicit + {% if entity.typeParams.size > 0 %} + + [ + {% for param in entity.typeParams %} + + {% if forloop.last %} + {{ param }} + {% else %} + {{ param }}, {% endif %} - {% for namedRef in plist.list %} - - {{ namedRef.title }}:{% if namedRef.isByName %} =>{% endif %} - - {% renderRef namedRef.ref %} - {% if forloop.last != true %} - , - {% endif %} - {% endfor %} - ) + {% endfor %} + ] + {% endif %} - - {% if member.kind == "type" %} - {% for tparam in member.typeParams %} + {% if entity.superTypes.size > 0 %} +
+ {% for super in entity.superTypes %} {% if forloop.first %} - [ - {% endif %} - {% if forloop.last %} - {{ tparam }} - ] + extends {% else %} - {{ tparam }}, + with {% endif %} - {% endfor %} - {% if member.alias != null %} - - = - {% renderRef member.alias %} - - {% endif %} + {% renderLink super %} + {% endfor %} +
{% endif %} +
- {% if member.returnValue %} - : {% renderRef member.returnValue %} - {% endif %} -
+ {% if entity.comment.body %} +
+ {{ entity.comment.body }} +
+ {% endif %} -
-
- {{ member.comment.short }} -
-
- {{ member.comment.body }} -
+

+ Constructors +

+ +
+ {% for constructor in entity.constructors %} + {% for plist in constructor %} +
+
+ {{ entity.name }} + ( + {% if plist.isImplicit %} + implicit + {% endif %} + {% for namedRef in plist.list %} + + {{ namedRef.title }}:{% if namedRef.isByName %} =>{% endif %} + + {% renderRef namedRef.ref %} + {% if forloop.last != true %} + , + {% endif %} + {% endfor %} + ) +
+
+ {% endfor %} + {% endfor %} +
+ +

+ Members +

+ +
+ {% for member in entity.members %} +
+
+ [+] + + {% for annot in member.annotations %}@{{ annot | split: '.' | last }} {% endfor %} + + + {{ member.modifiers | join: " " }} + + + {{ member.kind }} + + + {% if member.kind == "class" or member.kind == "case class" or member.kind == "object" or member.kind == "trait" %} + {{ member.name }} + {% elsif member.kind == "package" %} + {{ member.name }} + {% else %} + {{ member.name }} + {% endif %} + + + {% if member.kind == "def" and member.paramLists.size > 0 %} + {% for plist in member.paramLists %} + ( + {% if plist.isImplicit %} + implicit + {% endif %} + {% for namedRef in plist.list %} + + {{ namedRef.title }}:{% if namedRef.isByName %} =>{% endif %} + + {% renderRef namedRef.ref %} + {% if forloop.last != true %} + , + {% endif %} + {% endfor %} + ) + {% endfor %} + {% endif %} + + {% if member.kind == "type" %} + {% for tparam in member.typeParams %} + {% if forloop.first %} + [ + {% endif %} + {% if forloop.last %} + {{ tparam }} + ] + {% else %} + {{ tparam }}, + {% endif %} + {% endfor %} + {% if member.alias != null %} + + = + {% renderRef member.alias %} + + {% endif %} + {% endif %} + + {% if member.returnValue %} + : {% renderRef member.returnValue %} + {% endif %} +
+ +
+
+ {{ member.comment.short }} +
+
+ {{ member.comment.body }} +
+
+ +
+ {% endfor %}
- -
- {% endfor %} +
-
+ +
diff --git a/doc-tool/resources/_layouts/blog-page.html b/doc-tool/resources/_layouts/blog-page.html index b99a16b9c044..568a6e3351cc 100644 --- a/doc-tool/resources/_layouts/blog-page.html +++ b/doc-tool/resources/_layouts/blog-page.html @@ -1,28 +1,41 @@ --- -layout: sidebar +layout: main +extraCSS: + - css/toolbar.css + - css/sidebar.css --- -
-

- {{ page.date | date: '%B %d, %Y' }} -

-

{{ page.title }}

- {% if page.subTitle %} -

{{ page.subTitle }}

- {% endif %} -
+{% include "toolbar" %} -
- {{ content }} -
+
+ {% assign sidebarTop = "75px" %} + {% include "sidebar" %} -{% if page.author %} -
- {% if page.authorImg %} - - {% endif %} - - {% if page.authorImg == null %}- {% endif %}{{ page.author }} - -
-{% endif %} +
+
+

+ {{ page.date | date: '%B %d, %Y' }} +

+

{{ page.title }}

+ {% if page.subTitle %} +

{{ page.subTitle }}

+ {% endif %} +
+ +
+ {{ content }} +
+ + {% if page.author %} +
+ {% if page.authorImg %} + + {% endif %} + + {% if page.authorImg == null %}- {% endif %}{{ page.author }} + +
+ {% endif %} + +
+
diff --git a/doc-tool/resources/_layouts/doc-page.html b/doc-tool/resources/_layouts/doc-page.html index 14220aef7f93..051ac9540fc9 100644 --- a/doc-tool/resources/_layouts/doc-page.html +++ b/doc-tool/resources/_layouts/doc-page.html @@ -1,8 +1,22 @@ --- -layout: sidebar +layout: main +extraCSS: + - css/sidebar.css + - css/toolbar.css + - css/api-page.css --- -

{{ page.title }}

-
- {{ content }} -
+{% include "toolbar" %} + +
+ {% assign sidebarTop = "75px" %} + {% include "sidebar" %} + +
+

{{ page.title }}

+
+
+ {{ content }} +
+
+
diff --git a/doc-tool/resources/_layouts/main.html b/doc-tool/resources/_layouts/main.html index e1bd43ee7873..c1a8f833aa0c 100644 --- a/doc-tool/resources/_layouts/main.html +++ b/doc-tool/resources/_layouts/main.html @@ -7,6 +7,8 @@ {{ page.title }} + + 0) { + window.scrollTo(0, $(window.location.hash).offset().top - 90); + } }); diff --git a/doc-tool/resources/_layouts/sidebar.html b/doc-tool/resources/_layouts/sidebar.html deleted file mode 100644 index 24ed1bed7284..000000000000 --- a/doc-tool/resources/_layouts/sidebar.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -layout: main ---- - -
-
- {% include "toc" %} -
    - {% if docs.size > 0 %} -
  • - API -
  • - {% endif %} - {% for pkg in docs %} -
  • - {{ pkg.name }} -
  • - {% for member in pkg.children %} - {% if member.kind == "object" and member.hasCompanion %} - {% elsif member.kind != "package" %} -
  • -
    - {% if member.hasCompanion %} - O - {% endif %} - {{ member.kind | first | capitalize }} -
    - {{ member.name }} -
  • - {% endif %} - {% endfor %} - {% endfor %} -
-
-
- - {{ content }} -
-
- - - diff --git a/doc-tool/resources/css/api-page.css b/doc-tool/resources/css/api-page.css index 1dd4f559cd97..48a3162bbcc1 100644 --- a/doc-tool/resources/css/api-page.css +++ b/doc-tool/resources/css/api-page.css @@ -55,7 +55,7 @@ div.entity-section { background-color: #fff; border-radius: 4px; margin: 0; - padding: 30px; + padding: 30px 0; } div.entity-section *:last-child { diff --git a/doc-tool/resources/css/dottydoc.css b/doc-tool/resources/css/dottydoc.css index 140f15eba040..a3e33005bc18 100644 --- a/doc-tool/resources/css/dottydoc.css +++ b/doc-tool/resources/css/dottydoc.css @@ -1,5 +1,10 @@ +@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700); +@import url(https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700); + html, body { overflow-x: hidden; + font-family: "Roboto Slab", serif; + font-weight: 300; } html { @@ -13,27 +18,15 @@ body { div#content-wrapper { min-height: 100vh; padding-left: 0; + margin-top: 75px; } div#content-wrapper div#content-body { - background-color: #f4f3f4; - border-left: 1px solid #e0e0e0; - box-shadow: -3px 0 5px -2px rgba(0, 0, 0, 0.14); - padding: 40px 1px 1px 1px; + padding: 20px 1px 1px 1px; position: relative; min-height: 100vh; } -div#content-wrapper div.index-wrapper { - background-color: #fafafa; - position: fixed; - top: 0; - left: 0; - height: 100%; - overflow-y: auto; - overflow-x: hidden; -} - /** Animations: Easing for content body slide on toggle */ div#content-wrapper, div#content-wrapper div#content-body { @@ -42,41 +35,6 @@ div#content-wrapper div#content-body { transition: all .25s ease-out; } -/** Mobile (x < 576px) sidebar: Defaults closed with 60% wide sidebar */ -div#content-wrapper {} -div#content-wrapper div#content-body { left: 0; } -div#content-wrapper div.index-wrapper { width: 60%; } - -div#content-wrapper.toggled {} -div#content-wrapper.toggled div#content-body { left: 60%; } -div#content-wrapper.toggled div.index-wrapper {} - -/** Tablet (576px <= x < 768px) sidebar: Defaults closed with 250px wide sidebar */ -@media screen and (min-width: 576px) { - - div#content-wrapper {} - div#content-wrapper div#content-body {} - div#content-wrapper div.index-wrapper { width: 250px; } - - div#content-wrapper.toggled {} - div#content-wrapper.toggled div#content-body { left: 250px; } - div#content-wrapper.toggled div.index-wrapper {} - -} - -/** Desktop (x >= 768px) sidebar: Defaults open with 250px wide sidebar */ -@media screen and (min-width: 768px) { - - div#content-wrapper { padding-left: 250px; } - div#content-wrapper div#content-body {} - div#content-wrapper div.index-wrapper { width: 250px; } - - div#content-wrapper.toggled { padding-left: 0; } - div#content-wrapper.toggled div#content-body { left: 0; } - div#content-wrapper.toggled div.index-wrapper {} - -} - div#content-wrapper button#menu-toggle { background: rgba(244, 243, 244, 0.4) none; border: 1px solid transparent; @@ -132,6 +90,12 @@ div#entity-container h3 > a, div#entity-container h4 > a, div#entity-container h5 > a, div#entity-container h6 > a, +div#blog-post-container h1 > a, +div#blog-post-container h2 > a, +div#blog-post-container h3 > a, +div#blog-post-container h4 > a, +div#blog-post-container h5 > a, +div#blog-post-container h6 > a, div#doc-page-container > h1 > a, div#doc-page-container > h2 > a, div#doc-page-container > h3 > a, @@ -140,6 +104,8 @@ div#doc-page-container > h5 > a, div#doc-page-container > h6 > a { text-decoration: none; color: #373a3c; + font-family: "Source Sans Pro", sans-serif; + font-weight: 400; } div#entity-container h1 > a:hover, @@ -148,6 +114,12 @@ div#entity-container h3 > a:hover, div#entity-container h4 > a:hover, div#entity-container h5 > a:hover, div#entity-container h6 > a:hover, +div#blog-post-container h1 > a:hover, +div#blog-post-container h2 > a:hover, +div#blog-post-container h3 > a:hover, +div#blog-post-container h4 > a:hover, +div#blog-post-container h5 > a:hover, +div#blog-post-container h6 > a:hover, div#doc-page-container > h1 > a:hover, div#doc-page-container > h2 > a:hover, div#doc-page-container > h3 > a:hover, @@ -172,159 +144,6 @@ div#doc-page-container > h6 > a:focus { outline: none; } -ul.index-entities { - list-style-type: none; - padding-left: 0; -} - -ul.toc { - list-style-type: none; - padding-top: 18px; - padding-left: 0; -} - -ul.toc > li:hover { - background-color: transparent; -} - -ul.toc > li.toc-title { - margin-top: 1rem; -} - -ul.toc > li.toc-title > a { - font-size: 16px; - font-weight: bold; -} - -ul.toc > li > a#home-button, -ul.toc > li > a#home-button:hover { - text-align: center; - background: transparent; -} - -ul.toc > li > a#home-button svg g#logo-foreground { - fill: rgba(202, 68, 94, 1); -} - -ul.toc > li > a#home-button svg g#logo-background { - fill: rgba(202, 68, 94, 0.45); -} - -ul.toc > li > a { - width: 100%; - user-select: none; -} - -ul.toc > li, -ul.index-entities > li { - line-height: 40px; - display: inline-block; - width: 100%; -} - -ul.index-entities > li.index-entity:not(.entity-package) { - width: calc(100% + 40px); - transition: all 0.2s ease; - margin-left: -40px; -} - -ul.index-entities > li.index-entity.with-companion { - width: calc(100% + 80px); - margin-left: -80px; -} - -ul.index-entities > li.index-entity:hover { - margin-left: 0; -} - -ul.toc > li.logo-li > a { - margin: 0; - padding: 0; - float: none; -} - -li.index-entity.entity-package > a.entity-name { - color: #ff4081; - text-decoration: none; -} - -ul.toc > li > a, -ul.index-entities > li > a.entity-name { - font-size: 13px; - display: block; - padding: 0 0 0 24px; - color: rgba(0, 0, 0, 0.87); - background: transparent; - cursor: pointer; - float: left; -} - -ul.index-entities > li > div.entity-kinds { - float: left; -} - -ul.index-entities > li > div.entity-kinds > a.letter-anchor { - float: left; - width: 40px; - height: 40px; - color: white; - display: block; - text-align: center; - text-decoration: none; -} - -ul.index-entities > li > div.entity-kinds > a.letter-anchor:focus, -ul.index-entities > li > div.entity-kinds > a.letter-anchor:hover { - text-decoration: none; -} - -ul.index-entities > li > div.entity-kinds > a.letter-anchor.object { - background-color: rgb(44, 108, 141); -} - -ul.index-entities > li > div.entity-kinds > a.letter-anchor.class { - background-color: rgb(68, 173, 125); -} - -ul.index-entities > li > div.entity-kinds > a.letter-anchor.trait { - background-color: rgb(25, 170, 207); -} - -ul.toc > li > ul.show { - display: block; - list-style-type: none; - font-size: 13px; -} - -ul.toc > li > ul.hide { - display: none; -} - -ul.index-entities > li.index-title > span { - font-size: 16px; - font-weight: bold; - color: rgba(0, 0, 0, 0.87); - padding: 0 24px; -} - -ul.index-entities > li.index-title:hover { - background-color: transparent; -} - -li.index-entity > a:focus { - text-decoration: none; -} - -ul.index-entities > li:hover, -ul.toc > li > a:hover { - background-color: rgba(0, 0, 0, 0.2); -} - -ul.index-entities > li > a:hover, -ul.toc > li > a:hover { - text-decoration: none; -} - .darken { background-color: rgba(0, 0, 0, 0.2); } @@ -332,8 +151,9 @@ ul.toc > li > a:hover { div#post-title, div#post-footer, h1#doc-page-title { - margin-left: 20px; - margin-top: 10px; + margin: 10px 0 40px 10px; + font-family: "Source Sans Pro", sans-serif; + font-weight: 400; } div#post-title > h2#sub-title { @@ -347,13 +167,21 @@ div#post-title > h3#post-date { margin-bottom: 2px; } +div#content-wrapper div#content-body.doc-page-body { + max-width: 1000px; + margin: 0 auto; + padding-right: 250px; /** account for sidebar */ +} + +div#content-body.doc-page-body > hr { + margin-left: 10px; +} + div#blog-post-container, div#doc-page-container { background-color: #fff; padding: 10px; border-radius: 4px; - margin: 20px; - padding: 30px; } div#doc-page-container > p + h1 { @@ -380,7 +208,14 @@ pre { border: 1px solid rgba(0, 0, 0, 0.1); } +p > img { + /** Make sure images adhere to container rules */ + width: 100%; + height: auto; +} + pre > code.language-none, +pre > code.language-shell, pre > code.hljs { display: block; padding: 10px; diff --git a/doc-tool/resources/css/sidebar.css b/doc-tool/resources/css/sidebar.css new file mode 100644 index 000000000000..16566a767c75 --- /dev/null +++ b/doc-tool/resources/css/sidebar.css @@ -0,0 +1,222 @@ +@import url(https://fonts.googleapis.com/css?family=Titillium+Web:200,300,400,600); + +div#content-wrapper div.index-wrapper { + position: fixed; + top: 0; + left: 0; + height: 100%; + overflow-y: auto; + overflow-x: hidden; + font-family: "Titillium Web", sans-serif; + font-weight: 200; + padding-left: 14px; +} + +/** Mobile (x < 576px) sidebar: Defaults closed with 60% wide sidebar */ +div#content-wrapper div#content-body { left: 0; } +div#content-wrapper div.index-wrapper { width: 60%; } + +div#content-wrapper.toggled div#content-body { left: 60%; } +div#content-wrapper.toggled div.index-wrapper {} + +ul.index-entities { + list-style-type: none; + padding-left: 0; +} + +ul.toc { + list-style-type: none; + padding-top: 18px; + padding-left: 0; +} + +ul.toc > li:hover { + background-color: transparent; +} + +ul.toc > li.toc-title { + margin-top: 1rem; +} + +ul.toc > li.toc-title > a { + font-size: 16px; + font-weight: bold; +} + +ul.toc > li > a#home-button, +ul.toc > li > a#home-button:hover { + text-align: center; + background: transparent; +} + +ul.toc > li, +ul.index-entities > li { + line-height: 40px; + display: inline-block; + width: 100%; + border-left: 1px solid #fff; +} + +ul.toc > li.logo-li > a { + margin: 0; + padding: 0; + float: none; +} + +ul.toc > li > a { + font-size: 13px; + display: block; + padding: 0 0 0 24px; + width: 100%; + color: rgba(0, 0, 0, 0.87); + background: transparent; + cursor: pointer; + float: left; + text-transform: uppercase; +} + +ul.toc > li > ul.show { + display: block; + list-style-type: none; + font-size: 13px; +} + +ul.toc > li > ul.hide { + display: none; +} + +ul.index-entities > li.index-title > span { + font-size: 16px; + font-weight: bold; + color: rgba(0, 0, 0, 0.87); + padding: 0 24px; + text-transform: uppercase; +} + +ul.index-entities > li.index-title:hover { + background-color: transparent; +} + +li.index-entity > a:focus { + text-decoration: none; +} + +ul.toc > li > a:hover { + text-decoration: none; +} + +ul.toc > li:hover { + border-left: 1px solid #0fa00f; +} + +li.index-entity.entity-package:hover { + background: transparent; +} + +li.entity-package > h1 > a.entity-name { + color: #ff4081; + text-decoration: none; + font-size: 13px; + font-weight: 300; + padding-left: 24px; +} + +li.entity-package > ul.package-entities { + list-style-type: none; + border-left: 2px solid gray; + margin-left: 24px; + padding-left: 12px; +} + +li.entity-package > ul.package-entities > li { + margin-left: -52px; + transition: all 0.2s ease; +} + +li.entity-package > ul.package-entities > li.with-companion { + margin-left: -92px; +} + +li.entity-package > ul.package-entities > li:hover { + margin-left: -12px; +} + +li.entity-package > ul.package-entities > li > a.entity-name { + color: rgba(0, 0, 0, 0.87); + cursor: pointer; + font-size: 13px; +} + +ul.package-entities { + position: relative; +} +ul.package-entities > li > div.entity-kinds { + float: left; + margin-right: 12px; +} + +ul.package-entities > li > div.entity-kinds > a.letter-anchor { + float: left; + width: 40px; + height: 40px; + color: white; + display: block; + text-align: center; + text-decoration: none; +} + +ul.package-entities > li > a.entity-name:focus, +ul.package-entities > li > a.entity-name:hover, +ul.package-entities > li > div.entity-kinds > a.letter-anchor:focus, +ul.package-entities > li > div.entity-kinds > a.letter-anchor:hover { + text-decoration: none; +} + +ul.package-entities > li > div.entity-kinds > a.letter-anchor.object { + background-color: rgb(44, 108, 141); +} + +ul.package-entities > li > div.entity-kinds > a.letter-anchor.class { + background-color: rgb(68, 173, 125); +} + +ul.package-entities > li > div.entity-kinds > a.letter-anchor.trait { + background-color: rgb(25, 170, 207); +} + +/** Cover block used to hide where the kind blocks come from */ +div#cover-block { + position: absolute; + background: #fafafa; + border-right: 2px solid gray; + width: 40px; + height: 100%; + left: -40px; + top: 0; +} + +/** Tablet (576px <= x < 768px) sidebar: Defaults closed with 250px wide sidebar */ +@media screen and (min-width: 576px) and (max-width: 899px) { + div#content-wrapper {} + div#content-wrapper div#content-body {} + div#content-wrapper div#content-body.doc-page-body { padding-right: 0; } + div#content-wrapper div.index-wrapper { display: none; } + + div#content-wrapper.toggled {} + div#content-wrapper.toggled div#content-body { left: 250px; } + div#content-wrapper.toggled div.index-wrapper {} +} + +/** Desktop (x >= 768px) sidebar: Defaults open with 250px wide sidebar */ +@media screen and (min-width: 900px) { + div#content-wrapper { padding-left: 250px; } + div#content-wrapper div#content-body {} + div#content-wrapper div.index-wrapper { + width: 250px; + display: block; + } + + div#content-wrapper.toggled { padding-left: 0; } + div#content-wrapper.toggled div#content-body { left: 0; } + div#content-wrapper.toggled div.index-wrapper {} +} diff --git a/doc-tool/resources/css/toolbar.css b/doc-tool/resources/css/toolbar.css new file mode 100644 index 000000000000..5327bf890411 --- /dev/null +++ b/doc-tool/resources/css/toolbar.css @@ -0,0 +1,56 @@ +@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700); + +div#toolbar { + height: 75px; + width: 100%; + background-color: #4c5264; + position: fixed; + top: 0; left: 0; + z-index: 2; +} + +div#toolbar > a#home-button svg g#logo-foreground { + fill: rgba(202, 68, 94, 1); +} + +div#toolbar > a#home-button svg g#logo-background { + fill: rgba(202, 68, 94, 0.45); +} + +div#toolbar > a#home-button { + margin: 9px 0 0 38px; + user-select: none; + float: left; +} + +div#toolbar > div#project-details { + float: left; + color: #fff; + font-family: "Source Sans Pro", sans-serif; + margin: 18px 0 0 40px; + padding-left: 10px; +} + +div#toolbar > div#project-details:before { + display: block; + content: ''; + position: absolute; + top: 22px; + left: 95px; + width: 1px; + bottom: 20px; + background-color: #767e94; +} + +div#toolbar > div#project-details > h1#project-name { + font-size: 20px; + font-weight: 300; + margin-bottom: 3px; +} + +div#toolbar > div#project-details > h2#project-version { + font-size: 12px; + font-weight: 200; + margin-left: 1px; +} + diff --git a/doc-tool/src/dotty/tools/dottydoc/DocDriver.scala b/doc-tool/src/dotty/tools/dottydoc/DocDriver.scala index 1434d5a49f9f..9e26e8da68e4 100644 --- a/doc-tool/src/dotty/tools/dottydoc/DocDriver.scala +++ b/doc-tool/src/dotty/tools/dottydoc/DocDriver.scala @@ -45,11 +45,12 @@ class DocDriver extends Driver { val reporter = doCompile(newCompiler(ctx), filesToDocument)(ctx) val siteRoot = new java.io.File(ctx.settings.siteRoot.value) val projectName = ctx.settings.projectName.value + val projectVersion = ctx.settings.projectVersion.value if (!siteRoot.exists || !siteRoot.isDirectory) ctx.error(s"Site root does not exist: $siteRoot") else { - Site(siteRoot, projectName, ctx.docbase.packages) + Site(siteRoot, projectName, projectVersion, ctx.docbase.packages) .generateApiDocs() .copyStaticFiles() .generateHtmlFiles() diff --git a/doc-tool/src/dotty/tools/dottydoc/core/DocASTPhase.scala b/doc-tool/src/dotty/tools/dottydoc/core/DocASTPhase.scala index ad8981ea21df..6957697f823a 100644 --- a/doc-tool/src/dotty/tools/dottydoc/core/DocASTPhase.scala +++ b/doc-tool/src/dotty/tools/dottydoc/core/DocASTPhase.scala @@ -82,7 +82,8 @@ class DocASTPhase extends Phase { } - tree match { + if (tree.symbol.is(Flags.Synthetic) && !tree.symbol.is(Flags.Module)) NonEntity + else tree match { /** package */ case pd @ PackageDef(pid, st) => addPackage(PackageImpl(pd.symbol, annotations(pd.symbol), pd.symbol.showFullName, collectEntityMembers(st), path(pd.symbol))) diff --git a/doc-tool/src/dotty/tools/dottydoc/model/internal.scala b/doc-tool/src/dotty/tools/dottydoc/model/internal.scala index b50c93ee56be..61c26936a742 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/internal.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/internal.scala @@ -86,13 +86,15 @@ object internal { annotations: List[String], name: String, members: List[Entity], - modifiers: List[String], + private val mods: List[String], path: List[String], superTypes: List[MaterializableLink] = Nil, var comment: Option[Comment] = None, var companionPath: List[String] = Nil, var parent: Entity = NonEntity - ) extends Object + ) extends Object { + def modifiers: List[String] = mods.filterNot(_ == "final") + } final case class DefImpl( symbol: Symbol, diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala index a53f6f0d4cc4..f0ab5341ed4b 100644 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala +++ b/doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala @@ -32,7 +32,8 @@ case class DefaultParams( "site" -> Map( "baseurl" -> site.baseurl, "posts" -> site.posts.map(_.toMap), - "project" -> site.projectTitle + "project" -> site.projectTitle, + "version" -> site.projectVersion ).asJava, "sidebar" -> sidebar.titles.asJava @@ -47,7 +48,7 @@ case class DefaultParams( } def withPosts(posts: Array[BlogPost]): DefaultParams = - copy(site = SiteInfo(site.baseurl, site.projectTitle, posts)) + copy(site = SiteInfo(site.baseurl, site.projectTitle, site.projectVersion, posts)) def withUrl(url: String): DefaultParams = copy(page = PageInfo(url)) @@ -61,7 +62,12 @@ case class PageInfo(url: String, date: String = "") { val path: Array[String] = url.split('/').reverse.drop(1) } -case class SiteInfo(baseurl: String, projectTitle: String, posts: Array[BlogPost]) +case class SiteInfo( + baseurl: String, + projectTitle: String, + projectVersion: String, + posts: Array[BlogPost] +) 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 d325b514c7c5..dc3a4c0b825a 100644 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala +++ b/doc-tool/src/dotty/tools/dottydoc/staticsite/Site.scala @@ -28,7 +28,7 @@ import io.{ AbstractFile, VirtualFile, File } import scala.collection.mutable.ArrayBuffer import util.syntax._ -case class Site(val root: JFile, val projectTitle: String, val documentation: Map[String, Package]) extends ResourceFinder { +case class Site(val root: JFile, val projectTitle: String, val projectVersion: String, val documentation: Map[String, Package]) extends ResourceFinder { /** Documentation serialized to java maps */ private val docs: JList[_] = { import model.JavaConverters._ @@ -127,6 +127,8 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma // Copy statics included in resources Map( + "css/toolbar.css" -> "/css/toolbar.css", + "css/sidebar.css" -> "/css/sidebar.css", "css/api-page.css" -> "/css/api-page.css", "css/dottydoc.css" -> "/css/dottydoc.css", "css/color-brewer.css" -> "/css/color-brewer.css", @@ -155,7 +157,7 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma "../" * (assetLen - rootLen - 1 + additionalDepth) + "." } - DefaultParams(docs, documentation, PageInfo(pathFromRoot), SiteInfo(baseUrl, projectTitle, Array()), sidebar) + DefaultParams(docs, documentation, PageInfo(pathFromRoot), SiteInfo(baseUrl, projectTitle, projectVersion, Array()), sidebar) } /* Creates output directories if allowed */ @@ -326,7 +328,6 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma val defaultLayouts: Map[String, Layout] = Map( "main" -> "/_layouts/main.html", - "sidebar" -> "/_layouts/sidebar.html", "doc-page" -> "/_layouts/doc-page.html", "api-page" -> "/_layouts/api-page.html", "blog-page" -> "/_layouts/blog-page.html", @@ -364,7 +365,8 @@ case class Site(val root: JFile, val projectTitle: String, val documentation: Ma val defaultIncludes: Map[String, Include] = Map( "header.html" -> "/_includes/header.html", "scala-logo.svg" -> "/_includes/scala-logo.svg", - "toc.html" -> "/_includes/toc.html" + "toolbar.html" -> "/_includes/toolbar.html", + "sidebar.html" -> "/_includes/sidebar.html" ).map { case (name, path) => (name, Include(path, stringToSourceFile(name, path, getResource(path)))) diff --git a/doc-tool/test/SourceFileOps.scala b/doc-tool/test/SourceFileOps.scala index 37520921d5ae..81ea4eaf03a9 100644 --- a/doc-tool/test/SourceFileOps.scala +++ b/doc-tool/test/SourceFileOps.scala @@ -11,7 +11,7 @@ import model.Package trait SourceFileOps { import scala.collection.JavaConverters._ - val site = new Site(new java.io.File("../doc-tool/resources/"), "test-site", Map.empty) + val site = new Site(new java.io.File("../doc-tool/resources/"), "test-site", "v0.1", Map.empty) def stringToSource(path: String, sourceCode: String): SourceFile = { val virtualFile = new VirtualFile(path, path) diff --git a/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala b/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala index 54d7cf9903b0..f0e5538dcfba 100644 --- a/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala +++ b/doc-tool/test/dotty/tools/dottydoc/staticsite/SiteTests.scala @@ -10,7 +10,7 @@ class SiteTests extends DottyDocTest with SourceFileOps { assert(site.root.exists && site.root.isDirectory, s"'${site.root.getName}' is not a directory") - val expectedLayouts = Set("main", "index", "sidebar", "blog-page", "doc-page", "api-page") + val expectedLayouts = Set("main", "index", "blog-page", "doc-page", "api-page") assert(site.layouts.keys == expectedLayouts, s"Incorrect layouts in: ${site.layouts.keys}, expected: $expectedLayouts") } @@ -82,6 +82,8 @@ class SiteTests extends DottyDocTest with SourceFileOps { val compd = site.compilableFiles.map(site.stripRoot).toSet val expectedAssets = Set( + "css/toolbar.css", + "css/sidebar.css", "css/api-page.css", "css/dottydoc.css", "css/color-brewer.css", diff --git a/docs/_includes/faq.html b/docs/_includes/faq.html index 569162d5709e..47a65dc1e5a5 100644 --- a/docs/_includes/faq.html +++ b/docs/_includes/faq.html @@ -93,6 +93,13 @@

Who’s working on it?

Olivier Blanvillain
+ +
+ + + + Aggelos Biboudis +
diff --git a/docs/blog/_posts/2015-10-23-dotty-compiler-bootstraps.md b/docs/blog/_posts/2015-10-23-dotty-compiler-bootstraps.md index 02f2825e2467..cfa8e5712947 100644 --- a/docs/blog/_posts/2015-10-23-dotty-compiler-bootstraps.md +++ b/docs/blog/_posts/2015-10-23-dotty-compiler-bootstraps.md @@ -1,5 +1,5 @@ --- -layout: blog +layout: blog-page author: Martin Odersky and Dmitry Petrashko title: "We got liftoff!" subTitle: The Dotty compiler for Scala bootstraps. diff --git a/docs/blog/_posts/2016-01-02-new-year-resolutions.md b/docs/blog/_posts/2016-01-02-new-year-resolutions.md index a4ce3a54ee68..1711fdfec85d 100644 --- a/docs/blog/_posts/2016-01-02-new-year-resolutions.md +++ b/docs/blog/_posts/2016-01-02-new-year-resolutions.md @@ -1,5 +1,5 @@ --- -layout: blog +layout: blog-page title: New Year Resolutions author: Martin Odersky authorImg: /images/martin.jpg diff --git a/docs/blog/_posts/2016-02-03-essence-of-scala.md b/docs/blog/_posts/2016-02-03-essence-of-scala.md index 0d457e0d8fc3..b7100b86e9d2 100644 --- a/docs/blog/_posts/2016-02-03-essence-of-scala.md +++ b/docs/blog/_posts/2016-02-03-essence-of-scala.md @@ -1,5 +1,5 @@ --- -layout: blog +layout: blog-page title: The Essence of Scala author: Martin Odersky authorImg: /images/martin.jpg diff --git a/docs/blog/_posts/2016-02-17-scaling-dot-soundness.md b/docs/blog/_posts/2016-02-17-scaling-dot-soundness.md index 0719cc3aac26..e7f88fea17e1 100644 --- a/docs/blog/_posts/2016-02-17-scaling-dot-soundness.md +++ b/docs/blog/_posts/2016-02-17-scaling-dot-soundness.md @@ -1,5 +1,5 @@ --- -layout: blog +layout: blog-page title: Scaling DOT to Scala - Soundness author: Martin Odersky authorImg: /images/martin.jpg diff --git a/docs/blog/_posts/2016-05-05-multiversal-equality.md b/docs/blog/_posts/2016-05-05-multiversal-equality.md index 83bc670596e1..142c4130a53a 100644 --- a/docs/blog/_posts/2016-05-05-multiversal-equality.md +++ b/docs/blog/_posts/2016-05-05-multiversal-equality.md @@ -1,5 +1,5 @@ --- -layout: blog +layout: blog-page title: Multiversal Equality for Scala author: Martin Odersky authorImg: /images/martin.jpg diff --git a/docs/blog/_posts/2016-12-05-implicit-function-types.md b/docs/blog/_posts/2016-12-05-implicit-function-types.md index 670c652ee8a8..462a66a01301 100644 --- a/docs/blog/_posts/2016-12-05-implicit-function-types.md +++ b/docs/blog/_posts/2016-12-05-implicit-function-types.md @@ -1,5 +1,5 @@ --- -layout: blog +layout: blog-page title: Implicit Function Types author: Martin Odersky authorImg: /images/martin.jpg diff --git a/docs/docs/contributing/getting-started.md b/docs/docs/contributing/getting-started.md index c36878198d8b..010de42bdb6e 100644 --- a/docs/docs/contributing/getting-started.md +++ b/docs/docs/contributing/getting-started.md @@ -3,7 +3,7 @@ layout: doc-page title: Getting Started --- - + Requirements ------------ @@ -30,7 +30,7 @@ $ sbt hello world ``` -There are also bash scripts that can be used in the same way. Assuming that you have cloned the Dotty repo locally, append +There are also bash scripts that can be used in the same way. Assuming that you have cloned the Dotty repo locally, append the following line on your `.bash_profile`: ```shell @@ -65,6 +65,5 @@ or via bash: $ dotr ``` -Before contributing to Dotty, we invite you to consult the -[Dotty Developer Guidelines](https://github.com/lampepfl/dotty/blob/master/CONTRIBUTING.md). - \ No newline at end of file +Before contributing to Dotty, we invite you to consult the +[Dotty Developer Guidelines](https://github.com/lampepfl/dotty/blob/master/CONTRIBUTING). diff --git a/docs/images/aggelos.png b/docs/images/aggelos.png new file mode 100644 index 000000000000..c9d4cefccbbd Binary files /dev/null and b/docs/images/aggelos.png differ diff --git a/project/Build.scala b/project/Build.scala index e8e2f62f2aa0..f209fb2d0735 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -282,6 +282,7 @@ object Build { val args: Seq[String] = Seq( "-siteroot", "docs", "-project", "Dotty", + "-project-version", dottyVersion, "-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps" ) (runMain in Compile).toTask(