emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [ODT] [BUG?] Custom links are formatted as for html
@ 2011-11-12 19:33 Christian Moe
  2011-11-12 21:24 ` Jambunathan K
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Moe @ 2011-11-12 19:33 UTC (permalink / raw)
  To: Jambunathan K, Org Mode

Hi, Jambunathan,

When I try to define a custom link type with special formatting for 
ODT export, the exporter behaves as if the backend is html.

I'll exemplify with a tweaked version of org-bbdb-export, since that's 
the textbook example of a custom link. I've rewritten it below so that 
if the export FORMAT is 'odt, BBDB links should be in bold.

(defun org-bbdb-export (path desc format)
   "Create the export version of a BBDB link specified by PATH or DESC.
If exporting to either HTML or LaTeX FORMAT the link will be
italicized, in ODT it's bold, in all other cases it is left unchanged."
   (when (string= desc (format "bbdb:%s" path))
     (setq desc path))
   (cond
    ((eq format 'html) (format "<i>%s</i>" desc))
    ((eq format 'latex) (format "\\textit{%s}" desc))
    ((eq format 'odt) (format "<text:span 
text:style-name=\"Bold\">%s</text:span>" desc))
    (t desc)))

Now, when I export this:

    Here's my own address (bbdb:Moe).

...the ODT document does not contain the expected:

    Here's my own address (<text:span 
text:style-name=\"Bold\">Moe</text:span>).

...instead, it contains the formatting intended for HTML:

    Here's my own address (<i>Moe</i>).

...which, of course, displays as:

    Here's my own address ().


Yours,
Christian

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

* Re: [ODT] [BUG?] Custom links are formatted as for html
  2011-11-12 19:33 [ODT] [BUG?] Custom links are formatted as for html Christian Moe
@ 2011-11-12 21:24 ` Jambunathan K
  2011-11-12 22:28   ` Christian Moe
  0 siblings, 1 reply; 3+ messages in thread
From: Jambunathan K @ 2011-11-12 21:24 UTC (permalink / raw)
  To: mail; +Cc: Org Mode


Hello Christian

Christian Moe <mail@christianmoe.com> writes:
> Hi, Jambunathan,
>
> When I try to define a custom link type with special formatting for
> ODT export, the exporter behaves as if the backend is html.

I have pushed a fix for this. Note that I haven't modified org-bbdb yet.

ps: If I extrapolate this issue further, it looks like I have to audit
contrib modules and see what changes I need to bring over to ODT.

Jambunathan K.
-- 

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

* Re: [ODT] [BUG?] Custom links are formatted as for html
  2011-11-12 21:24 ` Jambunathan K
@ 2011-11-12 22:28   ` Christian Moe
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Moe @ 2011-11-12 22:28 UTC (permalink / raw)
  To: Jambunathan K; +Cc: Org Mode

On 11/12/11 10:24 PM, Jambunathan K wrote:
>> When I try to define a custom link type with special formatting for
>> ODT export, the exporter behaves as if the backend is html.
>
> I have pushed a fix for this. Note that I haven't modified org-bbdb yet.

Hi,

I confirm that it's fixed. Thanks!

Just to be clear, I only used org-bbdb as an example, I wasn't 
planning to change it (but what I *was* trying to do with custom links 
and ODT was a bit too involved for a minimal example). (And I did not 
mean to imply that changing it is your job.)

Yours,
Christian

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

end of thread, other threads:[~2011-11-12 22:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-12 19:33 [ODT] [BUG?] Custom links are formatted as for html Christian Moe
2011-11-12 21:24 ` Jambunathan K
2011-11-12 22:28   ` Christian Moe

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