From: Matt Price <moptop99@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: remedial elisp: treating result of plist-get as a string
Date: Mon, 15 Jun 2015 14:55:36 -0400 [thread overview]
Message-ID: <CAN_Dec8PYQTp3o0Unz9qwha09V4pnVOthwuyc36Wvwn1=tJp7Q@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2378 bytes --]
Hi,
I'm looking at some old code Erik Hetzner wrote for me in January.
I have an html string stored in a plist cell, and a function that converts
an html string to org-mode syntax. I want to do something like this:
(org-zotxt-htmlstring2org (plist-get item :citation-html))
But for whatever reason this doesn't produce a string. It might help to
give a little context -- this is a very dirty hack intended to get
zotero-beased bibliographies to display in ODT documents. I have no doubt
there are better methods for this, but I am currently trying this:
;; zotxt
(org-add-link-type "zotero"
(lambda (rest)
(zotxt-select-key (substring rest 15)))
(lambda (path desc format)
(if (string-match "^@\\(.*\\)$" desc)
(cond ((eq format 'latex)
(format "\\cite{%s}" (match-string 1 desc)))
((eq format 'md)
desc)
((eq format 'html)
(deferred:$
(zotxt-get-item-bibliography-deferred
`(:key , (substring path 15)))
(deferred:nextc it
(lambda (item)
(plist-get item :citation-html)))
(deferred:sync! it)))
((eq format 'odt)
(deferred:$
(zotxt-get-item-bibliography-deferred
`(:key , (substring path 15)))
(deferred:nextc it
(lambda (item)
(org-zotxt-htmlstring2org (plist-get
item :citation-html)) ))
(deferred:sync! it)))
(t nil)
nil))))
-----------
The html export is working perfectly well, but I am trying to get
/something/ to display in odt export, and failing. (I realize that a
further step will be required, namely, sending the org-mode string
generated by org-zotxt-htmlstring2org through the odt export filter -- I
don't have the faintest idea how to do that but am assuming it's
possible).
Hints appreciated, as always.
Matt
[-- Attachment #2: Type: text/html, Size: 3408 bytes --]
reply other threads:[~2015-06-15 18:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAN_Dec8PYQTp3o0Unz9qwha09V4pnVOthwuyc36Wvwn1=tJp7Q@mail.gmail.com' \
--to=moptop99@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.