#+OPTIONS: H:3 num:nil toc:3 \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:nil skip:nil d:(HIDE) tags:not-in-toc
#+STARTUP: align fold nodlcheck hidestars oddeven lognotestate hideblocks
#+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
#+TAGS: Write(w) Update(u) Fix(f) Check(c) noexport(n)
#+TITLE: Babel: Languages
#+AUTHOR: Eric Schulte, Dan Davison, Tom Dye
#+EMAIL: schulte.eric at gmail dot com, davison at stats dot ox dot ac dot uk, tsd at tsdye dot com
#+LANGUAGE: en
#+STYLE:
#+STYLE:
#+STYLE:
#+LINK_UP: index.php
#+LINK_HOME: http://orgmode.org/worg/
* Babel Languages
:PROPERTIES:
:CUSTOM_ID: langs
:END:
Note: Many languages in this table still require documentation. A
template is provided [[http://orgmode.org/w/?p=worg.git;a=blob;f=org-contrib/babel/languages/ob-doc-template.org;hb=HEAD][in the worg git repository]] for the addition of
language documentation.
#+Caption: Babel has support for the following languages.
| Language | Documentation | Identifier | Requirements |
|----------------+----------------------+-----------------+---------------------------------------------|
| Asymptote | | asymptote | [[http://asymptote.sourceforge.net/][asymptote]], [[http://asymptote.sourceforge.net/doc/Editing-modes.html][asy-mode]] |
| Awk | | awk | Awk |
| C | [[file:languages/ob-doc-C.org][ob-doc-C]] | c | none |
| C++ | [[file:languages/ob-doc-C.org][ob-doc-C]] | cpp | none |
| Calc | | calc | none |
| Clojure | [[file:languages/ob-doc-clojure.org][ob-doc-clojure]] | clojure | [[http://clojure.org/][clojure]], [[http://www.emacswiki.org/emacs/clojure-mode.el][clojure-mode]], [[http://common-lisp.net/project/slime/][slime]], [[http://clojure.codestuffs.com/][swank-clojure]] |
| CSS | | css | none |
| Ditaa | | ditaa | [[http://ditaa.org/ditaa/][ditaa]] (bundled with Org-mode) |
| Dot (Graphviz) | | dot | [[http://www.graphviz.org/][dot]] |
| Emacs Lisp | | emacs-lisp | none |
| Fomus | | fomus (contrib) | [[http://fomus.sourceforge.net/][fomus (music notation)]] |
| Fortran | | F90 | fortran |
| Gnuplot | [[file:languages/ob-doc-gnuplot.org][ob-doc-gnuplot]] | gnuplot | [[http://www.gnuplot.info/][gnuplot]], [[http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html][gnuplot-mode]] |
| Haskell | | haskell | [[http://www.haskell.org/][haskell]], [[http://projects.haskell.org/haskellmode-emacs/][haskell-mode]], [[http://www.haskell.org/haskellwiki/Haskell_mode_for_Emacs#inf-haskell.el:_the_best_thing_since_the_breadknife][inf-haskell]], [[http://people.cs.uu.nl/andres/lhs2tex/][lhs2tex]] |
| Java | | java | java |
| Javascript | | js | [[http://nodejs.org/][node.js]] |
| LaTeX | [[file:languages/ob-doc-LaTeX.org][ob-doc-latex]] | latex | [[http://www.latex-project.org/][latex]], [[http://www.gnu.org/software/auctex/][auctex]], [[http://www.gnu.org/software/auctex/reftex.html][reftex]] |
| Ledger | [[file:languages/ob-doc-ledger.org][ob-doc-ledger]] | ledger | [[http://wiki.github.com/jwiegley/ledger/][ledger]] |
| Lilypond | [[file:languages/ob-doc-lilypond.org][ob-doc-lilypond]] | ly | [[http://lilypond.org/][lilypond music notation]] |
| Lisp | | lisp | [[http://common-lisp.net/project/slime/][slime]] |
| Matlab | [[file:languages/ob-doc-octave-matlab.org][ob-doc-octave-matlab]] | matlab | matlab, [[http://sourceforge.net/projects/matlab-emacs/][matlab.el]] |
| Maxima | | max | maxima |
| Mscgen | [[file:languages/ob-doc-mscgen.org][ob-doc-mscgen]] | mscgen | [[http://www.mcternan.me.uk/mscgen/][Mscgen]] |
| Objective Caml | | ocaml | [[http://caml.inria.fr/][ocaml]], [[http://www-rocq.inria.fr/~acohen/tuareg/][tuareg-mode]] |
| Octave | [[file:languages/ob-doc-octave-matlab.org][ob-doc-octave-matlab]] | octave | octave |
| Org | | org | none |
| OZ | [[file:languages/ob-doc-oz.org][ob-doc-oz]] | oz (contrib) | [[http://www.mozart-oz.org/][Mozart]] which includes a major mode |
| Perl | | perl | [[http://www.perl.org/][perl]], [[http://www.emacswiki.org/emacs/CPerlMode][cperl-mode]] (optional) |
| Picolisp | [[file:languages/ob-doc-picolisp.org][ob-doc-picolisp]] | picolisp | [[http://picolisp.com/5000/!wiki?home][PicoLisp]] |
| PlantUML | | plantuml | |
| Python | | python | [[http://www.python.org/][python]], [[https://launchpad.net/python-mode][python-mode]] (optional) |
| R | [[file:languages/ob-doc-R.org][ob-doc-R]] | R | [[http://www.r-project.org/][R]], [[http://ess.r-project.org/][ess-mode]], [[http://cran.r-project.org/web/packages/tikzDevice/index.html][tikzDevice]] |
| Ruby | | ruby | [[http://www.ruby-lang.org/][ruby]], [[http://www.ruby-lang.org/][irb]], [[http://github.com/eschulte/rinari/raw/master/util/ruby-mode.el][ruby-mode]], [[http://github.com/eschulte/rinari/raw/master/util/inf-ruby.el][inf-ruby mode]] |
| Sass | | sass | [[http://sass-lang.com/][sass]], [[http://github.com/nex3/haml/blob/master/extra/sass-mode.el][sass-mode]] |
| Scheme | | scheme | none |
| Shen | | shen | shen |
| shell | | sh | a shell |
| SQL | | sql | none |
| Sqlite | | sqlite | none |
* Configure active languages
:PROPERTIES:
:CUSTOM_ID: configure
:END:
To add support for a particular language to your Babel installation
first make sure that the requirements of the language are met, then
you may customize the =org-babel-load-languages= variable, update the
variable's value manually by adding[fn:1]
: (lang . t)
to its definition. A line like the following to explicitly /remove/
support for a language.
: (lang . nil)
Here is an example manual configuration of this variable, which
enables support for =R=, and disables support for =emacs-lisp=.
#+begin_src emacs-lisp :exports code
;; active Babel languages
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)
(emacs-lisp . nil)
))
#+end_src
* Develop support for new languages
:PROPERTIES:
:CUSTOM_ID: develop
:END:
The core Babel functions (viewing, export, tangling, etc...) are
language agnostic and will work even for languages that are not
explicitly supported. Explicit language-specific support is required
only for evaluation of code blocks in a language.
Babel is designed to be easily extended to support new languages.
Language support is added by defining language-specific functions
using a simple naming convention. The full suite of possible language
specific functions need not be implemented all at once, but rather it
is possible (and encouraged) to develop language-specific
functionality in an incremental fashion -- Babel will make use of
those functions which are available, and will fail gracefully when
functionality has not yet been implemented.
There is a short Emacs Lisp template ([[http://orgmode.org/w/worg.git/blob/HEAD:/org-contrib/babel/ob-template.el][ob-template.el]]) which can be used as
a starting point for implementing support for new languages. Developers
are encouraged to read the [[file:~/install/git/worg/org-contribute.org][Org-mode contribution instructions]] in the hope
that the language support can be included into the Org-mode core.
* Footnotes
[fn:1] languages in the contrib directory are marked with "(contrib)"
in the "Identifier" section above are not loadable through the
=org-babel-do-load-languages= variable, but rather must be
explicitly required (e.g. =(require 'ob-oz)=) after the contrib
directory has been added to you load path.