Skip to content

Commit 9361c27

Browse files
committed
Merge branch 'master' of github.com:scala/scala.github.com
Conflicts: ja/overviews/macros/quasiquotes.md
2 parents 0eb83b8 + 9203e38 commit 9361c27

File tree

89 files changed

+2303
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2303
-168
lines changed

.bundle/config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
BUNDLE_PATH: vendor/bundle
3+
BUNDLE_DISABLE_SHARED_GEMS: '1'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ _site
33
.project
44
.settings
55
*~
6+
vendor/bundle

README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,58 @@ This repository contains the source for the Scala documentation website, as well
55
## Contributing ##
66

77
Please have a look at [http://docs.scala-lang.org/contribute.html](http://docs.scala-lang.org/contribute.html) before making a contribution.
8-
This document gives an overview of the type of documentation contained within the Scala Documentation repository and the repository's structure.
8+
This document gives an overview of the type of documentation contained within the Scala Documentation repository, the repository's structure, and how to build and run the documentation locally.
99

1010
Small changes, or corrected typos will generally be pulled in right away. Large changes, like the addition of new documents, or the rewriting of
1111
existing documents will be thoroughly reviewed-- please keep in mind that, generally, new documents must be very well-polished, complete, and maintained
1212
in order to be accepted.
1313

1414
## Dependencies ##
1515

16-
Jekyll is required. Follow the install instructions at the Jekyll [documentation site](http://jekyllrb.com/docs/installation/). Since this site is hosted on github pages, make sure you have [whatever version of Jekyll that github is running](https://help.github.com/articles/using-jekyll-with-pages#troubleshooting). As of the writing of this README, that is version >= 1.0.x.
16+
This site uses a Jekyll, a Ruby framework. You'll need Ruby and Bundler installed; see [Jekyll installation instructions](http://jekyllrb.com/docs/installation/) for the details.
1717

1818
## Building & Viewing ##
1919

20-
cd into the `scala.github.com` directory, and build by:
20+
cd into the directory where you cloned this repository, then install the required gems with `bundle install`. This will automatically put the gems into `./vendor/bundle`.
2121

22-
jekyll serve
22+
Start the server in the context of the bundle:
23+
24+
bundle exec jekyll serve
2325

2426
The generated site is available at `http://localhost:4000`
2527

28+
Jekyll will automatically watch for changes on the filesystem, and regenerate the site. It can take a few minutes for your changes to appear. Watch the output from `jekyll serve`. When you start up you'll see this:
29+
30+
$ bundle exec jekyll serve
31+
Configuration file: /Users/ben/src/scala.github.com/_config.yml
32+
Source: /Users/ben/src/scala.github.com
33+
Destination: /Users/ben/src/scala.github.com/_site
34+
Generating...
35+
done.
36+
Auto-regeneration: enabled for '/Users/ben/src/scala.github.com'
37+
38+
When you change a file, this output will tell you that jekyll is regenerating. It's not done until it says `done.`
39+
40+
Server running... press ctrl-c to stop.
41+
Regenerating: 1 files at 2014-11-29 09:19:04 ...done.
42+
Regenerating: 3 files at 2014-11-29 09:21:39 ...done.
43+
Regenerating: 2 files at 2014-11-29 09:25:10 ...done.
44+
Regenerating: 2 files at 2014-11-29 09:27:49
45+
2646
If you get `incompatible encoding` errors when generating the site under Windows, then ensure that the
2747
console in which you are running jekyll can work with UTF-8 characters. As described in the blog
2848
[Solving UTF problem with Jekyll on Windows](http://joseoncode.com/2011/11/27/solving-utf-problem-with-jekyll-on-windows/)
2949
you have to execute `chcp 65001`. This command is best added to the `jekyll.bat`-script.
3050

3151
## Markdown ##
3252

33-
The markdown used in this site uses [Maruku](http://maruku.rubyforge.org/maruku.html) extensions.
53+
The markdown used in this site uses [kramdown](http://kramdown.gettalong.org/) extensions.
3454

3555
### Markdown Editor for OSX ###
3656

37-
There exists a free markdown editor for OSX called [Mou](http://mouapp.com/). It's quite convenient to work with, and it generates the translated Markdown in real-time alongside of your editor window, as can be seen here:
57+
There's a free markdown editor for OSX called [Mou](http://25.io/mou/). It's quite convenient to work with, and it generates the translated Markdown in real-time alongside of your editor window, as can be seen here:
3858

39-
![Mou Screen Shot](http://mouapp.com/images/Mou_Screenshot_1.png)
59+
![Mou Screen Shot](http://25.io/mou/img/1.png)
4060

4161
## License ##
4262

_config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
markdown: kramdown
22

33
title: "Scala Documentation"
4-
description: "Documentation for the Scala programming language- Tutorials, Overviews, Cheatsheets, and more."
4+
description: "Documentation for the Scala programming language - Tutorials, Overviews, Cheatsheets, and more."
55
keywords:
66
- Scala
77
- Documentation
@@ -18,5 +18,4 @@ scala-version: 2.10.0
1818
highlighter: pygments
1919
permalink: /:categories/:title.html
2020
baseurl:
21-
22-
# markdown: rdiscount
21+
exclude: ["vendor"]

_includes/header.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
5-
<title>{% if page.partof %}{{ page.partof | replace: '-',' ' | split:" " | capitalize | join:" " }} - {% endif %}{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title>
4+
<title>{% if page.partof %}{% assign words = page.partof | split: '-' %}{% for word in words %}{{ word | capitalize }} {% endfor %}- {% endif %}{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title>
65
{% if page.description %}
76
<meta name="description" content="{{ page.description }}" />
87
{% endif %}
@@ -32,6 +31,10 @@
3231
<!-- table of contents js -->
3332
<script src="{{ site.baseurl }}/resources/javascript/toc.js" type="text/javascript" ></script>
3433

34+
<!-- styles for pager and table of contents -->
35+
<link rel="stylesheet" href="{{ site.baseurl }}/resources/stylesheets/pager.css" type="text/css" />
36+
<link rel="stylesheet" href="{{ site.baseurl }}/resources/stylesheets/toc.css" type="text/css" />
37+
3538
<!-- google analytics -->
3639
<script type="text/javascript">
3740

_includes/tutorial-pager.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<nav>
2+
<ul class="pager">
3+
{% if page.tutorial-previous %}
4+
<li class="previous"><a href="{{ page.tutorial-previous }}.html""><span aria-hidden="true">&larr;</span> Previous</a></li>
5+
{% endif %}
6+
{% if page.tutorial-next %}
7+
<li class="next"><a href="{{ page.tutorial-next }}.html">Next <span aria-hidden="true">&rarr;</span></a></li>
8+
{% endif %}
9+
</ul>
10+
</nav>

_includes/tutorial-tour-list.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
{% for i in (1..totalPagesTour) %}
1010
{% for pg in site.pages %}
1111
{% if pg.tutorial == "scala-tour" and pg.num and pg.num == i and pg.language == page.language %}
12-
<li class="tour-of-scala"><a href="{{ pg.url }}">{{ pg.title }}</a></li>
12+
<li class="tour-of-scala {% if page.title == pg.title %} current-page {% endif %}">
13+
<a href="{{ pg.url }}">{{ pg.title }}</a>
14+
</li>
1315
{% endif %}
1416
{% endfor %}
1517
{% endfor %}

_layouts/tutorial.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
<div class="span10">
3636
{{ content }}
37+
{% include tutorial-pager.txt %}
3738
{% if page.disqus == true %}{% include disqus.txt %}{% endif %}
3839
</div>
3940

ja/overviews/index.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,63 @@ title: ガイドと概要
55
---
66

77
<div class="page-header-index">
8-
<h1>コアライブラリ</h1>
8+
<h2>コアライブラリ</h2>
99
</div>
10+
* Scala コレクションライブラリ
11+
* [はじめに](/ja/overviews/collections/introduction.html)
12+
* [可変コレクションおよび不変コレクション](/ja/overviews/collections/overview.html)
13+
* [Traversable トレイト](/ja/overviews/collections/trait-traversable.html)
14+
* [Iterable トレイト](/ja/overviews/collections/trait-iterable.html)
15+
* [列トレイト Seq、IndexedSeq、および LinearSeq](/ja/overviews/collections/seqs.html)
16+
* [集合](/ja/overviews/collections/sets.html)
17+
* [マップ](/ja/overviews/collections/maps.html)
18+
* [具象不変コレクションクラス](/ja/overviews/collections/concrete-immutable-collection-classes.html)
19+
* [具象可変コレクションクラス](/ja/overviews/collections/concrete-mutable-collection-classes.html)
20+
* [配列](/ja/overviews/collections/arrays.html)
21+
* [文字列](/ja/overviews/collections/strings.html)
22+
* [性能特性](/ja/overviews/collections/performance-characteristics.html)
23+
* [等価性](/ja/overviews/collections/equality.html)
24+
* [ビュー](/ja/overviews/collections/views.html)
25+
* [イテレータ](/ja/overviews/collections/iterators.html)
26+
* [コレクションの作成](/ja/overviews/collections/creating-collections-from-scratch.html)
27+
* [Java と Scala 間のコレクションの変換](/ja/overviews/collections/conversions-between-java-and-scala-collections.html)
28+
* [Scala 2.7 からの移行](/ja/overviews/collections/migrating-from-scala-27.html)
29+
* [文字列の補間](/ja/overviews/core/string-interpolation.html) <span class="label success">New in 2.10</span>
30+
* [値クラスと汎用トレイト](/ja/overviews/core/value-classes.html) <span class="label success">New in 2.10</span>
31+
32+
<div class="page-header-index">
33+
<h2>並列および並行プログラミング</h2>
34+
</div>
35+
* [Future と Promise](/ja/overviews/core/futures.html) <span class="label success">New in 2.10</span>
36+
* Scala 並列コレクションライブラリ
37+
* [概要](/ja/overviews/parallel-collections/overview.html)
38+
* [具象並列コレクションクラス](/ja/overviews/parallel-collections/concrete-parallel-collections.html)
39+
* [並列コレクションへの変換](/ja/overviews/parallel-collections/conversions.html)
40+
* [並行トライ](/ja/overviews/parallel-collections/ctries.html)
41+
* [並列コレクションライブラリのアーキテクチャ](/ja/overviews/parallel-collections/architecture.html)
42+
* [カスタム並列コレクションの作成](/ja/overviews/parallel-collections/custom-parallel-collections.*tml)
43+
* [並列コレクションの設定](/ja/overviews/parallel-collections/configuration.html)
44+
* [性能の測定](/ja/overviews/parallel-collections/performance.html)
1045

11-
{% include localized-overview-index.txt %}
12-
<!--* Swing <span class="label important">In Progress</span>-->
46+
<div class="page-header-index">
47+
<h2>メタプログラミング</h2>
48+
</div>
49+
* リフレクション <span class="label important">Experimental</span>
50+
* [概要](/ja/overviews/reflection/overview.html)
51+
* [環境、ユニバース、ミラー](/ja/overviews/reflection/environment-universes-mirrors.html)
52+
* [シンボル、構文木、型](/ja/overviews/reflection/symbols-trees-types.html)
53+
* [アノテーション、名前、スコープ、その他](/ja/overviews/reflection/annotations-names-scopes.html)
54+
* [型タグとマニフェスト](/ja/overviews/reflection/typetags-manifests.html)
55+
* [スレッドセーフティ](/ja/overviews/reflection/thread-safety.html)
56+
* マクロ <span class="label important">Experimental</span>
57+
* [ユースケース](/ja/overviews/macros/usecases.html)
58+
* [blackbox vs whitebox](/ja/overviews/macros/blackbox-whitebox.html)
59+
* [def マクロ](/ja/overviews/macros/overview.html)
60+
* [準クォート](/ja/overviews/macros/quasiquotes.html)
61+
* [マクロバンドル](/ja/overviews/macros/bundles.html)
62+
* [implicit マクロ](/ja/overviews/macros/implicits.html)
63+
* [抽出子マクロ](/ja/overviews/macros/extractors.html)
64+
* [型プロバイダ](/ja/overviews/macros/typeproviders.html)
65+
* [マクロアノテーション](/ja/overviews/macros/annotations.html)
66+
* [マクロパラダイス](/ja/overviews/macros/paradise.html)
67+
* [ロードマップ](/ja/overviews/macros/roadmap.html)

ja/overviews/macros/annotations.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,20 @@ language: ja
55
disqus: true
66

77
partof: macros
8-
num: 6
9-
outof: 8
8+
num: 9
9+
outof: 11
10+
1011
title: マクロアノテーション
1112
---
1213
<span class="label important" style="float: right;">MACRO PARADISE</span>
1314

1415
**Eugene Burmako 著**<br>
1516
**Eugene Yokota 訳**
1617

17-
マクロアノテーションは現在マクロパラダイスプラグインを使った Scala 2.10 からのみ利用可能だ
18-
Scala 2.11 にこの機能が含まれる可能性はあるが、この件に関してのロードマップははっきりしてない
18+
マクロアノテーションはマクロパラダイスプラグインからのみ利用可能だ (Scala 2.10.x、2.11.x、2.12.x 系列全て同様)
19+
この機能が正式な Scala に入る可能性は、Scala 2.13 には残されているが、一切保証されていない
1920
[マクロパラダイス](/ja/overviews/macros/paradise.html)ページの説明にしたがってコンパイラプラグインをダウンロードしてほしい。
2021

21-
## コメント募集中
22-
23-
マクロアノテーションの現行の実装は実験的なものであり (それ故、現行のマクロパラダイスのバージョンも `2.0.0-SNAPSHOT` というスナップショット扱いされている)、今後の Scala 2.11 もしくは 2.12 への Scala improvement proposal を提出する上でのプレビューそして「たたき台」としての役割を果たすことを目的としている。
24-
コード生成のニーズを満たすことができるか是非試してみて、何かうまくいかない点があれば <a href="https://twitter.com/#!/xeno_by">Twitter</a> で著者に報告してほしい。
25-
2622
## 一巡り
2723

2824
マクロアノテーションは定義レベルでテキスト抽象化を実現する。Scala がマクロだと認識可能な定義であればトップレベルでも入れ子の定義でも、このアノテーションを付けることで (1つまたは複数の) メンバに展開させることができる。マクロパラダイスの以前のバージョンと比較して、2.0 のマクロパラダイスは以下の点を改善した:
@@ -106,3 +102,8 @@ Scala 2.11 にこの機能が含まれる可能性はあるが、この件に関
106102

107103
Scala マクロの精神に則り、マクロアノテーションは柔軟性のために可能な限り型指定を無くし (untyped; マクロ展開前に型検査を必須としないこと)、利便性のために可能な限り型付けた (typed; マクロ展開前に利用可能な型情報を取得すること)。注釈対象は型指定が無いため、後付けでシグネチャ (例えばクラスメンバのリストなど) を変更できる。しかし、Scala マクロを書くということはタイプチェッカと統合するということであり、マクロアノテーションもそれは同じだ。そのため、マクロ展開時には全ての型情報を得ることができる
108104
(例えば、包囲するプログラムに対してリフレクションを使ったり、現行スコープ内から型検査を行ったり、implicit の検索を行うことができる)。
105+
106+
## blackbox vs whitebox
107+
108+
マクロアノテーションは [whitebox](/ja/overviews/macros/blackbox-whitebox.html) である必要がある。
109+
マクロアノテーションを [blackbox](/ja/overviews/macros/blackbox-whitebox.html) だと宣言すると正しく動作しない。

0 commit comments

Comments
 (0)