emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238


From: Tassilo Horn
Subject: Re: [O] Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)]
Date: Fri, 14 Jun 2013 09:26:16 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Eric Schulte <address@hidden> writes:

Hi Eric,

>> Aha.  I've used source blocks only for the markup especially when
>> exporting until now.  And the manual states that inline code blocks
>> are not different to normal code blocks, just being inline.  So
>> that's at least unexpected behavior, and the manual should be updated
>> accordingly.
>
> They are treated just like code blocks, however they have different
> default header arguments.
>
> ,----[org-babel-default-inline-header-args]
> | org-babel-default-inline-header-args is a variable defined in `ob-core.el'.
> | Its value is ((:session . "none")
> |  (:results . "replace")
> |  (:exports . "results"))
> | 
> | 
> | Documentation:
> | Default arguments to use when evaluating an inline source block.
> `----

Ah, thanks.

> If you'd like to propose a patch to the manual which makes this clear,
> I'm happy to apply it.

First, I have to understand this a bit better.  Now I've set

(setq org-babel-default-inline-header-args '((:session . "none")
                                             (:results . "replace")
                                             (:exports . "code")))

in order to export the code.  But the result is that in the exported
html (org-reveal) document I get

--8<---------------cut here---------------start------------->8---
#+BEGIN<sub>SRC</sub> clojure
(+ 1 2 3) ;=&gt; 6
#+END<sub>SRC</sub>
--8<---------------cut here---------------end--------------->8---

And the corresponding export function which would do the intended thing
still isn't called.

--8<---------------cut here---------------start------------->8---
(org-export-define-derived-backend 'reveal 'html
  ;...
  :translate-alist
  '(;...
    (inline-src-block . org-reveal-inline-src-block)
    ;...)
  :export-block "REVEAL"
  )

(defun org-reveal-inline-src-block (inline-src-block contents info)
  "Transcode an INLINE-SRC-BLOCK element from Org to HTML.
CONTENTS holds the contents of the item.  INFO is a plist holding
contextual information."
  (let* ((org-lang (org-element-property :language inline-src-block))
         (code (org-element-property :value inline-src-block)))
    (format "<code class=\"src src-%s\">%s</code>" org-lang code)))
--8<---------------cut here---------------end--------------->8---

where `code' becomes the inline code with its markup.

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]