Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (77 sloc) 3.33 KB
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link href="" rel="stylesheet">
<meta name="viewport" content="width=device-width,initial-scale=1">
<style type="text/css">
body {
padding: 20px;
pre {
margin-top: 10px;
<h4>JavaScript library for interacting with WebPipes.</h4>
<p>WebPipes are tiny HTTP programs that do one thing and do it well. They fill in the gaps. Need a proxy? Need to convert Markdown to HTML? Give a WebPipe some input, and it'll give you some output. They're a handy tool to have in your arsenal.</p>
<p><a href="">Learn more at &rarr;</a></p>
<h2>Usage Example</h2>
<p>WebPipe.js exposes two methods: <code>webpipe.options()</code> and <code>webpipe.execute()</code>.</p>
<p>Click run below each example to see the result. Edit the code and test it again.</p>
<h3>webpipe.options(url, callback)</h3>
<p>This is a convenience function that returns the JSON descriptor for the WebPipe in question.</p>
<pre id="options-input" contenteditable>var blockURL = "";
webpipe.options(blockURL, function (err, data) {
if (err) {
console.log("Error: ", err);
} else {
// Prints the webpipe.json config for the Parse Markdown webpipe.
<div><button id="options-button" class="btn btn-inverse btn-small">Run</button></div>
<pre id="options-output"></pre>
<h3>webpipe.execute(url, inputs, callback)</h3>
<p>The real workhorse is <code>webpipe.execute()</code>. This handles the dirty work of executing a WebPipe.</p>
<pre id="execute-input" contenteditable>var blockURL = "";
webpipe.execute(blockURL, { markdown: "*hello world*" }, function (err, data) {
if (err) {
console.log("Error: ", err);
} else {
// Prints the outputs of the WebPipe.
<div><button id="execute-button" class="btn btn-inverse btn-small">Run</button></div>
<pre id="execute-output"></pre>
<script src=""></script>
<script src="../../lib/webpipe.js"></script>
function initExample(name) {
$("#"+name+"-button").click(function() {
try {
fn = new Function("console", $("#"+name+"-input").text());
fn({ log: function(arg) {
for (var i = 0; i < arguments.length; i++) {
var string = typeof arguments[i] === "string" ? arguments[i] : JSON.stringify(arguments[i], null, 2);
$("#"+name+"-output").text($("#"+name+"-output").text() + string);
} catch (e) {
$(function() {