Git Product home page Git Product logo

ob-browser's Introduction

Org Babel Browser - Render HTML in org-mode

Do you want to write HTML blocks in org-mode and have them automagically rendered as screenshots? Yes, I thought so. Me too. Here we go…

Demo

<!DOCTYPE html>
<html>
    <head>
        <link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet" media="screen">
    </head>
    <body>
        <div class="row">
            <div class="span6 offset1">
                <h1>Rendered PNG</h1>
                
                <button class="btn btn-primary">You Can't Press This</button>
            </div>
        </div>
    </body>
</html>

Installation

Prerequisite

You must have PhantomJS installed on your machine and available on the Emacs env path. I do something like this:

From the terminal:

sudo port install phantomjs

In .emacs:

(add-to-list 'exec-path "/opt/local/bin")
(setenv "PATH" (mapconcat 'identity exec-path ":"))

Then

If you’re hooked up to MELPA:

M-x package-refresh-contents
M-x package-install RET ob-browser

Options

Each block supports the following arguments:

ArgumentDescriptionExample
:outOutput filename.#+BEGIN_SRC browser :out demo.png

The :out argument is mandatory. The file format will be chosen automatically based on the extension, and may be any of:

  • .png
  • .gif
  • .jpg
  • .pdf

ob-browser's People

Contributors

krisajenkins avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ob-browser's Issues

can images be used?

I'm only getting alt-text for images. Curious if this is on my end, or a limitation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.