all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)]
@ 2013-06-13  6:24 Tassilo Horn
  2013-06-13  8:50 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Tassilo Horn @ 2013-06-13  6:24 UTC (permalink / raw)
  To: emacs-orgmode


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

Hi all,

lately, I've used ox-reveal.el to create a presentation.  Thereby, I
found out that inline source code blocks are ignored, i.e., the text is
simply not there in the HTML5 output.

Here's a test heading:

--8<---------------cut here---------------start------------->8---
* Test Heading

  - Here's some inline code: src_clojure{(+ 1 2 3)}
  - Here's some more inline code: src_clojure{(- 1 2 3)}
--8<---------------cut here---------------end--------------->8---


ox-reveal.el derives the export from ox-html.  That defines

    (inline-src-block . org-html-inline-src-block)

with

--8<---------------cut here---------------start------------->8---
(defun org-html-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)))
    (error "Cannot export inline src block")))
--8<---------------cut here---------------end--------------->8---

and ox-reveal doesn't (yet) override that.  So in theory, exporting the
entry above should signal an error, but it doesn't

I also tried the plain html export.  Still, there's no error.  The
function is simply not called at all.

So there seems to be a bug in the exporter which doesn't seem to
recognize inline source code.

That said, I've never used inline source blocks before, so maybe I'm
doing something wrong.  On the one hand, the manual is pretty clear on
their syntax.  But on the other hand, they aren't highlighted in the org
buffer...

Bye,
Tassilo

Emacs  : GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.2)
 of 2013-06-12 on thinkpad
Package: Org-mode version 8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)

current state:
==============
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe
		      org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 outline-minor-mode-hook '(th-outline-minor-mode-init)
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-gnus-prefer-web-links t
 org-special-ctrl-k t
 org-occur-hook '(org-first-headline-recenter)
 org-src-tab-acts-natively t
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-log-done 'time
 org-confirm-shell-link-function 'yes-or-no-p
 org-complete-tags-always-offer-all-agenda-tags t
 org-id-link-to-org-use-id t
 org-columns-default-format "%50ITEM %TODO %ALLTAGS %SCHEDULED %DEADLINE"
 org-export-date-timestamp-format "%Y-%m-%d"
 org-agenda-restore-windows-after-quit t
 org-special-ctrl-a/e 'reversed
 org-agenda-custom-commands '(("n" "Next 21 days" agenda "" ((org-agenda-span 21)))
			      ("^" "Calfw Month Calendar" th-calfw-open-calendar))
 org-return-follows-link t
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-agenda-time-leading-zero t
 org-capture-templates '(("n" "NORMAL" entry (file "/home/horn/Repos/org/remember.org")
			  "* %?\n  :PROPERTIES:\n  :created: %U\n  :link: %a\n  :END:\n	%i")
			 ("t" "TODO" entry (file "/home/horn/Repos/org/remember.org")
			  "* TODO %?\n  :PROPERTIES:\n  :created: %U\n  :link: %a\n  :END:\n  %i")
			 ("i" "IDEA" entry (file "/home/horn/Repos/org/remember.org")
			  "* IDEA %?\n  :PROPERTIES:\n  :created: %U\n  :link: %a\n  :END:\n  %i")
			 )
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-icalendar-include-body 100
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
		     org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-export-copy-to-kill-ring t
 org-mode-hook '(th-org-mode-init
		 #[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook org-show-block-all append local]
		   5]
		 #[nil "\300\301\302\303\304$\207"
		   [org-add-hook change-major-mode-hook org-babel-show-result-all append
		    local]
		   5]
		 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-refile-targets '((org-agenda-files :maxlevel . 5))
 org-attach-method 'mv
 org-export-with-tags 'not-in-toc
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-refile-use-outline-path 'file
 org-reveal-title-slide-template "<h2>%t</h2>\n<br style=\"clear:both;\" />\n<h2>%a</h2>\n<h3>%e</h3>\n<h2>%d</h2>"
 org-directory "/home/horn/Repos/org"
 org-enforce-todo-dependencies t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
		  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
		  org-optimize-window-after-visibility-change)
 org-attach-directory "/home/horn/Repos/org/attachments"
 org-archive-default-command 'org-archive-set-tag
 org-refile-allow-creating-parent-nodes 'confirm
 org-export-with-drawers nil
 org-todo-keywords '((sequence "TODO(t)" "STARTED(s)" "DELEGATED(g)" "IDEA(i)" "|"
		      "DONE(d)" "CANCELLED(c)")
		     )
 org-modules '(org-icalendar org-attach org-protocol org-id org-bibtex org-docview
	       org-gnus org-info org-irc org-capture org-mobile)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-log-into-drawer "LOGBOOK"
 org-icalendar-store-UID t
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-mobile-directory "~/Dropbox/MobileOrg"
 org-agenda-mode-hook '(th-org-agenda-mode-init)
 org-agenda-files '("/home/horn/Repos/org")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-link-frame-setup '((vm . vm-visit-folder) (gnus . org-gnus-no-new-news)
			(file . find-file-other-window))
 org-icalendar-combined-description nil
 org-mobile-inbox-for-pull "~/Repos/org/from-org-mobile.org"
 org-src-fontify-natively t
 )

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

* Re: Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)]
  2013-06-13  6:24 Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)] Tassilo Horn
@ 2013-06-13  8:50 ` Nicolas Goaziou
  2013-06-13 10:02   ` Tassilo Horn
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2013-06-13  8:50 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode

Hello,

Tassilo Horn <tsdh@gnu.org> writes:

> lately, I've used ox-reveal.el to create a presentation.  Thereby, I
> found out that inline source code blocks are ignored, i.e., the text is
> simply not there in the HTML5 output.
>
> Here's a test heading:
>
> * Test Heading
>
>   - Here's some inline code: src_clojure{(+ 1 2 3)}
>   - Here's some more inline code: src_clojure{(- 1 2 3)}
>
>
> ox-reveal.el derives the export from ox-html.  That defines
>
>     (inline-src-block . org-html-inline-src-block)
>
> with
>
> (defun org-html-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)))
>     (error "Cannot export inline src block")))
>
> and ox-reveal doesn't (yet) override that.  So in theory, exporting the
> entry above should signal an error, but it doesn't
>
> I also tried the plain html export.  Still, there's no error.  The
> function is simply not called at all.
>
> So there seems to be a bug in the exporter which doesn't seem to
> recognize inline source code.

There's no bug. Babel simply removes all inline source blocks when
executing source blocks. Hence, they cannot be parsed (and therefore
exported).

This function is just a placeholder for now.


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)]
  2013-06-13  8:50 ` Nicolas Goaziou
@ 2013-06-13 10:02   ` Tassilo Horn
  2013-06-13 13:06     ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Tassilo Horn @ 2013-06-13 10:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> There's no bug. Babel simply removes all inline source blocks when
> executing source blocks. Hence, they cannot be parsed (and therefore
> exported).
>
> This function is just a placeholder for now.

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.

Bye,
Tassilo

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

* Re: Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)]
  2013-06-13 10:02   ` Tassilo Horn
@ 2013-06-13 13:06     ` Eric Schulte
  2013-06-14  7:26       ` Tassilo Horn
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2013-06-13 13:06 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode, Nicolas Goaziou

Tassilo Horn <tsdh@gnu.org> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> There's no bug. Babel simply removes all inline source blocks when
>> executing source blocks. Hence, they cannot be parsed (and therefore
>> exported).
>>
>> This function is just a placeholder for now.
>
> 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.
| 
| [back]
`----

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

Thanks,

>
> Bye,
> Tassilo
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)]
  2013-06-13 13:06     ` Eric Schulte
@ 2013-06-14  7:26       ` Tassilo Horn
  0 siblings, 0 replies; 5+ messages in thread
From: Tassilo Horn @ 2013-06-14  7:26 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode, Nicolas Goaziou

Eric Schulte <schulte.eric@gmail.com> 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

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

end of thread, other threads:[~2013-06-14  7:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13  6:24 Bug: Exporter omits inline code blocks [8.0.3 (release_8.0.3-238-g172061 @ /home/horn/Repos/el/org-mode/lisp/)] Tassilo Horn
2013-06-13  8:50 ` Nicolas Goaziou
2013-06-13 10:02   ` Tassilo Horn
2013-06-13 13:06     ` Eric Schulte
2013-06-14  7:26       ` Tassilo Horn

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.