Move v1 documentation under docs/v1, with docs/index.html symlinking to docs/v1/index.html (with .nojekyll file to hopefully make the symlink work)
0
.nojekyll
Normal file
9
Cakefile
|
|
@ -171,19 +171,20 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
|
|||
|
||||
|
||||
task 'doc:site', 'watch and continually rebuild the documentation for the website', ->
|
||||
majorVersion = CoffeeScript.VERSION.split('.')[0]
|
||||
source = 'documentation/index.html.js'
|
||||
exec 'bin/coffee -bc -o documentation/js documentation/coffee/*.coffee'
|
||||
|
||||
do renderIndex = ->
|
||||
codeSnippetCounter = 0
|
||||
render = _.template fs.readFileSync(source, 'utf-8')
|
||||
fs.writeFileSync 'index.html', render
|
||||
output = render
|
||||
codeFor: codeFor()
|
||||
releaseHeader: releaseHeader
|
||||
log "compiled", green, "#{source}"
|
||||
fs.writeFileSync "docs/v#{majorVersion}/index.html", output
|
||||
log 'compiled', green, "#{source} → docs/v#{majorVersion}/index.html"
|
||||
|
||||
fs.watchFile source, interval: 200, renderIndex
|
||||
log "watching..." , green
|
||||
log 'watching...' , green
|
||||
|
||||
|
||||
task 'doc:source', 'rebuild the internal documentation', ->
|
||||
|
|
|
|||
1
docs/index.html
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
v1/index.html
|
||||
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 132 B After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
|
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
|
@ -5,16 +5,16 @@
|
|||
<title>CoffeeScript</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="canonical" href="http://coffeescript.org" />
|
||||
<link rel="stylesheet" type="text/css" href="documentation/css/docs.css" />
|
||||
<link rel="stylesheet" type="text/css" href="documentation/css/tomorrow.css" />
|
||||
<link rel="shortcut icon" href="documentation/images/favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="v1/css/docs.css" />
|
||||
<link rel="stylesheet" type="text/css" href="v1/css/tomorrow.css" />
|
||||
<link rel="shortcut icon" href="v1/images/favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="fadeout"></div>
|
||||
|
||||
<div id="flybar">
|
||||
<a id="logo" href="#top"><img src="documentation/images/logo.png" width="225" height="39" alt="CoffeeScript" /></a>
|
||||
<a id="logo" href="#top"><img src="v1/images/logo.png" width="225" height="39" alt="CoffeeScript" /></a>
|
||||
<div class="navigation toc">
|
||||
<div class="button">
|
||||
Table of Contents
|
||||
|
|
@ -170,9 +170,9 @@ square = <span class="function"><span class="keyword">function</span>(<span clas
|
|||
list = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>];
|
||||
|
||||
math = {
|
||||
root: <span class="built_in">Math</span>.sqrt,
|
||||
square: square,
|
||||
cube: <span class="function"><span class="keyword">function</span>(<span class="params">x</span>) </span>{
|
||||
<span class="attr">root</span>: <span class="built_in">Math</span>.sqrt,
|
||||
<span class="attr">square</span>: square,
|
||||
<span class="attr">cube</span>: <span class="function"><span class="keyword">function</span>(<span class="params">x</span>) </span>{
|
||||
<span class="keyword">return</span> x * square(x);
|
||||
}
|
||||
};
|
||||
|
|
@ -576,23 +576,7 @@ cube = function(x) {
|
|||
</p>
|
||||
<div class='code'><pre><code><span class="function"><span class="title">fill</span> = <span class="params">(container, liquid = <span class="string">"coffee"</span>)</span> -></span>
|
||||
<span class="string">"Filling the <span class="subst">#{container}</span> with <span class="subst">#{liquid}</span>..."</span>
|
||||
</code></pre><pre><code><span class="keyword">var</span> fill;
|
||||
|
||||
fill = <span class="function"><span class="keyword">function</span>(<span class="params">container, liquid</span>) </span>{
|
||||
<span class="keyword">if</span> (liquid == <span class="literal">null</span>) {
|
||||
liquid = <span class="string">"coffee"</span>;
|
||||
}
|
||||
<span class="keyword">return</span> <span class="string">"Filling the "</span> + container + <span class="string">" with "</span> + liquid + <span class="string">"..."</span>;
|
||||
};
|
||||
</code></pre><script>window.example3 = "fill = (container, liquid = \"coffee\") ->\n \"Filling the #{container} with #{liquid}...\"\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example3);'>load</div><div class='minibutton ok' onclick='javascript: var fill;
|
||||
|
||||
fill = function(container, liquid) {
|
||||
if (liquid == null) {
|
||||
liquid = "coffee";
|
||||
}
|
||||
return "Filling the " + container + " with " + liquid + "...";
|
||||
};
|
||||
;alert(fill("cup"));'>run: fill("cup")</div><br class='clear' /></div>
|
||||
</code></pre><pre><code></code></pre><script>window.example3 = "fill = (container, liquid = \"coffee\") ->\n \"Filling the #{container} with #{liquid}...\"\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example3);'>load</div><div class='minibutton ok' onclick='javascript: ;alert(fill("cup"));'>run: fill("cup")</div><br class='clear' /></div>
|
||||
|
||||
<p>
|
||||
<span id="objects_and_arrays" class="bookmark"></span>
|
||||
|
|
@ -619,49 +603,7 @@ kids =
|
|||
sister:
|
||||
name: <span class="string">"Ida"</span>
|
||||
age: <span class="number">9</span>
|
||||
</code></pre><pre><code><span class="keyword">var</span> bitlist, kids, singers, song;
|
||||
|
||||
song = [<span class="string">"do"</span>, <span class="string">"re"</span>, <span class="string">"mi"</span>, <span class="string">"fa"</span>, <span class="string">"so"</span>];
|
||||
|
||||
singers = {
|
||||
Jagger: <span class="string">"Rock"</span>,
|
||||
Elvis: <span class="string">"Roll"</span>
|
||||
};
|
||||
|
||||
bitlist = [<span class="number">1</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">0</span>];
|
||||
|
||||
kids = {
|
||||
brother: {
|
||||
name: <span class="string">"Max"</span>,
|
||||
age: <span class="number">11</span>
|
||||
},
|
||||
sister: {
|
||||
name: <span class="string">"Ida"</span>,
|
||||
age: <span class="number">9</span>
|
||||
}
|
||||
};
|
||||
</code></pre><script>window.example4 = "song = [\"do\", \"re\", \"mi\", \"fa\", \"so\"]\n\nsingers = {Jagger: \"Rock\", Elvis: \"Roll\"}\n\nbitlist = [\n 1, 0, 1\n 0, 0, 1\n 1, 1, 0\n]\n\nkids =\n brother:\n name: \"Max\"\n age: 11\n sister:\n name: \"Ida\"\n age: 9\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example4);'>load</div><div class='minibutton ok' onclick='javascript: var bitlist, kids, singers, song;
|
||||
|
||||
song = ["do", "re", "mi", "fa", "so"];
|
||||
|
||||
singers = {
|
||||
Jagger: "Rock",
|
||||
Elvis: "Roll"
|
||||
};
|
||||
|
||||
bitlist = [1, 0, 1, 0, 0, 1, 1, 1, 0];
|
||||
|
||||
kids = {
|
||||
brother: {
|
||||
name: "Max",
|
||||
age: 11
|
||||
},
|
||||
sister: {
|
||||
name: "Ida",
|
||||
age: 9
|
||||
}
|
||||
};
|
||||
;alert(song.join(" ... "));'>run: song.join(" ... ")</div><br class='clear' /></div>
|
||||
</code></pre><pre><code></code></pre><script>window.example4 = "song = [\"do\", \"re\", \"mi\", \"fa\", \"so\"]\n\nsingers = {Jagger: \"Rock\", Elvis: \"Roll\"}\n\nbitlist = [\n 1, 0, 1\n 0, 0, 1\n 1, 1, 0\n]\n\nkids =\n brother:\n name: \"Max\"\n age: 11\n sister:\n name: \"Ida\"\n age: 9\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example4);'>load</div><div class='minibutton ok' onclick='javascript: ;alert(song.join(" ... "));'>run: song.join(" ... ")</div><br class='clear' /></div>
|
||||
<p>
|
||||
In JavaScript, you can't use reserved words, like <code>class</code>, as properties
|
||||
of an object, without quoting them as strings. CoffeeScript notices reserved words
|
||||
|
|
@ -965,9 +907,9 @@ ages = <span class="keyword">for</span> child, age <span class="keyword">of</spa
|
|||
</code></pre><pre><code><span class="keyword">var</span> age, ages, child, yearsOld;
|
||||
|
||||
yearsOld = {
|
||||
max: <span class="number">10</span>,
|
||||
ida: <span class="number">9</span>,
|
||||
tim: <span class="number">11</span>
|
||||
<span class="attr">max</span>: <span class="number">10</span>,
|
||||
<span class="attr">ida</span>: <span class="number">9</span>,
|
||||
<span class="attr">tim</span>: <span class="number">11</span>
|
||||
};
|
||||
|
||||
ages = (<span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{
|
||||
|
|
@ -1721,11 +1663,11 @@ ref = weatherReport("Berkeley, CA"), city = ref[0], temp = ref[1], forecast = re
|
|||
</code></pre><pre><code><span class="keyword">var</span> city, futurists, name, ref, ref1, street;
|
||||
|
||||
futurists = {
|
||||
sculptor: <span class="string">"Umberto Boccioni"</span>,
|
||||
painter: <span class="string">"Vladimir Burliuk"</span>,
|
||||
poet: {
|
||||
name: <span class="string">"F.T. Marinetti"</span>,
|
||||
address: [<span class="string">"Via Roma 42R"</span>, <span class="string">"Bellagio, Italy 22021"</span>]
|
||||
<span class="attr">sculptor</span>: <span class="string">"Umberto Boccioni"</span>,
|
||||
<span class="attr">painter</span>: <span class="string">"Vladimir Burliuk"</span>,
|
||||
<span class="attr">poet</span>: {
|
||||
<span class="attr">name</span>: <span class="string">"F.T. Marinetti"</span>,
|
||||
<span class="attr">address</span>: [<span class="string">"Via Roma 42R"</span>, <span class="string">"Bellagio, Italy 22021"</span>]
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1802,8 +1744,8 @@ Person = (<span class="function"><span class="keyword">function</span>(<span cla
|
|||
})();
|
||||
|
||||
tim = <span class="keyword">new</span> Person({
|
||||
name: <span class="string">'Tim'</span>,
|
||||
age: <span class="number">4</span>
|
||||
<span class="attr">name</span>: <span class="string">'Tim'</span>,
|
||||
<span class="attr">age</span>: <span class="number">4</span>
|
||||
});
|
||||
</code></pre><script>window.example31 = "class Person\n constructor: (options) ->\n {@name, @age, @height = 'average'} = options\n\ntim = new Person name: 'Tim', age: 4\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example31);'>load</div><div class='minibutton ok' onclick='javascript: var Person, tim;
|
||||
|
||||
|
|
@ -3947,8 +3889,8 @@ six = ->
|
|||
|
||||
</script>
|
||||
|
||||
<script src="documentation/vendor/jquery-1.6.4.js"></script>
|
||||
<script src="extras/coffee-script.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="v1/extras/coffee-script.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -5,16 +5,16 @@
|
|||
<title>CoffeeScript</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="canonical" href="http://coffeescript.org" />
|
||||
<link rel="stylesheet" type="text/css" href="documentation/css/docs.css" />
|
||||
<link rel="stylesheet" type="text/css" href="documentation/css/tomorrow.css" />
|
||||
<link rel="shortcut icon" href="documentation/images/favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="v1/css/docs.css" />
|
||||
<link rel="stylesheet" type="text/css" href="v1/css/tomorrow.css" />
|
||||
<link rel="shortcut icon" href="v1/images/favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="fadeout"></div>
|
||||
|
||||
<div id="flybar">
|
||||
<a id="logo" href="#top"><img src="documentation/images/logo.png" width="225" height="39" alt="CoffeeScript" /></a>
|
||||
<a id="logo" href="#top"><img src="v1/images/logo.png" width="225" height="39" alt="CoffeeScript" /></a>
|
||||
<div class="navigation toc">
|
||||
<div class="button">
|
||||
Table of Contents
|
||||
|
|
@ -2373,7 +2373,7 @@ six = ->
|
|||
</script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="extras/coffee-script.js"></script>
|
||||
<script src="v1/extras/coffee-script.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||