summaryrefslogtreecommitdiff
path: root/book
diff options
context:
space:
mode:
authorLi Haoyi <haoyi@dropbox.com>2014-12-28 17:10:09 +0100
committerLi Haoyi <haoyi@dropbox.com>2014-12-28 17:10:09 +0100
commit47495632fb60bb6bdc4b61b3e00333dbe1182e7b (patch)
treeb3d80af29b2c3b640e34d3180d1608066a4ccfea /book
parent63d9cf82d3c28b1d2aedd7ecb7c918342fcb5c50 (diff)
downloadhands-on-scala-js-47495632fb60bb6bdc4b61b3e00333dbe1182e7b.tar.gz
hands-on-scala-js-47495632fb60bb6bdc4b61b3e00333dbe1182e7b.tar.bz2
hands-on-scala-js-47495632fb60bb6bdc4b61b3e00333dbe1182e7b.zip
Shortened a bunch of imports, tweaked width
Diffstat (limited to 'book')
-rw-r--r--book/src/main/scalatex/book/Index.scalatex10
-rw-r--r--book/src/main/scalatex/book/Intro.scalatex9
2 files changed, 10 insertions, 9 deletions
diff --git a/book/src/main/scalatex/book/Index.scalatex b/book/src/main/scalatex/book/Index.scalatex
index 1a10aa0..bf33d19 100644
--- a/book/src/main/scalatex/book/Index.scalatex
+++ b/book/src/main/scalatex/book/Index.scalatex
@@ -1,11 +1,11 @@
@import BookData._
-@val firstHalfDescription = """
-is a set of tutorials that walks you through getting started with Scala.js. You'll build a range of small projects, from Making a Canvas App to Interactive Web Pages to Integrating Client-Server, and in the process will get a good overview of both Scala.js's use cases as well as the development experience
-"""
-@val secondHalfDescription = """
+@val firstHalfDescription = Seq[Frag]("""
+is a set of tutorials that walks you through getting started with Scala.js. You'll build a range of small projects, from """, sect.ref("Making a Canvas App"), " to ", sect.ref("Interactive Web Pages"), " to ", sect.ref("Integrating Client-Server"), """, and in the process will get a good overview of both Scala.js's use cases as well as the development experience
+""")
+@val secondHalfDescription = Seq("""
is a set of detailed expositions on various parts of the Scala.js platform. Nothing in here is necessary for you to make your first demos, but as you dig deeper into the platform, you will likely need or want to care about these things so you can properly understand what's going on "under the hood"
-"""
+""")
@sect("Hands-on Scala.js", "Writing client-side web applications in Scala")
@split
@more
diff --git a/book/src/main/scalatex/book/Intro.scalatex b/book/src/main/scalatex/book/Intro.scalatex
index 5438cfb..a504aa6 100644
--- a/book/src/main/scalatex/book/Intro.scalatex
+++ b/book/src/main/scalatex/book/Intro.scalatex
@@ -5,7 +5,7 @@
@split
@half
@hl.scala
- object Example extends js.JSApp{
+ object Main extends js.JSApp{
def main() = {
var x = 0
while(x < 10) x += 3
@@ -16,12 +16,13 @@
@half
@hl.javascript
- ScalaJS.c.LExample$.prototype.main__V = (function() {
+ ScalaJS.c.LMain$.prototype.main__V = (function() {
var x = 0;
while ((x < 10)) {
x = ((x + 3) | 0)
};
- ScalaJS.m.s_Predef().println__O__V(x)
+ ScalaJS.m.s_Predef()
+ .println__O__V(x)
// 12
});
@@ -67,7 +68,7 @@
@p
To work in Javascript, you need the discipline to limit yourself to the sane subset of the language, avoiding all the pitfalls along the way:
- @img(src:="images/javascript-the-good-parts-the-definitive-guide.jpg")
+ @img(src:="images/javascript-the-good-parts-the-definitive-guide.jpg", margin.auto, display.block)
@p
Even if you manage to do so, what constitutes a pitfall and what constitutes a clever-language-feature changes yearly, making it difficult to maintain cohesiveness over time. This is compounded by the fact that refactoring is difficult, and so removing "unwanted" patterns from a large code-base a difficult (often multi-year) process.