emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to evaluate javascript in code blocks
@ 2013-01-01 19:55 dougie smith
  2013-01-02  5:13 ` Thomas S. Dye
  0 siblings, 1 reply; 2+ messages in thread
From: dougie smith @ 2013-01-01 19:55 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

i'm a very new user to orgmode- loving it!
currently using it with clojure and with clojurescript.

i have installed nodejs
not sure what to do next

do i need an 'ob.javascript file?

can't seem to find any docs.

TIA

-dougie

[-- Attachment #2: Type: text/html, Size: 386 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to evaluate javascript in code blocks
  2013-01-01 19:55 how to evaluate javascript in code blocks dougie smith
@ 2013-01-02  5:13 ` Thomas S. Dye
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas S. Dye @ 2013-01-02  5:13 UTC (permalink / raw)
  To: dougie smith; +Cc: emacs-orgmode

dougie smith <dsv2xm@gmail.com> writes:
> i have installed nodejs
> not sure what to do next
>
> do i need an 'ob.javascript file?
>
> can't seem to find any docs.

AFAIK, the only documentation is in the file ob-js.el.  Back in 2011,
Eric Schulte welcomed patches to ob-js.el to support sessions with
node.  I don't think there has been any subsequent work on this front.

You'll need something like this in .emacs:

(org-babel-do-load-languages
 'org-babel-load-languages
 '((js . t)))

If you evaluate the following source code block, you can look at
localhost:8888 and see Hello World.  But, emacs is fully engaged until
you press Ctrl-G.

#+begin_src js :tangle hello.js
var http = require("http");

http.createServer(function(request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.write("Hello World");
  response.end();
}).listen(8888);
#+end_src

hth,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-02  5:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-01 19:55 how to evaluate javascript in code blocks dougie smith
2013-01-02  5:13 ` Thomas S. Dye

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).