Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #53 by introducing a new node.js module called
web-renderer
. This simple module takes html input from stdin, renders it after waiting some time for javascript to run, takes a screenshot of the output, and then crops the screenshot to eliminate extra whitespace. The resulting PNG image is written to stdout.jupyter-org-client
has also been modified to support a new result type: web results. The idea is that passingraw
for html content will render it using the new module.Many improvements need to be made before this is good, but I think the basic idea works.
A few notes:
js
directory now has a Makefile that calls thewidget
Makefile and theweb-renderer
Makefile.cask package
, install usingpackage-install-file
, and then use the new feature. I've added the entireweb-renderer
module directory to theCask
file, so when Cask is used to build the package,node_modules
is copied into the archive. This works for local installation, but it could be a problem if the archive built by Cask is going to go on Melpa. I think I might need to excludenode_modules
and instead make surenpm install
is run on theweb-renderer
module during the package installation or the first time the user tries to use the new feature.application/javascript
MIME type. I think we would just need to insert the code inside of a<script>
tag inside the template we already have.In the future, web results could also insert an xwidget in order to actually run javascript code in emacs as discussed in #135