Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create "headless" node firepad module for exporting html from the server-side. #126

Closed
mikelehen opened this issue May 6, 2014 · 0 comments · Fixed by #127
Closed

Create "headless" node firepad module for exporting html from the server-side. #126

mikelehen opened this issue May 6, 2014 · 0 comments · Fixed by #127

Comments

@mikelehen
Copy link
Collaborator

At minimum, I'd like a node module that can get the current HTML for your Firepad.

var Firepad = require('firepad');
var firepad = new Firepad(new Firebase('https://YOUR.firebaseio.com/firepad/'));
firepad.getHtml(function(html) {
  console.log(html);
});

But preferably it'd support as much of the firepad API as we can (ready, getHtml / setHtml, etc.). E.g.:

var firepad = Firepad.headless(new Firebase('https://YOUR.firebaseio.com/firepad/'));
firepad.on('ready', function() {
  var oldHtml = firepad.getHtml();
  firepad.setHtml('<b>This is the new thing.</b>');
});

One semi-hacky approach is to do what Clément did here to get CodeMirror / a full DOM working inside Node: http://stackoverflow.com/questions/23498656/firepad-fetch-and-save-the-content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant