Skip to content

Commit

Permalink
Move v1 documentation under docs/v1, with docs/index.html symlink…
Browse files Browse the repository at this point in the history
…ing to `docs/v1/index.html` (with `.nojekyll` file to hopefully make the symlink work)
  • Loading branch information
GeoffreyBooth committed Nov 16, 2016
1 parent 3b0b002 commit 3739954
Show file tree
Hide file tree
Showing 44 changed files with 32 additions and 88 deletions.
Empty file added .nojekyll
Empty file.
9 changes: 5 additions & 4 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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', ->
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
100 changes: 21 additions & 79 deletions index.html → docs/v1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -170,9 +170,9 @@ <h2>
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);
}
};
Expand Down Expand Up @@ -576,23 +576,7 @@ <h2>
</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> -&gt;</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>
Expand All @@ -619,49 +603,7 @@ <h2>
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
Expand Down Expand Up @@ -965,9 +907,9 @@ <h2>
</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>{
Expand Down Expand Up @@ -1721,11 +1663,11 @@ <h2>
</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>]
}
};

Expand Down Expand Up @@ -1802,8 +1744,8 @@ <h2>
})();

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;
Expand Down Expand Up @@ -3947,8 +3889,8 @@ <h2>

</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>
10 changes: 5 additions & 5 deletions documentation/index.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2373,7 +2373,7 @@ six = -&gt;
</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>

0 comments on commit 3739954

Please sign in to comment.