-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add new blocks to layout.pug and base for links * Add main tag to index template * Add extra fields to make index script * Add midline to REPL styles * Remove header style breaking REPL * Add new REPL template * Move REPL styles to Less
- Loading branch information
1 parent
6cbafb0
commit 85811c1
Showing
10 changed files
with
161 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
extends layout.pug | ||
|
||
block main | ||
article!= readme | ||
main.container | ||
article!= readme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
html.repl-page | ||
, html.repl-page > body | ||
{ | ||
background-color: #282a36; | ||
height: 100%; | ||
} | ||
|
||
.ramda-repl-wrapper { | ||
height: 100%; | ||
padding-top: 3.7em; | ||
} | ||
|
||
.repl-midline { | ||
background-color: #44475a; | ||
bottom: 0; | ||
left: 50%; | ||
position: absolute; | ||
top: 0; | ||
width: 2px; | ||
z-index: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var fs = require('fs') | ||
|
||
var pug = require('pug') | ||
|
||
var version = require('./package.json').devDependencies.ramda | ||
|
||
|
||
var make_html = pug.compileFile('repl/index.pug') | ||
|
||
var html = make_html({ | ||
html_class: 'repl-page', | ||
page: 'repl', | ||
version: version | ||
}) | ||
|
||
fs.writeFileSync('repl/index.html', html, {encoding: 'utf8'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
document.addEventListener('DOMContentLoaded', function () { | ||
// Regex for matching version strings | ||
// Example match: "0.21.123" | ||
var rx = /^\d+\.\d+(\.\d+)?$/ | ||
|
||
// :: String, String -> String | ||
function toVersion (acc, pair) { | ||
var splitPair = pair.split('=') | ||
|
||
return splitPair[0] === 'v' && rx.test(splitPair[1]) ? splitPair[1] : acc | ||
} | ||
|
||
var version = location.search.substr(1).split('&').reduce(toVersion, 'latest') | ||
|
||
var ramdaUrl = '//cdn.jsdelivr.net/ramda/' + version + '/ramda.min.js' | ||
|
||
|
||
ramdaRepl(document.querySelector('.ramda-repl-target'), { | ||
apiUrl: 'https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyDhbAvT5JqkxFPkoeezJp19-S_mAJudxyk', | ||
|
||
// If unset, initialValue will use the value or textcontent of the | ||
// target element. | ||
initialValue: URI.decode(window.location.hash).substring(2), | ||
|
||
// Called with the pre-compiled content | ||
onChange: function (code) { | ||
window.location.hash = '?' + URI.encode(code) | ||
}, | ||
|
||
// The following config defines scripts that will be dynamically | ||
// loaded upon creating the REPL. Each has the following properties: | ||
// | ||
// src - The source of the script, a URL | ||
// global - (Optional) a name of a global that the script introduces | ||
// exposeAs - (Optional) a name that can alias the global | ||
// expose - (Optional) a list of methods to expose globally | ||
|
||
// Required. | ||
// As ramda may be a dependency for other scripts, it will | ||
// be intentionally loaded before any other script. | ||
ramdaScript: { | ||
global: 'R', | ||
src: ramdaUrl | ||
}, | ||
|
||
returnUrl: 'http://ramdajs.com/repl/', | ||
|
||
// Optional. | ||
// Here we can declare a list of libraries that we wish to have | ||
// loaded and exposed in the repl. | ||
scripts: [ | ||
{ | ||
exposeAs: 'S', | ||
global: 'sanctuary', | ||
src: '//wzrd.in/standalone/sanctuary@latest' | ||
}, | ||
{ | ||
expose: [ | ||
'Either', | ||
'Future', | ||
'Identity', | ||
'IO', | ||
'lift2', | ||
'lift3', | ||
'Maybe', | ||
'Reader', | ||
'Tuple' | ||
], | ||
global: 'ramdaFantasy', | ||
src: '//wzrd.in/standalone/ramda-fantasy@latest' | ||
} | ||
] | ||
}) | ||
}, false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
extends ../layout.pug | ||
|
||
block main | ||
.ramda-repl-wrapper | ||
textarea.ramda-repl-target | ||
|
||
block scripts | ||
script(src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.18.1/URI.min.js") | ||
script(src="https://cdn.rawgit.com/ramda/repl/master/dist/bundle.js") | ||
script(src="index.js") | ||
|
||
block styles | ||
link(href="https://cdn.rawgit.com/ramda/repl/master/dist/bundle.css" rel="stylesheet") |