id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gss/engine:spec/conditions.coffee:1:raw_corpus | raw_corpus | Engine = GSS #require 'gss-engine/lib/Engine.js'
assert = chai.assert
expect = chai.expect
remove = (el) ->
el?.parentNode?.removeChild(el)
fixtures = document.getElementById 'fixtures'
describe 'Conditions', ->
describe 'multiple conditions that observe the same condition', ->
it 'should reuse observers', ... | CoffeeScript | gss/engine | spec/conditions.coffee | MIT | e8c1d894162b4cbf37214e6e39e1d61799a06d84 | 2,854 | https://github.com/gss/engine/blob/e8c1d894162b4cbf37214e6e39e1d61799a06d84/spec/conditions.coffee | 1 | 43 | ||
gss/engine:spec/conditions.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Engine = GSS #require 'gss-engine/lib/Engine.js'
assert = chai.assert
expect = chai.expect
remove = (el) ->
el?.parentNode?.removeChild(el)
fixtures = document.getElementById 'fixtures'
describe 'Conditions', ->
describe 'multiple conditions that observe ... | var Engine, assert, expect, fixtures, remove;
Engine = GSS; //require 'gss-engine/lib/Engine.js'
assert = chai.assert;
expect = chai.expect;
remove = function(el) {
var ref;
return el != null ? (ref = el.parentNode) != null ? ref.removeChild(el) : void 0 : void 0;
};
fixtures = document.getElementById('fixture... | CoffeeScript | JavaScript | gss/engine | spec/conditions.coffee | MIT | e8c1d894162b4cbf37214e6e39e1d61799a06d84 | 2,854 | https://github.com/gss/engine/blob/e8c1d894162b4cbf37214e6e39e1d61799a06d84/spec/conditions.coffee | 1 | 43 |
gss/engine:spec/conditions.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Engine, assert, expect, fixtures, remove;
Engine = GSS; //require 'gss-engine/lib/Engine.js'
assert = chai.assert;
expect = chai.expect;
remove = function(el) {
var ref;
return el != null ? (ref = el.parentNode) != null ? ref.removeChild(el) : void 0 : ... | Engine = GSS #require 'gss-engine/lib/Engine.js'
assert = chai.assert
expect = chai.expect
remove = (el) ->
el?.parentNode?.removeChild(el)
fixtures = document.getElementById 'fixtures'
describe 'Conditions', ->
describe 'multiple conditions that observe the same condition', ->
it 'should reuse observers', ... | JavaScript | CoffeeScript | gss/engine | spec/conditions.coffee | MIT | e8c1d894162b4cbf37214e6e39e1d61799a06d84 | 2,854 | https://github.com/gss/engine/blob/e8c1d894162b4cbf37214e6e39e1d61799a06d84/spec/conditions.coffee | 1 | 43 |
gss/engine:spec/conditions.coffee:1:completion | completion | Engine = GSS #require 'gss-engine/lib/Engine.js'
assert = chai.assert
expect = chai.expect
remove = (el) ->
el?.parentNode?.removeChild(el)
fixtures = document.getElementById 'fixtures'
describe 'Conditions', ->
describe 'multiple conditions that observe the same condition', ->
it 'should reuse observers', ... | ]
expect(solution).to.eql b: 1, c: 3
solution = engine.solve({A: 50})
expect(solution).to.eql {A: 50, b: null, c: 2}
solution = engine.solve({A: 100})
expect(solution).to.eql {A: 100, b: 1, c: 3}
solution = engine.solve({A: null})
expect(solution).to.eql {A: null, b: null, c: n... | CoffeeScript | CoffeeScript | gss/engine | spec/conditions.coffee | MIT | e8c1d894162b4cbf37214e6e39e1d61799a06d84 | 2,854 | https://github.com/gss/engine/blob/e8c1d894162b4cbf37214e6e39e1d61799a06d84/spec/conditions.coffee | 1 | 43 |
gss/engine:spec/conditions.coffee:1:raw_corpus | raw_corpus | Engine = GSS #require 'gss-engine/lib/Engine.js'
assert = chai.assert
expect = chai.expect
remove = (el) ->
el?.parentNode?.removeChild(el)
fixtures = document.getElementById 'fixtures'
describe 'Conditions', ->
describe 'Else', ->
it 'should attach to a condition', ->
window.engine = engine = new GS... | CoffeeScript | gss/engine | spec/conditions.coffee | MIT | 9bc92c72147758363e34d02c9ed4fbfe84e5afd6 | 2,854 | https://github.com/gss/engine/blob/9bc92c72147758363e34d02c9ed4fbfe84e5afd6/spec/conditions.coffee | 1 | 26 | ||
gss/engine:spec/conditions.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Engine = GSS #require 'gss-engine/lib/Engine.js'
assert = chai.assert
expect = chai.expect
remove = (el) ->
el?.parentNode?.removeChild(el)
fixtures = document.getElementById 'fixtures'
describe 'Conditions', ->
describe 'Else', ->
it 'should attach ... | var Engine, assert, expect, fixtures, remove;
Engine = GSS; //require 'gss-engine/lib/Engine.js'
assert = chai.assert;
expect = chai.expect;
remove = function(el) {
var ref;
return el != null ? (ref = el.parentNode) != null ? ref.removeChild(el) : void 0 : void 0;
};
fixtures = document.getElementById('fixture... | CoffeeScript | JavaScript | gss/engine | spec/conditions.coffee | MIT | 9bc92c72147758363e34d02c9ed4fbfe84e5afd6 | 2,854 | https://github.com/gss/engine/blob/9bc92c72147758363e34d02c9ed4fbfe84e5afd6/spec/conditions.coffee | 1 | 26 |
gss/engine:spec/conditions.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Engine, assert, expect, fixtures, remove;
Engine = GSS; //require 'gss-engine/lib/Engine.js'
assert = chai.assert;
expect = chai.expect;
remove = function(el) {
var ref;
return el != null ? (ref = el.parentNode) != null ? ref.removeChild(el) : void 0 : ... | Engine = GSS #require 'gss-engine/lib/Engine.js'
assert = chai.assert
expect = chai.expect
remove = (el) ->
el?.parentNode?.removeChild(el)
fixtures = document.getElementById 'fixtures'
describe 'Conditions', ->
describe 'Else', ->
it 'should attach to a condition', ->
window.engine = engine = new GS... | JavaScript | CoffeeScript | gss/engine | spec/conditions.coffee | MIT | 9bc92c72147758363e34d02c9ed4fbfe84e5afd6 | 2,854 | https://github.com/gss/engine/blob/9bc92c72147758363e34d02c9ed4fbfe84e5afd6/spec/conditions.coffee | 1 | 26 |
gss/engine:spec/conditions.coffee:1:completion | completion | Engine = GSS #require 'gss-engine/lib/Engine.js'
assert = chai.assert
expect = chai.expect
remove = (el) ->
el?.parentNode?.removeChild(el)
fixtures = document.getElementById 'fixtures'
describe 'Conditions', ->
describe 'Else', -> | it 'should attach to a condition', ->
window.engine = engine = new GSS({A: 100})
debugger
solution = engine.solve [
['if', ['>', ['get', 'A'], 75],
['==', ['get', 'b'], 1]]
['elseif', ['>', ['get', 'A'], 50],
['==', ['get', 'c'], 2]]
['else',
['=='... | CoffeeScript | CoffeeScript | gss/engine | spec/conditions.coffee | MIT | 9bc92c72147758363e34d02c9ed4fbfe84e5afd6 | 2,854 | https://github.com/gss/engine/blob/9bc92c72147758363e34d02c9ed4fbfe84e5afd6/spec/conditions.coffee | 1 | 26 |
lucasmotta/dploy:src/help.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
packageConfig = require "../package.json"
usage = "DPLOY v#{packageConfig.version}\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\... | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/src/help.coffee | 1 | 36 | ||
lucasmotta/dploy:src/help.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
packageConfig = require "../package.json"
usage = "DPLOY v#{packageConfig.version}\n".bold
usage += "Comman... | var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var code, packageConfig, usage;
packageConfig = require("../package.json");
usage = `DPLOY v${pa... | CoffeeScript | JavaScript | lucasmotta/dploy | src/help.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/src/help.coffee | 1 | 36 |
lucasmotta/dploy:src/help.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var code, packageConfig, usage;
packageConfig... | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
packageConfig = require "../package.json"
usage = "DPLOY v#{packageConfig.version}\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\... | JavaScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/src/help.coffee | 1 | 36 |
lucasmotta/dploy:src/help.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
packageConfig = require "../package.json"
usage = "DPLOY v#{packageConfig.version}\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\... | usage += " install \t\t #{'# Install the dploy.yaml and the post-commit script'.grey}\n"
usage += " -h, --help \t\t #{'# Show this instructions'.grey}\n\n"
usage += " -v, --version \t\t #{'# Show the current version of DPLOY'.grey}\n\n"
usage += "Flags:\n"
usage += " -c, --catchup \t #{'# Upload only the r... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 00b02a4902db4650df865874ad52397d05a44638 | 973 | https://github.com/lucasmotta/dploy/blob/00b02a4902db4650df865874ad52397d05a44638/src/help.coffee | 1 | 36 |
lucasmotta/dploy:src/help.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
packageConfig = require "../package.json"
usage = "DPLOY v#{packageConfig.version}\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\... | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 43b33e88398f567a118e6d121a8054af541e1742 | 973 | https://github.com/lucasmotta/dploy/blob/43b33e88398f567a118e6d121a8054af541e1742/src/help.coffee | 1 | 35 | ||
lucasmotta/dploy:src/help.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
packageConfig = require "../package.json"
usage = "DPLOY v#{packageConfig.version}\n".bold
usage += "Comman... | var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var code, packageConfig, usage;
packageConfig = require("../package.json");
usage = `DPLOY v${pa... | CoffeeScript | JavaScript | lucasmotta/dploy | src/help.coffee | MIT | 43b33e88398f567a118e6d121a8054af541e1742 | 973 | https://github.com/lucasmotta/dploy/blob/43b33e88398f567a118e6d121a8054af541e1742/src/help.coffee | 1 | 35 |
lucasmotta/dploy:src/help.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var code, packageConfig, usage;
packageConfig... | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
packageConfig = require "../package.json"
usage = "DPLOY v#{packageConfig.version}\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\... | JavaScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 43b33e88398f567a118e6d121a8054af541e1742 | 973 | https://github.com/lucasmotta/dploy/blob/43b33e88398f567a118e6d121a8054af541e1742/src/help.coffee | 1 | 35 |
lucasmotta/dploy:src/help.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
packageConfig = require "../package.json"
usage = "DPLOY v#{packageConfig.version}\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\... | usage += "Commands:\n"
usage += " install \t\t #{'# Install the dploy.yaml and the post-commit script'.grey}\n"
usage += " -h, --help \t\t #{'# Show this instructions'.grey}\n\n"
usage += " -v, --version \t\t #{'# Show the current version of DPLOY'.grey}\n\n"
usage += "Flags:\n"
usage += " -i, --ignore-i... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 43b33e88398f567a118e6d121a8054af541e1742 | 973 | https://github.com/lucasmotta/dploy/blob/43b33e88398f567a118e6d121a8054af541e1742/src/help.coffee | 1 | 35 |
lucasmotta/dploy:src/help.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "DPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " dploy [#{'environment(s)'.... | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/help.coffee | 1 | 32 | ||
lucasmotta/dploy:src/help.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "DPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usa... | var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var code, usage;
usage = "DPLOY\n".bold;
usage += "Command line tool to deploy websites using FT... | CoffeeScript | JavaScript | lucasmotta/dploy | src/help.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/help.coffee | 1 | 32 |
lucasmotta/dploy:src/help.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var code, usage;
usage = "DPLOY\n".bold;
... | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "DPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " dploy [#{'environment(s)'.... | JavaScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/help.coffee | 1 | 32 |
lucasmotta/dploy:src/help.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "DPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " dploy [#{'environment(s)'.... | usage += " install \t\t #{'# Install the dploy.yaml and the post-commit script'.grey}\n"
usage += " -h, --help \t\t #{'# Show this instructions'.grey}\n\n"
usage += "Flags:\n"
usage += " -i, --ignore-include \t #{'# Ignore the files that are on your include list'.grey}\n\n"
usage += "Examples:\n"
usage +... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 77004ea8423b1cb74e8aac91e3e2004c456d5330 | 973 | https://github.com/lucasmotta/dploy/blob/77004ea8423b1cb74e8aac91e3e2004c456d5330/src/help.coffee | 1 | 32 |
lucasmotta/dploy:src/help.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "GPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " gploy [#{'environment(s)'.... | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 8a2b7332c6eb039cc52d42e841d9d7b9eb003580 | 973 | https://github.com/lucasmotta/dploy/blob/8a2b7332c6eb039cc52d42e841d9d7b9eb003580/src/help.coffee | 1 | 32 | ||
lucasmotta/dploy:src/help.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "GPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usa... | var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var code, usage;
usage = "GPLOY\n".bold;
usage += "Command line tool to deploy websites using FT... | CoffeeScript | JavaScript | lucasmotta/dploy | src/help.coffee | MIT | 8a2b7332c6eb039cc52d42e841d9d7b9eb003580 | 973 | https://github.com/lucasmotta/dploy/blob/8a2b7332c6eb039cc52d42e841d9d7b9eb003580/src/help.coffee | 1 | 32 |
lucasmotta/dploy:src/help.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var code, usage;
usage = "GPLOY\n".bold;
... | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "GPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " gploy [#{'environment(s)'.... | JavaScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 8a2b7332c6eb039cc52d42e841d9d7b9eb003580 | 973 | https://github.com/lucasmotta/dploy/blob/8a2b7332c6eb039cc52d42e841d9d7b9eb003580/src/help.coffee | 1 | 32 |
lucasmotta/dploy:src/help.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "GPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " gploy [#{'environment(s)'.... | usage += " install \t\t #{'# Install the gploy.yaml and the post-commit script'.grey}\n"
usage += " -h, --help \t\t #{'# Show this instructions'.grey}\n\n"
usage += "Flags:\n"
usage += " -i, --ignore-include \t #{'# Ignore the files that are on your include list'.grey}\n\n"
usage += "Examples:\n"
usage +... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | 8a2b7332c6eb039cc52d42e841d9d7b9eb003580 | 973 | https://github.com/lucasmotta/dploy/blob/8a2b7332c6eb039cc52d42e841d9d7b9eb003580/src/help.coffee | 1 | 32 |
lucasmotta/dploy:src/help.coffee:1:raw_corpus | raw_corpus | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "GPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " gploy [#{'environment(s)'.... | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/help.coffee | 1 | 31 | ||
lucasmotta/dploy:src/help.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "GPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usa... | var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var usage;
usage = "GPLOY\n".bold;
usage += "Command line tool to deploy websites using FTP/SFTP... | CoffeeScript | JavaScript | lucasmotta/dploy | src/help.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/help.coffee | 1 | 31 |
lucasmotta/dploy:src/help.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Generator, Signal, colors, fs, path;
colors = require("colors");
fs = require("fs");
path = require("path");
Signal = require("signals");
module.exports = Generator = class Generator {
constructor() {
var usage;
usage = "GPLOY\n".bold;
usage ... | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "GPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " gploy [#{'environment(s)'.... | JavaScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/help.coffee | 1 | 31 |
lucasmotta/dploy:src/help.coffee:1:completion | completion | colors = require "colors"
fs = require "fs"
path = require "path"
Signal = require "signals"
module.exports = class Generator
constructor: ->
usage = "GPLOY\n".bold
usage += "Command line tool to deploy websites using FTP/SFTP and git.\n\n".grey
usage += "Usage:\n"
usage += " gploy [#{'environment(s)'.... | usage += "Commands:\n"
usage += " install \t\t #{'# Install the gploy.yaml and the post-commit script'.grey}\n"
usage += " -h, --help \t\t #{'# Show this instructions'.grey}\n\n"
usage += "Flags:\n"
usage += " -i, --ignore-include \t #{'# Ignore the files that are on your include list'.grey}\n\n"
usage +... | CoffeeScript | CoffeeScript | lucasmotta/dploy | src/help.coffee | MIT | efd3f1f1edc29001ab55480c3f4cb6fb3b075abb | 973 | https://github.com/lucasmotta/dploy/blob/efd3f1f1edc29001ab55480c3f4cb6fb3b075abb/src/help.coffee | 1 | 31 |
buttercoin/buttercoin:test/api_client.coffee:1:raw_corpus | raw_corpus | ApiClient = require('../lib/api_client')
Api = require('../lib/api')
TestHelper = require('./test_helper')
WebSocket = require('ws')
describe 'ApiClient', ->
beforeEach =>
TestHelper.clean_state_sync
afterEach =>
TestHelper.clean_state_sync
it 'should initialize', ->
api_client = new ApiClient
... | CoffeeScript | buttercoin/buttercoin | test/api_client.coffee | MIT | fff4935d554f9e1afeab404570654c3102cb790a | 663 | https://github.com/buttercoin/buttercoin/blob/fff4935d554f9e1afeab404570654c3102cb790a/test/api_client.coffee | 1 | 23 | ||
buttercoin/buttercoin:test/api_client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ApiClient = require('../lib/api_client')
Api = require('../lib/api')
TestHelper = require('./test_helper')
WebSocket = require('ws')
describe 'ApiClient', ->
beforeEach =>
TestHelper.clean_state_sync
afterEach =>
TestHelper.clean_state_sync
it ... | var Api, ApiClient, TestHelper, WebSocket;
ApiClient = require('../lib/api_client');
Api = require('../lib/api');
TestHelper = require('./test_helper');
WebSocket = require('ws');
describe('ApiClient', function() {
beforeEach(() => {
return TestHelper.clean_state_sync;
});
afterEach(() => {
return Te... | CoffeeScript | JavaScript | buttercoin/buttercoin | test/api_client.coffee | MIT | fff4935d554f9e1afeab404570654c3102cb790a | 663 | https://github.com/buttercoin/buttercoin/blob/fff4935d554f9e1afeab404570654c3102cb790a/test/api_client.coffee | 1 | 23 |
buttercoin/buttercoin:test/api_client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Api, ApiClient, TestHelper, WebSocket;
ApiClient = require('../lib/api_client');
Api = require('../lib/api');
TestHelper = require('./test_helper');
WebSocket = require('ws');
describe('ApiClient', function() {
beforeEach(() => {
return TestHelper.cl... | ApiClient = require('../lib/api_client')
Api = require('../lib/api')
TestHelper = require('./test_helper')
WebSocket = require('ws')
describe 'ApiClient', ->
beforeEach =>
TestHelper.clean_state_sync
afterEach =>
TestHelper.clean_state_sync
it 'should initialize', ->
api_client = new ApiClient
... | JavaScript | CoffeeScript | buttercoin/buttercoin | test/api_client.coffee | MIT | fff4935d554f9e1afeab404570654c3102cb790a | 663 | https://github.com/buttercoin/buttercoin/blob/fff4935d554f9e1afeab404570654c3102cb790a/test/api_client.coffee | 1 | 23 |
buttercoin/buttercoin:test/api_client.coffee:1:completion | completion | ApiClient = require('../lib/api_client')
Api = require('../lib/api')
TestHelper = require('./test_helper')
WebSocket = require('ws')
describe 'ApiClient', ->
beforeEach =>
TestHelper.clean_state_sync
afterEach => | TestHelper.clean_state_sync
it 'should initialize', ->
api_client = new ApiClient
api_client.start
xit 'should start, connect to engine, and provide a WS server', (done) ->
api_client = new ApiClient
engine = new Api
engine.start {port: 3033, host: "0.0.0.0" }, () =>
api_client.start {po... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | test/api_client.coffee | MIT | fff4935d554f9e1afeab404570654c3102cb790a | 663 | https://github.com/buttercoin/buttercoin/blob/fff4935d554f9e1afeab404570654c3102cb790a/test/api_client.coffee | 1 | 23 |
buttercoin/buttercoin:lib/disruptor/batch_runner.coffee:1:raw_corpus | raw_corpus | # TODO - handle sequence overflow
module.exports = class BatchRunner
constructor: (@buffer, @barrier, @processor) ->
@sequence = -1
getBatch: ->
return [] unless @sequence < @barrier.sequence()
[(@sequence + 1) .. @barrier.sequence()].map (n) => @buffer.read(n)
sync: ->
batch = @getBatch()
b... | CoffeeScript | buttercoin/buttercoin | lib/disruptor/batch_runner.coffee | MIT | 13c5f2131607d06e2a1286cfcab3718aa6628a8c | 663 | https://github.com/buttercoin/buttercoin/blob/13c5f2131607d06e2a1286cfcab3718aa6628a8c/lib/disruptor/batch_runner.coffee | 1 | 13 | ||
buttercoin/buttercoin:lib/disruptor/batch_runner.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# TODO - handle sequence overflow
module.exports = class BatchRunner
constructor: (@buffer, @barrier, @processor) ->
@sequence = -1
getBatch: ->
return [] unless @sequence < @barrier.sequence()
[(@sequence + 1) .. @barrier.sequence()].map (n) => ... | // TODO - handle sequence overflow
var BatchRunner;
module.exports = BatchRunner = class BatchRunner {
constructor(buffer, barrier, processor) {
this.buffer = buffer;
this.barrier = barrier;
this.processor = processor;
this.sequence = -1;
}
getBatch() {
var ref, ref1;
if (!(this.sequence... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/disruptor/batch_runner.coffee | MIT | 13c5f2131607d06e2a1286cfcab3718aa6628a8c | 663 | https://github.com/buttercoin/buttercoin/blob/13c5f2131607d06e2a1286cfcab3718aa6628a8c/lib/disruptor/batch_runner.coffee | 1 | 13 |
buttercoin/buttercoin:lib/disruptor/batch_runner.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// TODO - handle sequence overflow
var BatchRunner;
module.exports = BatchRunner = class BatchRunner {
constructor(buffer, barrier, processor) {
this.buffer = buffer;
this.barrier = barrier;
this.processor = processor;
this.sequence = -1;
}
... | # TODO - handle sequence overflow
module.exports = class BatchRunner
constructor: (@buffer, @barrier, @processor) ->
@sequence = -1
getBatch: ->
return [] unless @sequence < @barrier.sequence()
[(@sequence + 1) .. @barrier.sequence()].map (n) => @buffer.read(n)
sync: ->
batch = @getBatch()
b... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/disruptor/batch_runner.coffee | MIT | 13c5f2131607d06e2a1286cfcab3718aa6628a8c | 663 | https://github.com/buttercoin/buttercoin/blob/13c5f2131607d06e2a1286cfcab3718aa6628a8c/lib/disruptor/batch_runner.coffee | 1 | 13 |
buttercoin/buttercoin:lib/disruptor/batch_runner.coffee:1:completion | completion | # TODO - handle sequence overflow
module.exports = class BatchRunner
constructor: (@buffer, @barrier, @processor) ->
@sequence = -1
getBatch: -> | return [] unless @sequence < @barrier.sequence()
[(@sequence + 1) .. @barrier.sequence()].map (n) => @buffer.read(n)
sync: ->
batch = @getBatch()
batch.forEach @processor # TODO - maybe wrap this so processors can't grab the ring-buffer storage array
@sequence += batch.length | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/disruptor/batch_runner.coffee | MIT | 13c5f2131607d06e2a1286cfcab3718aa6628a8c | 663 | https://github.com/buttercoin/buttercoin/blob/13c5f2131607d06e2a1286cfcab3718aa6628a8c/lib/disruptor/batch_runner.coffee | 1 | 13 |
jianliaoim/talk-os:talk-account/client/util/analytics.coffee:1:raw_corpus | raw_corpus | assign = require 'object-assign'
# methods copied from talk-web
exports.gaEvent = (category, action, label, value) ->
window.ga? 'send',
hitType: 'event',
eventCategory: category,
eventAction: action,
eventLabel: label
eventValue: value
exports.gaTiming = (category, variable, value) ->
window... | CoffeeScript | jianliaoim/talk-os | talk-account/client/util/analytics.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/util/analytics.coffee | 1 | 40 | ||
jianliaoim/talk-os:talk-account/client/util/analytics.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
assign = require 'object-assign'
# methods copied from talk-web
exports.gaEvent = (category, action, label, value) ->
window.ga? 'send',
hitType: 'event',
eventCategory: category,
eventAction: action,
eventLabel: label
eventValue: value
e... | var assign, ref, ref1;
assign = require('object-assign');
// methods copied from talk-web
exports.gaEvent = function(category, action, label, value) {
return typeof window.ga === "function" ? window.ga('send', {
hitType: 'event',
eventCategory: category,
eventAction: action,
eventLabel: label,
e... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/util/analytics.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/util/analytics.coffee | 1 | 40 |
jianliaoim/talk-os:talk-account/client/util/analytics.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var assign, ref, ref1;
assign = require('object-assign');
// methods copied from talk-web
exports.gaEvent = function(category, action, label, value) {
return typeof window.ga === "function" ? window.ga('send', {
hitType: 'event',
eventCategory: category... | assign = require 'object-assign'
# methods copied from talk-web
exports.gaEvent = (category, action, label, value) ->
window.ga? 'send',
hitType: 'event',
eventCategory: category,
eventAction: action,
eventLabel: label
eventValue: value
exports.gaTiming = (category, variable, value) ->
window... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/util/analytics.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/util/analytics.coffee | 1 | 40 |
jianliaoim/talk-os:talk-account/client/util/analytics.coffee:1:completion | completion | assign = require 'object-assign'
# methods copied from talk-web
exports.gaEvent = (category, action, label, value) ->
window.ga? 'send',
hitType: 'event',
eventCategory: category,
eventAction: action,
eventLabel: label
eventValue: value
exports.gaTiming = (category, variable, value) ->
window... | window.mixpanel?.track event, properties
exports.event = (category, action, label, value) ->
properties =
category: category
label: label
value: value
exports.mixpanel action, properties
exports.gaEvent category, action, label, value
# events
if typeof window isnt 'undefined'
window.mixpanel?.tim... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/util/analytics.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/util/analytics.coffee | 1 | 40 |
meltingice/psd.js:lib/psd/layer_info/text_elements.coffee:1:raw_corpus | raw_corpus | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class TextElements extends LayerInfo
@shouldParse: (key) -> key is 'TySh'
TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty']
COORDS_VALUE = ['left', 'top', 'right', 'bottom']
constructor: (layer, lengt... | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/text_elements.coffee | MIT | f2250837d1525a675bf6c607b0067769b461acac | 2,846 | https://github.com/meltingice/psd.js/blob/f2250837d1525a675bf6c607b0067769b461acac/lib/psd/layer_info/text_elements.coffee | 1 | 41 | ||
meltingice/psd.js:lib/psd/layer_info/text_elements.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class TextElements extends LayerInfo
@shouldParse: (key) -> key is 'TySh'
TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty']
COORDS_VALUE = ['left'... | var Descriptor, LayerInfo, TextElements;
LayerInfo = require('../layer_info.coffee');
Descriptor = require('../descriptor.coffee');
module.exports = TextElements = (function() {
var COORDS_VALUE, TRANSFORM_VALUE;
class TextElements extends LayerInfo {
static shouldParse(key) {
return key === 'TySh';
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/layer_info/text_elements.coffee | MIT | f2250837d1525a675bf6c607b0067769b461acac | 2,846 | https://github.com/meltingice/psd.js/blob/f2250837d1525a675bf6c607b0067769b461acac/lib/psd/layer_info/text_elements.coffee | 1 | 41 |
meltingice/psd.js:lib/psd/layer_info/text_elements.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Descriptor, LayerInfo, TextElements;
LayerInfo = require('../layer_info.coffee');
Descriptor = require('../descriptor.coffee');
module.exports = TextElements = (function() {
var COORDS_VALUE, TRANSFORM_VALUE;
class TextElements extends LayerInfo {
s... | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class TextElements extends LayerInfo
@shouldParse: (key) -> key is 'TySh'
TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty']
COORDS_VALUE = ['left', 'top', 'right', 'bottom']
constructor: (layer, lengt... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/text_elements.coffee | MIT | f2250837d1525a675bf6c607b0067769b461acac | 2,846 | https://github.com/meltingice/psd.js/blob/f2250837d1525a675bf6c607b0067769b461acac/lib/psd/layer_info/text_elements.coffee | 1 | 41 |
meltingice/psd.js:lib/psd/layer_info/text_elements.coffee:1:completion | completion | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class TextElements extends LayerInfo
@shouldParse: (key) -> key is 'TySh'
TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty']
COORDS_VALUE = ['left', 'top', 'right', 'bottom']
constructor: (layer, lengt... | @coords = {}
parse: ->
@version = @file.readShort()
for name, index in TRANSFORM_VALUE
@transform[name] = @file.readDouble()
@textVersion = @file.readShort()
@descriptorVersion = @file.readInt()
@textData = new Descriptor(@file).parse()
@warpVersion = @file.readShort()
@descrip... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/text_elements.coffee | MIT | f2250837d1525a675bf6c607b0067769b461acac | 2,846 | https://github.com/meltingice/psd.js/blob/f2250837d1525a675bf6c607b0067769b461acac/lib/psd/layer_info/text_elements.coffee | 1 | 41 |
meltingice/psd.js:lib/psd/layer_info/text_elements.coffee:1:raw_corpus | raw_corpus | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class TextElements extends LayerInfo
@shouldParse: (key) -> key is 'TySh'
TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty']
COORDS_VALUE = ['left', 'top', 'right', 'bottom']
constructor: (layer, lengt... | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/text_elements.coffee | MIT | 85af8e3bf48b6294bf407996fdd0891e0947d22b | 2,846 | https://github.com/meltingice/psd.js/blob/85af8e3bf48b6294bf407996fdd0891e0947d22b/lib/psd/layer_info/text_elements.coffee | 1 | 41 | ||
meltingice/psd.js:lib/psd/layer_info/text_elements.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class TextElements extends LayerInfo
@shouldParse: (key) -> key is 'TySh'
TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty']
COORDS_VALUE = ['left'... | var Descriptor, LayerInfo, TextElements;
LayerInfo = require('../layer_info.coffee');
Descriptor = require('../descriptor.coffee');
module.exports = TextElements = (function() {
var COORDS_VALUE, TRANSFORM_VALUE;
class TextElements extends LayerInfo {
static shouldParse(key) {
return key === 'TySh';
... | CoffeeScript | JavaScript | meltingice/psd.js | lib/psd/layer_info/text_elements.coffee | MIT | 85af8e3bf48b6294bf407996fdd0891e0947d22b | 2,846 | https://github.com/meltingice/psd.js/blob/85af8e3bf48b6294bf407996fdd0891e0947d22b/lib/psd/layer_info/text_elements.coffee | 1 | 41 |
meltingice/psd.js:lib/psd/layer_info/text_elements.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Descriptor, LayerInfo, TextElements;
LayerInfo = require('../layer_info.coffee');
Descriptor = require('../descriptor.coffee');
module.exports = TextElements = (function() {
var COORDS_VALUE, TRANSFORM_VALUE;
class TextElements extends LayerInfo {
s... | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class TextElements extends LayerInfo
@shouldParse: (key) -> key is 'TySh'
TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty']
COORDS_VALUE = ['left', 'top', 'right', 'bottom']
constructor: (layer, lengt... | JavaScript | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/text_elements.coffee | MIT | 85af8e3bf48b6294bf407996fdd0891e0947d22b | 2,846 | https://github.com/meltingice/psd.js/blob/85af8e3bf48b6294bf407996fdd0891e0947d22b/lib/psd/layer_info/text_elements.coffee | 1 | 41 |
meltingice/psd.js:lib/psd/layer_info/text_elements.coffee:1:completion | completion | LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class TextElements extends LayerInfo
@shouldParse: (key) -> key is 'TySh'
TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty']
COORDS_VALUE = ['left', 'top', 'right', 'bottom']
constructor: (layer, lengt... | @coords = {}
@parse() #lazy貌似没执行啊,手动执行下.
parse: ->
@version = @file.readShort()
for name, index in TRANSFORM_VALUE
@transform[name] = @file.readDouble()
@textVersion = @file.readShort()
@descriptorVersion = @file.readInt()
@textDate = new Descriptor(@file).parse()
@warpVersion =... | CoffeeScript | CoffeeScript | meltingice/psd.js | lib/psd/layer_info/text_elements.coffee | MIT | 85af8e3bf48b6294bf407996fdd0891e0947d22b | 2,846 | https://github.com/meltingice/psd.js/blob/85af8e3bf48b6294bf407996fdd0891e0947d22b/lib/psd/layer_info/text_elements.coffee | 1 | 41 |
jnordberg/wintersmith:src/plugins/page.coffee:1:raw_corpus | raw_corpus | replaceAll = (string, map) ->
re = new RegExp Object.keys(map).join('|'), 'gi'
return string.replace re, (match) -> map[match] | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 5 | 7 | ||
jnordberg/wintersmith:src/plugins/page.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
replaceAll = (string, map) ->
re = new RegExp Object.keys(map).join('|'), 'gi'
return string.replace re, (match) -> map[match]
``` | var replaceAll;
replaceAll = function(string, map) {
var re;
re = new RegExp(Object.keys(map).join('|'), 'gi');
return string.replace(re, function(match) {
return map[match];
});
}; | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 5 | 7 |
jnordberg/wintersmith:src/plugins/page.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var replaceAll;
replaceAll = function(string, map) {
var re;
re = new RegExp(Object.keys(map).join('|'), 'gi');
return string.replace(re, function(match) {
return map[match];
});
};
``` | replaceAll = (string, map) ->
re = new RegExp Object.keys(map).join('|'), 'gi'
return string.replace re, (match) -> map[match] | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 5 | 7 |
jnordberg/wintersmith:src/plugins/page.coffee:2:raw_corpus | raw_corpus | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 9 | 58 | ||
jnordberg/wintersmith:src/plugins/page.coffee:2:completion | completion | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | getFilename: ->
### Returns the filename for this page based on the filename template.
The default template (filenameTemplate config key) is ':file.html'.
Available variables:
:year - Full year from page.date
:month - Zero-padded month from page.date
:day ... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 9 | 58 |
jnordberg/wintersmith:src/plugins/page.coffee:3:raw_corpus | raw_corpus | output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category }}/:basename
output: otherdir/the-category/myfile.md
###
template = @filenameTemplate
dirname = path.dir... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 59 | 108 | ||
jnordberg/wintersmith:src/plugins/page.coffee:3:completion | completion | output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category }}/:basename
output: otherdir/the-category/myfile.md
###
template = @filenameTemplate
dirname = path.dir... | # eval code wrapped in double moustaches, use with care ;)
vm = ctx = null
filename = filename.replace /\{\{(.*?)\}\}/g, (match, code) =>
vm ?= require 'vm'
ctx ?= vm.createContext {env: env, page: this}
return vm.runInContext code, ctx
if filename[0] is '/'
# filename... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 59 | 108 |
jnordberg/wintersmith:src/plugins/page.coffee:4:raw_corpus | raw_corpus | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = env.config.introCutoffs or ['<span class="more', '<h2', '<hr']
idx = I... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 109 | 158 | ||
jnordberg/wintersmith:src/plugins/page.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = env.config.introCut... | ({
getHtml: function(base = env.config.baseUrl) {
/* return html with all urls resolved using *base* */
throw new Error('Not implemented.');
}
});
this.property('intro', 'getIntro');
({
getIntro: function(base) {
var cutoff, cutoffs, html, i, idx, j, len;
html = this.getHtml(base);
cutoffs =... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 109 | 158 |
jnordberg/wintersmith:src/plugins/page.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
getHtml: function(base = env.config.baseUrl) {
/* return html with all urls resolved using *base* */
throw new Error('Not implemented.');
}
});
this.property('intro', 'getIntro');
({
getIntro: function(base) {
var cutoff, cutoffs, html, i, id... | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = env.config.introCutoffs or ['<span class="more', '<h2', '<hr']
idx = I... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 109 | 158 |
jnordberg/wintersmith:src/plugins/page.coffee:4:completion | completion | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = env.config.introCutoffs or ['<span class="more', '<h2', '<hr']
idx = I... | @metadata.template or env.config.defaultTemplate or 'none'
@property 'title', ->
@metadata.title or 'Untitled'
@property 'date', ->
new Date(@metadata.date or 0)
@property 'rfc822date', ->
env.utils.rfc822(@date)
@property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/page.coffee | 109 | 158 |
jnordberg/wintersmith:src/plugins/page.coffee:4:raw_corpus | raw_corpus | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 87ae1dc38648ac88eaff2302d2d1c4c99b6561d7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/87ae1dc38648ac88eaff2302d2d1c4c99b6561d7/src/plugins/page.coffee | 109 | 158 | ||
jnordberg/wintersmith:src/plugins/page.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more... | ({
getHtml: function(base = env.config.baseUrl) {
/* return html with all urls resolved using *base* */
throw new Error('Not implemented.');
}
});
this.property('intro', 'getIntro');
({
getIntro: function(base) {
var cutoff, cutoffs, html, i, idx, j, len;
html = this.getHtml(base);
cutoffs =... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 87ae1dc38648ac88eaff2302d2d1c4c99b6561d7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/87ae1dc38648ac88eaff2302d2d1c4c99b6561d7/src/plugins/page.coffee | 109 | 158 |
jnordberg/wintersmith:src/plugins/page.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
getHtml: function(base = env.config.baseUrl) {
/* return html with all urls resolved using *base* */
throw new Error('Not implemented.');
}
});
this.property('intro', 'getIntro');
({
getIntro: function(base) {
var cutoff, cutoffs, html, i, id... | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 87ae1dc38648ac88eaff2302d2d1c4c99b6561d7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/87ae1dc38648ac88eaff2302d2d1c4c99b6561d7/src/plugins/page.coffee | 109 | 158 |
jnordberg/wintersmith:src/plugins/page.coffee:4:completion | completion | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | @metadata.template or env.config.defaultTemplate or 'none'
@property 'title', ->
@metadata.title or 'Untitled'
@property 'date', ->
new Date(@metadata.date or 0)
@property 'rfc822date', ->
env.utils.rfc822(@date)
@property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 87ae1dc38648ac88eaff2302d2d1c4c99b6561d7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/87ae1dc38648ac88eaff2302d2d1c4c99b6561d7/src/plugins/page.coffee | 109 | 158 |
jnordberg/wintersmith:src/plugins/page.coffee:2:raw_corpus | raw_corpus | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | a106ed3622145e76fe95d96c1e8d9a3e41743f97 | 3,484 | https://github.com/jnordberg/wintersmith/blob/a106ed3622145e76fe95d96c1e8d9a3e41743f97/src/plugins/page.coffee | 9 | 58 | ||
jnordberg/wintersmith:src/plugins/page.coffee:2:completion | completion | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | getFilename: ->
### Returns the filename for this page based on the filename template.
The default template (filenameTemplate config key) is ':file.html'.
Available variables:
:year - Full year from page.date
:month - Zero-padded month from page.date
:day ... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | a106ed3622145e76fe95d96c1e8d9a3e41743f97 | 3,484 | https://github.com/jnordberg/wintersmith/blob/a106ed3622145e76fe95d96c1e8d9a3e41743f97/src/plugins/page.coffee | 9 | 58 |
jnordberg/wintersmith:src/plugins/page.coffee:4:raw_corpus | raw_corpus | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 331e03343d9363bf0d92faaf7095208b8075d7c2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/331e03343d9363bf0d92faaf7095208b8075d7c2/src/plugins/page.coffee | 109 | 157 | ||
jnordberg/wintersmith:src/plugins/page.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more... | ({
getHtml: function(base = env.config.baseUrl) {
/* return html with all urls resolved using *base* */
throw new Error('Not implemented.');
}
});
this.property('intro', 'getIntro');
({
getIntro: function(base) {
var cutoff, cutoffs, html, i, idx, j, len;
html = this.getHtml(base);
cutoffs =... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 331e03343d9363bf0d92faaf7095208b8075d7c2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/331e03343d9363bf0d92faaf7095208b8075d7c2/src/plugins/page.coffee | 109 | 157 |
jnordberg/wintersmith:src/plugins/page.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
getHtml: function(base = env.config.baseUrl) {
/* return html with all urls resolved using *base* */
throw new Error('Not implemented.');
}
});
this.property('intro', 'getIntro');
({
getIntro: function(base) {
var cutoff, cutoffs, html, i, id... | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 331e03343d9363bf0d92faaf7095208b8075d7c2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/331e03343d9363bf0d92faaf7095208b8075d7c2/src/plugins/page.coffee | 109 | 157 |
jnordberg/wintersmith:src/plugins/page.coffee:4:completion | completion | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | @metadata.template or env.config.defaultTemplate or 'none'
@property 'title', ->
@metadata.title or 'Untitled'
@property 'date', ->
new Date(@metadata.date or 0)
@property 'rfc822date', ->
env.utils.rfc822(@date)
@property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 331e03343d9363bf0d92faaf7095208b8075d7c2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/331e03343d9363bf0d92faaf7095208b8075d7c2/src/plugins/page.coffee | 109 | 157 |
jnordberg/wintersmith:src/plugins/page.coffee:3:raw_corpus | raw_corpus | output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category }}/:basename
output: otherdir/the-category/myfile.md
###
template = @metadata.filename or env.config.filenameT... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 2046997cd7ed8f33b679c62cae4a5f5bc965f2da | 3,484 | https://github.com/jnordberg/wintersmith/blob/2046997cd7ed8f33b679c62cae4a5f5bc965f2da/src/plugins/page.coffee | 59 | 108 | ||
jnordberg/wintersmith:src/plugins/page.coffee:3:completion | completion | output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category }}/:basename
output: otherdir/the-category/myfile.md
###
template = @metadata.filename or env.config.filenameT... | # eval code wrapped in double moustaches, use with care ;)
vm = ctx = null
filename = filename.replace /\{\{(.*?)\}\}/g, (match, code) =>
vm ?= require 'vm'
ctx ?= vm.createContext {env: env, page: this}
return vm.runInContext code, ctx
if filename[0] is '/'
# filename... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 2046997cd7ed8f33b679c62cae4a5f5bc965f2da | 3,484 | https://github.com/jnordberg/wintersmith/blob/2046997cd7ed8f33b679c62cae4a5f5bc965f2da/src/plugins/page.coffee | 59 | 108 |
jnordberg/wintersmith:src/plugins/page.coffee:4:raw_corpus | raw_corpus | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 2046997cd7ed8f33b679c62cae4a5f5bc965f2da | 3,484 | https://github.com/jnordberg/wintersmith/blob/2046997cd7ed8f33b679c62cae4a5f5bc965f2da/src/plugins/page.coffee | 109 | 153 | ||
jnordberg/wintersmith:src/plugins/page.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more... | ({
getHtml: function(base = env.config.baseUrl) {
/* return html with all urls resolved using *base* */
throw new Error('Not implemented.');
}
});
this.property('intro', 'getIntro');
({
getIntro: function(base) {
var cutoff, cutoffs, html, i, idx, j, len;
html = this.getHtml(base);
cutoffs =... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 2046997cd7ed8f33b679c62cae4a5f5bc965f2da | 3,484 | https://github.com/jnordberg/wintersmith/blob/2046997cd7ed8f33b679c62cae4a5f5bc965f2da/src/plugins/page.coffee | 109 | 153 |
jnordberg/wintersmith:src/plugins/page.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
getHtml: function(base = env.config.baseUrl) {
/* return html with all urls resolved using *base* */
throw new Error('Not implemented.');
}
});
this.property('intro', 'getIntro');
({
getIntro: function(base) {
var cutoff, cutoffs, html, i, id... | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 2046997cd7ed8f33b679c62cae4a5f5bc965f2da | 3,484 | https://github.com/jnordberg/wintersmith/blob/2046997cd7ed8f33b679c62cae4a5f5bc965f2da/src/plugins/page.coffee | 109 | 153 |
jnordberg/wintersmith:src/plugins/page.coffee:4:completion | completion | getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<span class="more', '<h2', '<hr']
idx = Infinity
for cutoff in... | @property 'title', ->
@metadata.title or 'Untitled'
@property 'date', ->
new Date(@metadata.date or 0)
@property 'rfc822date', ->
env.utils.rfc822(@date)
@property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @getIntro()
@_hasMore ?= (@_html.length > @_intro.length)
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 2046997cd7ed8f33b679c62cae4a5f5bc965f2da | 3,484 | https://github.com/jnordberg/wintersmith/blob/2046997cd7ed8f33b679c62cae4a5f5bc965f2da/src/plugins/page.coffee | 109 | 153 |
jnordberg/wintersmith:src/plugins/page.coffee:3:raw_corpus | raw_corpus | output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category }}/:basename
output: otherdir/the-category/myfile.md
###
template = @metadata.filename or env.config.filenameT... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 60afc52438eaa3cdfe9e9a5fcd103da305dbc1b6 | 3,484 | https://github.com/jnordberg/wintersmith/blob/60afc52438eaa3cdfe9e9a5fcd103da305dbc1b6/src/plugins/page.coffee | 59 | 108 | ||
jnordberg/wintersmith:src/plugins/page.coffee:3:completion | completion | output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category }}/:basename
output: otherdir/the-category/myfile.md
###
template = @metadata.filename or env.config.filenameT... | # eval code wrapped in double moustaches, use with care ;)
vm = ctx = null
filename = filename.replace /\{\{(.*?)\}\}/g, (match, code) =>
vm ?= require 'vm'
ctx ?= vm.createContext {env: env, page: this}
return vm.runInContext code, ctx
if filename[0] is '/'
# filename... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 60afc52438eaa3cdfe9e9a5fcd103da305dbc1b6 | 3,484 | https://github.com/jnordberg/wintersmith/blob/60afc52438eaa3cdfe9e9a5fcd103da305dbc1b6/src/plugins/page.coffee | 59 | 108 |
jnordberg/wintersmith:src/plugins/page.coffee:2:raw_corpus | raw_corpus | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 20e9ad7e46e9cae0b2d579464515d58a24552ff2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/20e9ad7e46e9cae0b2d579464515d58a24552ff2/src/plugins/page.coffee | 9 | 58 | ||
jnordberg/wintersmith:src/plugins/page.coffee:2:completion | completion | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | class Page extends env.ContentPlugin
### Page base class, a page is content that has metadata, html and a template that renders it ###
constructor: (@filepath, @metadata) ->
getFilename: ->
### Returns the filename for this page based on the filename template.
The default template (filenam... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 20e9ad7e46e9cae0b2d579464515d58a24552ff2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/20e9ad7e46e9cae0b2d579464515d58a24552ff2/src/plugins/page.coffee | 9 | 58 |
jnordberg/wintersmith:src/plugins/page.coffee:3:raw_corpus | raw_corpus | template: :file.html (default)
output: somedir/myfile.html
template: /:year/:month/:day/index.html
output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category ... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 20e9ad7e46e9cae0b2d579464515d58a24552ff2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/20e9ad7e46e9cae0b2d579464515d58a24552ff2/src/plugins/page.coffee | 59 | 108 | ||
jnordberg/wintersmith:src/plugins/page.coffee:3:completion | completion | template: :file.html (default)
output: somedir/myfile.html
template: /:year/:month/:day/index.html
output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category ... | ':file': file
':ext': ext
':basename': basename
':dirname': dirname
# eval code wrapped in double moustaches, use with care ;)
vm = ctx = null
filename = filename.replace /\{\{(.*?)\}\}/g, (match, code) =>
vm ?= require 'vm'
ctx ?= vm.createContext {env: env, p... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 20e9ad7e46e9cae0b2d579464515d58a24552ff2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/20e9ad7e46e9cae0b2d579464515d58a24552ff2/src/plugins/page.coffee | 59 | 108 |
jnordberg/wintersmith:src/plugins/page.coffee:4:raw_corpus | raw_corpus | ### Page specific properties ###
@property 'html', 'getHtml'
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<spa... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 20e9ad7e46e9cae0b2d579464515d58a24552ff2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/20e9ad7e46e9cae0b2d579464515d58a24552ff2/src/plugins/page.coffee | 109 | 157 | ||
jnordberg/wintersmith:src/plugins/page.coffee:4:completion | completion | ### Page specific properties ###
@property 'html', 'getHtml'
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved using *base* ###
throw new Error 'Not implemented.'
@property 'intro', 'getIntro'
getIntro: (base) ->
html = @getHtml(base)
cutoffs = ['<spa... | @property 'title', ->
@metadata.title or 'Untitled'
@property 'date', ->
new Date(@metadata.date or 0)
@property 'rfc822date', ->
env.utils.rfc822(@date)
@property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @getIntro()
@_hasMore ?= (@_html.length > @_intro.length)
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 20e9ad7e46e9cae0b2d579464515d58a24552ff2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/20e9ad7e46e9cae0b2d579464515d58a24552ff2/src/plugins/page.coffee | 109 | 157 |
jnordberg/wintersmith:src/plugins/page.coffee:3:raw_corpus | raw_corpus | template: :file.html (default)
output: somedir/myfile.html
template: /:year/:month/:day/index.html
output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category ... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | fad8b93e2ef9e436bd1207ef64f973fba5a0c1d5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/fad8b93e2ef9e436bd1207ef64f973fba5a0c1d5/src/plugins/page.coffee | 59 | 108 | ||
jnordberg/wintersmith:src/plugins/page.coffee:3:completion | completion | template: :file.html (default)
output: somedir/myfile.html
template: /:year/:month/:day/index.html
output: 2001/02/03/index.html
template: :year-:title.html
output: somedir/2001-slugified-title.html
template: /otherdir/{{ page.metadata.category ... | ':file': file
':ext': ext
':basename': basename
':dirname': dirname
# eval code wrapped in double moustaches, use with care ;)
vm = ctx = null
filename = filename.replace /\{\{(.*?)\}\}/g, (match, code) =>
vm ?= require 'vm'
ctx ?= vm.createContext {env: env, p... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | fad8b93e2ef9e436bd1207ef64f973fba5a0c1d5 | 3,484 | https://github.com/jnordberg/wintersmith/blob/fad8b93e2ef9e436bd1207ef64f973fba5a0c1d5/src/plugins/page.coffee | 59 | 108 |
jnordberg/wintersmith:src/plugins/page.coffee:1:raw_corpus | raw_corpus | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 863c740d7ccd666acb7a51c67ee54d62ea1ccd5e | 3,484 | https://github.com/jnordberg/wintersmith/blob/863c740d7ccd666acb7a51c67ee54d62ea1ccd5e/src/plugins/page.coffee | 4 | 53 | ||
jnordberg/wintersmith:src/plugins/page.coffee:1:completion | completion | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | class Page extends env.ContentPlugin
### Page base class, a page is content that has metadata, html and a template that renders it ###
constructor: (@filepath, @metadata) ->
getFilename: ->
regularFilename = =>
path.join path.dirname(@filepath.relative), @basename
permalinkFilename =... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 863c740d7ccd666acb7a51c67ee54d62ea1ccd5e | 3,484 | https://github.com/jnordberg/wintersmith/blob/863c740d7ccd666acb7a51c67ee54d62ea1ccd5e/src/plugins/page.coffee | 4 | 53 |
jnordberg/wintersmith:src/plugins/page.coffee:2:raw_corpus | raw_corpus | getUrl: (base) ->
# remove index.html for prettier links
super(base).replace /index\.html$/, ''
getView: ->
@metadata.view or 'template'
### Page specific properties ###
@property 'html', 'getHtml'
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved us... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 863c740d7ccd666acb7a51c67ee54d62ea1ccd5e | 3,484 | https://github.com/jnordberg/wintersmith/blob/863c740d7ccd666acb7a51c67ee54d62ea1ccd5e/src/plugins/page.coffee | 54 | 103 | ||
jnordberg/wintersmith:src/plugins/page.coffee:2:completion | completion | getUrl: (base) ->
# remove index.html for prettier links
super(base).replace /index\.html$/, ''
getView: ->
@metadata.view or 'template'
### Page specific properties ###
@property 'html', 'getHtml'
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved us... | return html.substr 0, idx
else
return html
### Template property used by the 'template' view ###
@property 'template', ->
@metadata.template or env.config.defaultTemplate or 'none'
@property 'title', ->
@metadata.title or 'Untitled'
@property 'date', ->
new Date(@metad... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 863c740d7ccd666acb7a51c67ee54d62ea1ccd5e | 3,484 | https://github.com/jnordberg/wintersmith/blob/863c740d7ccd666acb7a51c67ee54d62ea1ccd5e/src/plugins/page.coffee | 54 | 103 |
jnordberg/wintersmith:src/plugins/page.coffee:3:raw_corpus | raw_corpus | @_intro ?= @getIntro()
@_hasMore ?= (@_html.length > @_intro.length)
return @_hasMore
# add the page plugin to the env since other plugins might want to subclass it
# and we are not registering it as a plugin itself
env.plugins.Page = Page
# register the template view used by the page plugin
env... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 863c740d7ccd666acb7a51c67ee54d62ea1ccd5e | 3,484 | https://github.com/jnordberg/wintersmith/blob/863c740d7ccd666acb7a51c67ee54d62ea1ccd5e/src/plugins/page.coffee | 104 | 115 | ||
jnordberg/wintersmith:src/plugins/page.coffee:3:completion | completion | @_intro ?= @getIntro()
@_hasMore ?= (@_html.length > @_intro.length)
return @_hasMore
# add the page plugin to the env since other plugins might want to subclass it
# and we are not registering it as a plugin itself | env.plugins.Page = Page
# register the template view used by the page plugin
env.registerView 'template', templateView
callback() | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 863c740d7ccd666acb7a51c67ee54d62ea1ccd5e | 3,484 | https://github.com/jnordberg/wintersmith/blob/863c740d7ccd666acb7a51c67ee54d62ea1ccd5e/src/plugins/page.coffee | 104 | 115 |
jnordberg/wintersmith:src/plugins/page.coffee:1:raw_corpus | raw_corpus | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 59af0cf22cd44c5c2fe6f24f9830103bd5cefa79 | 3,484 | https://github.com/jnordberg/wintersmith/blob/59af0cf22cd44c5c2fe6f24f9830103bd5cefa79/src/plugins/page.coffee | 4 | 53 | ||
jnordberg/wintersmith:src/plugins/page.coffee:1:completion | completion | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | class Page extends env.ContentPlugin
### Page base class, a page is content that has metadata, html and a template that renders it ###
constructor: (@filepath, @metadata) ->
getFilename: ->
regularFilename = =>
path.join path.dirname(@filepath.relative), @basename
permalinkFilename =... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 59af0cf22cd44c5c2fe6f24f9830103bd5cefa79 | 3,484 | https://github.com/jnordberg/wintersmith/blob/59af0cf22cd44c5c2fe6f24f9830103bd5cefa79/src/plugins/page.coffee | 4 | 53 |
jnordberg/wintersmith:src/plugins/page.coffee:2:raw_corpus | raw_corpus | getUrl: (base) ->
# remove index.html for prettier links
super(base).replace /index\.html$/, ''
getView: ->
@metadata.view or 'template'
### Page specific properties ###
@property 'html', 'getHtml'
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved us... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 59af0cf22cd44c5c2fe6f24f9830103bd5cefa79 | 3,484 | https://github.com/jnordberg/wintersmith/blob/59af0cf22cd44c5c2fe6f24f9830103bd5cefa79/src/plugins/page.coffee | 54 | 103 | ||
jnordberg/wintersmith:src/plugins/page.coffee:2:completion | completion | getUrl: (base) ->
# remove index.html for prettier links
super(base).replace /index\.html$/, ''
getView: ->
@metadata.view or 'template'
### Page specific properties ###
@property 'html', 'getHtml'
getHtml: (base=env.config.baseUrl) ->
### return html with all urls resolved us... | return html.substr 0, idx
else
return html
### Template property used by the 'template' view ###
@property 'template', ->
@metadata.template or env.config.defaultTemplate or 'none'
@property 'title', ->
@metadata.title or 'Untitled'
@property 'date', ->
new Date(@metad... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 59af0cf22cd44c5c2fe6f24f9830103bd5cefa79 | 3,484 | https://github.com/jnordberg/wintersmith/blob/59af0cf22cd44c5c2fe6f24f9830103bd5cefa79/src/plugins/page.coffee | 54 | 103 |
jnordberg/wintersmith:src/plugins/page.coffee:3:raw_corpus | raw_corpus | @property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @getIntro()
@_hasMore ?= (@_html.length > @_intro.length)
return @_hasMore
# add the page plugin to the env since other plugins might want to subclass it
# and we are not registering it as a plugin itself
env.plugins.Page = Page
#... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 59af0cf22cd44c5c2fe6f24f9830103bd5cefa79 | 3,484 | https://github.com/jnordberg/wintersmith/blob/59af0cf22cd44c5c2fe6f24f9830103bd5cefa79/src/plugins/page.coffee | 104 | 118 | ||
jnordberg/wintersmith:src/plugins/page.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @getIntro()
@_hasMore ?= (@_html.length > @_intro.length)
return @_hasMore
# add the page plugin to the env since other plugins might want to subclass it
# and we are not registe... | this.property('hasMore', function() {
if (this._html == null) {
this._html = this.getHtml();
}
if (this._intro == null) {
this._intro = this.getIntro();
}
if (this._hasMore == null) {
this._hasMore = this._html.length > this._intro.length;
}
return this._hasMore;
});
// add the page plugin to... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 59af0cf22cd44c5c2fe6f24f9830103bd5cefa79 | 3,484 | https://github.com/jnordberg/wintersmith/blob/59af0cf22cd44c5c2fe6f24f9830103bd5cefa79/src/plugins/page.coffee | 104 | 118 |
jnordberg/wintersmith:src/plugins/page.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.property('hasMore', function() {
if (this._html == null) {
this._html = this.getHtml();
}
if (this._intro == null) {
this._intro = this.getIntro();
}
if (this._hasMore == null) {
this._hasMore = this._html.length > this._intro.length;
}... | @property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @getIntro()
@_hasMore ?= (@_html.length > @_intro.length)
return @_hasMore
# add the page plugin to the env since other plugins might want to subclass it
# and we are not registering it as a plugin itself
env.plugins.Page = Page
#... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 59af0cf22cd44c5c2fe6f24f9830103bd5cefa79 | 3,484 | https://github.com/jnordberg/wintersmith/blob/59af0cf22cd44c5c2fe6f24f9830103bd5cefa79/src/plugins/page.coffee | 104 | 118 |
jnordberg/wintersmith:src/plugins/page.coffee:3:completion | completion | @property 'hasMore', ->
@_html ?= @getHtml()
@_intro ?= @getIntro()
@_hasMore ?= (@_html.length > @_intro.length)
return @_hasMore
# add the page plugin to the env since other plugins might want to subclass it | # and we are not registering it as a plugin itself
env.plugins.Page = Page
# register the template view used by the page plugin
env.registerView 'template', templateView
callback() | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 59af0cf22cd44c5c2fe6f24f9830103bd5cefa79 | 3,484 | https://github.com/jnordberg/wintersmith/blob/59af0cf22cd44c5c2fe6f24f9830103bd5cefa79/src/plugins/page.coffee | 104 | 118 |
jnordberg/wintersmith:src/plugins/page.coffee:1:raw_corpus | raw_corpus | module.exports = (env, callback) ->
templateView = (env, locals, contents, templates, callback) ->
### Content view that expects content to have a @template instance var that
matches a template in *templates*. Calls *callback* with output of template
or null if @template is set to 'none'. ###
... | CoffeeScript | jnordberg/wintersmith | src/plugins/page.coffee | MIT | 8419d8107319d194d18a81bf81009dc65d78ddd2 | 3,484 | https://github.com/jnordberg/wintersmith/blob/8419d8107319d194d18a81bf81009dc65d78ddd2/src/plugins/page.coffee | 4 | 53 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.