emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [New Exporter] deriving from derived backends?
@ 2013-03-11 18:33 Rick Frankel
  2013-03-12 13:15 ` Bastien
  2013-03-15 20:26 ` Nicolas Goaziou
  0 siblings, 2 replies; 4+ messages in thread
From: Rick Frankel @ 2013-03-11 18:33 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas-

I am trying to derive a backend from another derived backend (i want
to override certain entries in the options-alist), but it does not
seem to work. The menu entries are created, but the in the
second-level derived backend are not being picked up.

Should this work? Or do i need a different approach?

here's abbreviated code:

(org-export-define-derived-backend s5 html
  :menu-entry
  (?s "Export to S5 HTML Presentation"
      ((?H "To temporary buffer" org-s5-export-as-html)
       (?h "To file" org-s5-export-to-html)
       (?o "To file and open"
	   (lambda (a s v b)
	     (if a (org-s5-export-to-html t s v b)
	       (org-open-file (org-s5-export-to-html nil s v b)))))))
  :options-alist
  [...]


;; this is the full exporter definition
(org-export-define-derived-backend s5-xoxo s5
  :menu-entry
  (?s "Export to S5 HTML Presentation"
      ((?X "To temporary buffer (XOXO)" org-s5-export-as-html)
       (?x "To file (XOXO)" org-s5-export-to-html)
       (?O "To file and open (XOXO)"
	   (lambda (a s v b)
	     (if a (org-s5-export-to-html t s v b)
	       (org-open-file (org-s5-export-to-html nil s v b)))))))
  :options-alist
  ((:html-container nil nil "li") ;; this is defined in the html backend
  ;; this is new to this backend
   (:s5-xoxo-root "S5_XOXO_ROOT" nil org-s5-xoxo-root-element)))

If i use e.g., s-X or s-x in the exporter menu,
in exporter functions, :html-container == "div" (which is set in the
html exporter), and :s5-xoxo-root is nil.

tia,
rick

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

* Re: [New Exporter] deriving from derived backends?
  2013-03-11 18:33 [New Exporter] deriving from derived backends? Rick Frankel
@ 2013-03-12 13:15 ` Bastien
  2013-03-12 19:38   ` Rick Frankel
  2013-03-15 20:26 ` Nicolas Goaziou
  1 sibling, 1 reply; 4+ messages in thread
From: Bastien @ 2013-03-12 13:15 UTC (permalink / raw)
  To: Rick Frankel; +Cc: emacs-orgmode

Hi Rick,

Rick Frankel <rick@rickster.com> writes:

> If i use e.g., s-X or s-x in the exporter menu,
> in exporter functions, :html-container == "div" (which is set in the
> html exporter), and :s5-xoxo-root is nil.

Do you have `org-s5-xoxo-root-element' defined somewhere in your file?

HTH,

-- 
 Bastien

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

* Re: [New Exporter] deriving from derived backends?
  2013-03-12 13:15 ` Bastien
@ 2013-03-12 19:38   ` Rick Frankel
  0 siblings, 0 replies; 4+ messages in thread
From: Rick Frankel @ 2013-03-12 19:38 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode@gnu.org

Yes. 

On Mar 12, 2013, at 9:15 AM, Bastien <bzg@altern.org> wrote:

> Hi Rick,
> 
> Rick Frankel <rick@rickster.com> writes:
> 
>> If i use e.g., s-X or s-x in the exporter menu,
>> in exporter functions, :html-container == "div" (which is set in the
>> html exporter), and :s5-xoxo-root is nil.
> 
> Do you have `org-s5-xoxo-root-element' defined somewhere in your file?
> 
> HTH,
> 
> -- 
> Bastien

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

* Re: [New Exporter] deriving from derived backends?
  2013-03-11 18:33 [New Exporter] deriving from derived backends? Rick Frankel
  2013-03-12 13:15 ` Bastien
@ 2013-03-15 20:26 ` Nicolas Goaziou
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2013-03-15 20:26 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Rick Frankel <rick@rickster.com> writes:

> I am trying to derive a backend from another derived backend (i want
> to override certain entries in the options-alist), but it does not
> seem to work. The menu entries are created, but the in the
> second-level derived backend are not being picked up.
>
> Should this work? Or do i need a different approach?
>
> here's abbreviated code:
>
> (org-export-define-derived-backend s5 html
>   :menu-entry
>   (?s "Export to S5 HTML Presentation"
>       ((?H "To temporary buffer" org-s5-export-as-html)
>        (?h "To file" org-s5-export-to-html)
>        (?o "To file and open"
> 	   (lambda (a s v b)
> 	     (if a (org-s5-export-to-html t s v b)
> 	       (org-open-file (org-s5-export-to-html nil s v b)))))))
>   :options-alist
>   [...]
>
>
> ;; this is the full exporter definition
> (org-export-define-derived-backend s5-xoxo s5
>   :menu-entry
>   (?s "Export to S5 HTML Presentation"
>       ((?X "To temporary buffer (XOXO)" org-s5-export-as-html)
>        (?x "To file (XOXO)" org-s5-export-to-html)
>        (?O "To file and open (XOXO)"
> 	   (lambda (a s v b)
> 	     (if a (org-s5-export-to-html t s v b)
> 	       (org-open-file (org-s5-export-to-html nil s v b)))))))
>   :options-alist
>   ((:html-container nil nil "li") ;; this is defined in the html backend
>   ;; this is new to this backend
>    (:s5-xoxo-root "S5_XOXO_ROOT" nil org-s5-xoxo-root-element)))
>
> If i use e.g., s-X or s-x in the exporter menu,
> in exporter functions, :html-container == "div" (which is set in the
> html exporter), and :s5-xoxo-root is nil.

You are using the same key: ?s for both back-ends in the menu. You need
to use different keys, or install one of them as a sub-menu of the
previous one (notice the "1" instead of the description):

 (org-export-define-derived-backend s5-xoxo s5
   :menu-entry
   (?s 1
       ((?X "To temporary buffer (XOXO)" org-s5-export-as-html)
        (?x "To file (XOXO)" org-s5-export-to-html)
        (?O "To file and open (XOXO)"
 	   (lambda (a s v b)
 	     (if a (org-s5-export-to-html t s v b)
 	       (org-open-file (org-s5-export-to-html nil s v b)))))))
   :options-alist
   ((:html-container nil nil "li") ;; this is defined in the html backend
   ;; this is new to this backend
    (:s5-xoxo-root "S5_XOXO_ROOT" nil org-s5-xoxo-root-element)))


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2013-03-15 20:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 18:33 [New Exporter] deriving from derived backends? Rick Frankel
2013-03-12 13:15 ` Bastien
2013-03-12 19:38   ` Rick Frankel
2013-03-15 20:26 ` Nicolas Goaziou

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).