On Sat, 1 Aug 2015, Satoru KURASHIKI wrote:

hi,

I've tried to write babel extension for typescript.
cf. https://github.com/lurdan/ob-typescript

Because "results: code" forces same language in results,
it outputs transpile results enclosed with #BEGIN_SRC js #END_SRC
assuming "results: raw".

I want it to do this with more sane way (not disturbing header parameters),
are there any nice tweaks?

Not sure what you mean about 'disturbing header parameters', but using

        :wrap src <lang>

where <lang> is the resulting language will fontify suitably.

For example, this shell script:

#+BEGIN_SRC shell :wrap src emacs-lisp
echo "(format fmt abc) ;; alphabet"
#+END_SRC

produces this result:

#+RESULTS:
#+BEGIN_src emacs-lisp
(format fmt abc) ;; alphabet
#+END_src

Perhaps, you want `org-babel-default-header-args:typescript' to include
(:wrap . "src js") and drop (:results . "raw").

HTH,

Chuck

Reply via email to