Skip to content

Commit d1e0d3b

Browse files
authored
Merge pull request #1676 from felixmulder/topic/docs-add-search
Fix a number of doc issues
2 parents 5d59024 + e0c1d16 commit d1e0d3b

25 files changed

+263
-130
lines changed

README.md

Lines changed: 13 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,18 @@
1-
dotty
1+
Dotty
22
=====
3-
43
[![Join the chat at https://gitter.im/lampepfl/dotty](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/lampepfl/dotty?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
54

6-
Dotty is a platform to try out new language concepts and compiler
7-
technologies for Scala. The focus is mainly on simplification. We
8-
remove extraneous syntax (e.g. no XML literals), and try to boil down
9-
Scala's types into a smaller set of more fundamental constructors. The
10-
theory behind these constructors is researched in
11-
[DOT](http://www.cs.uwm.edu/~boyland/fool2012/papers/fool2012_submission_3.pdf),
12-
a calculus for dependent object types.
13-
14-
####Current status:
15-
_Technology preview_: currently unsupported, may be functionally incomplete or unsuitable for production use.
16-
17-
####Is it going to be the future Scala?
18-
Yes, eventually.
19-
20-
####Who's working on it?
21-
See [github contributors page](https://github.com/lampepfl/dotty/graphs/contributors).
22-
23-
####What are the features that could make me consider trying it?
24-
| Feature | Status |
25-
|---------------------------------------------------------------------------------------------------------|---------------------|
26-
| Union, Intersection and [Literal singleton types](http://docs.scala-lang.org/sips/pending/42.type.html) | Implemented |
27-
| Fast compilation(phase fusion) | Implemented |
28-
| [Trait parameters](http://docs.scala-lang.org/sips/pending/trait-parameters.html) | Implemented |
29-
| [@Static methods and fields](https://github.com/scala/scala.github.com/pull/491) | Implemented |
30-
| Colored Repl | Implemented |
31-
| Sbt incremental build | Implemented |
32-
| Non-blocking lazy vals | Implemented |
33-
| Multiverse equality | Implemented |
34-
| Option-less pattern matching(based on [name-based patmat](https://github.com/scala/scala/pull/2848)) | Implemented |
35-
| Function arity adaptation | Implemented |
36-
| Exhaustivity checks in pattern matching | Implemented |
37-
| | |
38-
| Non-boxed arrays of value classes | In progress |
39-
| Working contravariant implicits | In progress |
40-
| [Auto-Specialization](https://github.com/dotty-linker/dotty) | In progress |
41-
| [Whole program optimizer](https://github.com/dotty-linker/dotty) | In progress |
42-
| [Library defined optimizations](https://github.com/dotty-linker/dotty) | In progress |
43-
| | |
44-
| HList & HMaps\Record types | Under consideration |
45-
| Implicit functions | Under consideration |
46-
| Effects | Under consideration |
47-
| Auto-completion in repl | Under consideration |
48-
| Spec Option-less pattern matching | Under consideration |
49-
50-
There are also plethora of small details such as [per-callsite @tailrec annotations](https://github.com/lampepfl/dotty/issues/1221)
51-
52-
####What are the complications that I can have If I start using Dotty?
53-
Dotty can use libraries compiled by scalac 2.11, but Scala scalac can't use libraries compiled by Dotty.<br>
54-
No existential types.<br>
55-
No macro support yet. We have big plans here.<br>
56-
No early initializers. No scala.DelayedInit. Use trait parameters instead.<br>
57-
Whole program optimizer will only work if all dependencies are compiled by Dotty.<br>
58-
59-
60-
####Can I write my code in a way that is going to be compatible with Scalac & Dotty?
61-
Yes, Dotty itself is a project that can be compiled by both Dotty and Scalac.<br>
62-
It's not very hard, and the biggest thing that you will likely miss is using macros.
63-
64-
####How can I try it out?
65-
http://lampepfl.github.io/dotty/docs/contributing/getting-started.html.
66-
Here’s an example sbt project and instructions on how to set it up: https://github.com/smarter/dotty-example-project/ <br>
67-
We have colored REPL :-). You can invoke it by running `dotc -repl`.
68-
69-
####We also have:
70-
Basic support for Scala.js,<br>
71-
[Prototype](https://github.com/scala-native/scala-native/tree/topic/dotty-support) of compilation to x86 native code(Shabalin)<br>
72-
73-
####What about scalac:
74-
Scalac is the basis for stability in scala. We expect scalac & dotty to coexist for long time.
75-
76-
####Contributions are welcome!
77-
We invite you to help us build the future of Scala.<br>
78-
This is the best moment to participate, as everyone can make an impact.<br>
79-
80-
####SI-2712?
81-
Since scalac merged a fix into 2.12, we’ll mimic their behaviour. But we have bigger plans for
82-
HK-types.
83-
5+
* [Homepage](http://dotty.epfl.ch)
6+
* [Documentation](http://dotty.epfl.ch/docs)
7+
* [FAQ](http://dotty.epfl.ch/#why-dotty)
8+
* [Mailing list](https://groups.google.com/forum/#!forum/dotty-internals)
849

10+
How to Contribute
11+
=================
12+
* [Getting Started](http://dotty.epfl.ch/docs/contributing/getting-started.html)
13+
* [Awesome Error Messages](http://scala-lang.org/blog/2016/10/14/dotty-errors.html)
14+
* [Issues](https://github.com/lampepfl/dotty/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
8515

86-
Developers mailing list is https://groups.google.com/forum/#!forum/dotty-internals.
16+
License
17+
=======
18+
Dotty is licensed under the [3-Clause BSD License](https://github.com/lampepfl/dotty/blob/master/LICENSE.md)

docs/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
title: Dotty Documentation
2+
repository_url: "http://github.com/lampepfl/dotty"
23
baseurl: ""
34
theme: minima
45
gems:

docs/_includes/toc.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
{% include scala-logo.html %}
55
</div>
66
</a>
7+
<form id="search-form" action="/search.html" method="get">
8+
<input placeholder="Search" type="text" id="search-box" name="query">
9+
</form>
710
<ul id="categories">
811
<li><ul><li><a href="{{ site.baseurl }}/blog">Blog</a></li></ul></li>
912
<li><ul><li><a href="{{ site.baseurl }}/docs">Dotty Docs</a></li></ul></li>

docs/_layouts/blog.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
layout: default
33
---
44

5-
<h1 class="title">{{ page.title }}</h1>
65
<h2 class="subtitle">{{ page.subTitle }}</h2>
76

87
<div class="author-container {% if page.authorImg != null %} spaced {% endif %}">
98
{% if page.authorImg != null %}
10-
<img src="{{ site.baseurl }}/{{ page.authorImg }}"/>
9+
<img src="{{ site.baseurl }}{{ page.authorImg }}"/>
1110
{% endif %}
1211
<div class="author-info">
1312
<div>{{ page.author }}</div>

docs/_layouts/default.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515
</div>
1616
</a>
1717
<div id="content">
18+
<h1>{{ page.title }}</h1>
19+
<div class="edit-docs">
20+
<a href="{{site.repository_url}}/edit/master/docs/{{page.path}}">[edit on github]</a>
21+
</div>
1822
{{ content }}
1923
</div>
2024
<div id="toc">
2125
{% include toc.html %}
2226
</div>
2327
</div>
2428
</body>
29+
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.4.0/mark.min.js"></script>
2530
<script src="{{ site.baseurl }}/js/highlight.pack.js"></script>
2631
<script language="javascript">
2732
hljs.initHighlightingOnLoad();
@@ -31,5 +36,26 @@
3136
if (thisHREF.indexOf(window.location.hostname) > -1) thisHREF = thisHREF.replace(".md",".html")
3237
document.links[i].setAttribute('href', thisHREF);
3338
}
39+
40+
function getQueryVariable(variable) {
41+
var query = window.location.search.substring(1);
42+
var vars = query.split('&');
43+
44+
for (var i = 0; i < vars.length; i++) {
45+
var pair = vars[i].split('=');
46+
47+
if (pair[0] === variable) {
48+
return decodeURIComponent(pair[1].replace(/\+/g, '%20'));
49+
}
50+
}
51+
}
52+
53+
54+
var highlight = getQueryVariable("highlight");
55+
if (highlight) {
56+
var context = document.querySelector("#content");
57+
var instance = new Mark(context);
58+
instance.mark(highlight);
59+
}
3460
</script>
3561
</html>

docs/_layouts/search.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<html>
2+
<head>
3+
<meta charset="utf-8">
4+
5+
<title>Dotty - {{ page.title }}</title>
6+
<link rel="shortcut icon" type="image/png" href="{{ site.baseurl}}/images/favicon.png"/>
7+
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/styles/github.min.css">
8+
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
9+
</head>
10+
<body>
11+
<div id="container">
12+
<div class="search">
13+
{{ content }}
14+
</div>
15+
</div>
16+
</body>
17+
</html>

docs/blog/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
title: "Blog"
44
---
55

6-
<h1>Blog</h1>
7-
86
<ul class="post-list">
97
{% for post in site.posts %}
108
<li>

docs/css/main.scss

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ $base-line-height: 1.5;
1515

1616
$spacing-unit: 30px;
1717

18-
$text-color: #111;
19-
$background-color: #fdfdfd;
18+
$text-color: #efefef;
19+
$background-color: #002B36;
2020
$brand-color: #2a7ae2;
2121

2222

@@ -25,6 +25,8 @@ $blue-light: rgba(52, 152, 219, 0.12);
2525
$grey: #f8f8f8;
2626
$red: #de332e;
2727

28+
$link-color: $blue;
29+
2830
// content area
2931
$distance-top: 80px;
3032
$content-width: 1150px;
@@ -49,6 +51,14 @@ html {
4951
box-sizing: inherit;
5052
}
5153

54+
*:focus {
55+
outline: none;
56+
}
57+
58+
a, a:focus, a:hover, a:visited {
59+
color: $link-color;
60+
}
61+
5262
div#container {
5363
position: relative;
5464
max-width: $content-width;
@@ -60,6 +70,7 @@ div#container {
6070
}
6171

6272
div#content {
73+
position: relative;
6374
margin-top: $distance-top;
6475
width: $content-width - $toc-width;
6576
float: right;
@@ -80,10 +91,25 @@ div#container {
8091
padding-right: 20px;
8192
width: $toc-width;
8293

94+
form#search-form {
95+
input#search-box {
96+
width: 100%;
97+
border: 0;
98+
height: 24px;
99+
font-size: 14px;
100+
padding-left: 4px;
101+
}
102+
103+
input#search-button {
104+
margin-top: 3px;
105+
}
106+
}
107+
83108
> div {
84109
position: fixed;
85110
top: $distance-top;
86111
bottom: auto;
112+
max-width: $toc-width;
87113

88114
a > div#scala-logo {
89115
width: 64px;
@@ -125,6 +151,27 @@ div#container {
125151
}
126152
}
127153

154+
div.edit-docs {
155+
position: absolute;
156+
top: 8px;
157+
right: 0;
158+
}
159+
160+
h1#search {
161+
margin-top: 50px;
162+
}
163+
164+
form#search-bar {
165+
width: 100%;
166+
> input {
167+
width: 100%;
168+
border: 0;
169+
height: 24px;
170+
font-size: 14px;
171+
padding-left: 4px;
172+
}
173+
}
174+
128175
div.author-container {
129176
height: 50px;
130177
margin-bottom: 15px;
@@ -135,7 +182,7 @@ div.author-container {
135182
}
136183

137184
> div.author-info {
138-
color: rgba(0,0,0,0.45);
185+
color: rgba(255,255,255,0.45);
139186
float: left;
140187
}
141188
}
@@ -155,7 +202,7 @@ ul.post-list {
155202

156203
> li {
157204
div.date {
158-
color: rgba(0,0,0,0.45);
205+
color: rgba(255,255,255,0.55);
159206
}
160207
}
161208
}
@@ -165,12 +212,18 @@ pre, code {
165212
border: 0;
166213
border-radius: 3px;
167214
background-color: $grey;
215+
color: $background-color;
168216
font-family: $code-font-family;
169217
}
170218

219+
code {
220+
padding-left: 0.1em;
221+
padding-right: 0.1em;
222+
}
223+
171224
body {
172225
font: 400 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
173-
color: #111;
226+
color: $text-color;
174227
}
175228

176229
@include media-query(1166px) {

docs/docs/contributing/eclipse.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
22
layout: default
3-
title: Eclipse
3+
title: "Building Dotty with Eclipse"
44
---
55

6-
Building Dotty with Eclipse
7-
===========================
8-
96
Build setup
107
-----------
118
You may need to redo these steps when the build changes.

docs/docs/contributing/getting-started.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ layout: default
33
title: "Getting Started"
44
---
55

6-
Getting Started
7-
===============
8-
96
Talks on Dotty
107
--------------
118
- [Scala's Road Ahead](https://www.youtube.com/watch?v=GHzWqJKFCk4) by Martin Odersky [\[slides\]](http://www.slideshare.net/Odersky/scala-days-nyc-2016)

docs/docs/contributing/intellij-idea.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
layout: default
3+
title: "Building Dotty with Intellij IDEA"
34
---
45

5-
Building Dotty with Intellij IDEA
6-
=================================
76
Dotty compiler support is available in the [Scala plugin nightly] starting
87
from 2.2.39. You need to install [IDEA 2016.1] to try it.
98

docs/docs/contributing/workflow.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ layout: default
33
title: "Workflow"
44
---
55

6-
Workflow
7-
========
86
This document details common workflow patterns when working with Dotty.
97

108
## Compiling files with dotc ##

docs/docs/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
---
22
layout: default
3-
title: "Docs"
3+
title: "Dotty Documentation"
44
---
55

6-
Dotty Documentation
7-
===================
86
The Dotty compiler is currently somewhat lacking in documentation - PRs
97
welcome! But, we've attempted to gather the most essential knowledge in these
108
pages.

0 commit comments

Comments
 (0)