Skip to content

Commit fb0f3ff

Browse files
committed
Fix #1674: add search to doc site
1 parent 5d59024 commit fb0f3ff

22 files changed

+179
-46
lines changed

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/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
</div>
1616
</a>
1717
<div id="content">
18+
<h1>{{ page.title }}</h1>
1819
{{ content }}
1920
</div>
2021
<div id="toc">

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: 50 additions & 4 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;
@@ -80,10 +90,25 @@ div#container {
8090
padding-right: 20px;
8191
width: $toc-width;
8292

93+
form#search-form {
94+
input#search-box {
95+
width: 100%;
96+
border: 0;
97+
height: 24px;
98+
font-size: 14px;
99+
padding-left: 4px;
100+
}
101+
102+
input#search-button {
103+
margin-top: 3px;
104+
}
105+
}
106+
83107
> div {
84108
position: fixed;
85109
top: $distance-top;
86110
bottom: auto;
111+
max-width: $toc-width;
87112

88113
a > div#scala-logo {
89114
width: 64px;
@@ -125,6 +150,21 @@ div#container {
125150
}
126151
}
127152

153+
h1#search {
154+
margin-top: 50px;
155+
}
156+
157+
form#search-bar {
158+
width: 100%;
159+
> input {
160+
width: 100%;
161+
border: 0;
162+
height: 24px;
163+
font-size: 14px;
164+
padding-left: 4px;
165+
}
166+
}
167+
128168
div.author-container {
129169
height: 50px;
130170
margin-bottom: 15px;
@@ -155,7 +195,7 @@ ul.post-list {
155195

156196
> li {
157197
div.date {
158-
color: rgba(0,0,0,0.45);
198+
color: rgba(255,255,255,0.55);
159199
}
160200
}
161201
}
@@ -165,12 +205,18 @@ pre, code {
165205
border: 0;
166206
border-radius: 3px;
167207
background-color: $grey;
208+
color: $background-color;
168209
font-family: $code-font-family;
169210
}
170211

212+
code {
213+
padding-left: 0.1em;
214+
padding-right: 0.1em;
215+
}
216+
171217
body {
172218
font: 400 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
173-
color: #111;
219+
color: $text-color;
174220
}
175221

176222
@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.

docs/docs/internals/backend.md

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

6-
Backend Internals
7-
=================
86
The code for the backend is split up by functionality and assembled in the
97
objet `GenBCode`.
108

docs/docs/internals/contexts.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
---
2-
title: Contexts
32
layout: default
3+
title: "Contexts"
44
---
55

6-
Contexts
7-
========
86
The `Context` contains the state of the compiler, for example
97
* `settings`
108
* `freshNames` (`FreshNameCreator`)

docs/docs/internals/dotc-scalac.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: "Scalac vs Dotty"
3+
title: "Differences between Scalac and Dotty"
44
---
55

6-
Differences between Scalac and Dotty
7-
====================================
86
Overview explanation how symbols, named types and denotations hang together:
97
[Denotations.scala:22]
108

docs/docs/internals/overall-structure.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: "Project Structure"
3+
title: "Dotty Overall Structure"
44
---
55

6-
Dotc Overall Structure
7-
======================
86
The compiler code is found in package [dotty.tools]. It spans the
97
following three sub-packages:
108

docs/docs/internals/periods.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: "Periods"
4-
toc: true
3+
title: "Dotc's concept of time"
54
---
65

7-
Dotc's concept of time
8-
======================
96
Conceptually, the `dotc` compiler's job is to maintain views of various
107
artifacts associated with source code at all points in time. But what is
118
*time* for `dotc`? In fact, it is a combination of compiler runs and compiler

docs/docs/internals/type-system.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: "Type System"
34
---
45

5-
Type System
6-
===========
76
The types are defined in [dotty/tools/dotc/core/Types.scala][1]
87

98
## Class diagram ##

docs/docs/usage/cbt-projects.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: "cbt"
3+
title: "Using Dotty with cbt"
44
---
55

6-
Using Dotty with cbt
7-
====================
86
cbt comes with built-in dotty support. Follow the
97
[cbt tutorial](https://github.com/cvogt/cbt/), then simply extend `Dotty` in the Build class.
108

docs/docs/usage/migrating.md

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

6-
Migrating to Dotty
7-
==================
8-
96
### Minor tweaks ###
107
* `sym.linkedClassOfClass` => `sym.linkedClass`
118
* `definitions` => `ctx.definitions`

docs/docs/usage/sbt-projects.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: "sbt"
3+
title: "Using Dotty with sbt"
44
---
55

6-
Using Dotty with sbt
7-
====================
86
It is now possible to use Dotty with sbt thanks to the dotty-bridge project.
97
There are two alternatives in how to create an sbt project that uses dotty:
108

0 commit comments

Comments
 (0)