Re: [O] HTML export and Zotero-friendly headers

2011-11-23 Thread Christian Moe

On 11/23/11 5:45 PM, Erik L. Arneson wrote:

Thanks, that looks like a good start!


Let me know how it went.

Christian




Re: [O] HTML export and Zotero-friendly headers

2011-11-23 Thread Erik L. Arneson
On Wed, 23 Nov 2011, Christian Moe wrote:
> Does Org document header data include more than author, title, date, 
> description and keywords. So I'd be inclined to go with Dublin Core 
> for this, and just twin the ordinary META tags (which Zotero doesn't 
> bother with, probably wisely) with DC equivalents.

I haven't played around with the Dublin Core tags yet, but I'll give
this a try and see how it works.

> Doing it as below, with a hook at the end of html export, is more than 
> a little clumsy, but it will do for testing purposes. If people think 
> it's a good idea to do this in HTML exports on a permanent basis, a 
> non-clumsy version could be patched into org-export-as-html.

Thanks, that looks like a good start!

-- 
Erik L. Arneson 
  GPG Key ID : 1024D/62DA1D25   BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
  Office : +1.541.291.9776Skype : callto://pymander
   http://www.leisurenouveau.com/ http://www.transformason.org/




Re: [O] HTML export and Zotero-friendly headers

2011-11-23 Thread Christian Moe

On 11/22/11 3:44 PM, Erik L. Arneson wrote:

Do I then understand correctly that what you want to do is simply to
generate one COinS snippet with metadata about the document itself
(author, title, etc.)?


Yes, though it doesn't need to be only COinS.  Zotero supports a number
of different formats, but COinS looks like it may be the easiest and the
most concise.



Hi,

Does Org document header data include more than author, title, date, 
description and keywords. So I'd be inclined to go with Dublin Core 
for this, and just twin the ordinary META tags (which Zotero doesn't 
bother with, probably wisely) with DC equivalents.


Doing it as below, with a hook at the end of html export, is more than 
a little clumsy, but it will do for testing purposes. If people think 
it's a good idea to do this in HTML exports on a permanent basis, a 
non-clumsy version could be patched into org-export-as-html.


#+begin_src elisp
  (defun org-export-with-dc ()
   "Add Dublin Core metadata from Org document headers to exported
  HTML. Comma-separated keywords and multiple authors separated
  with ` and ' will be correctly imported into Zotero. Note: For
  testing purposes only. It is only called as a hook from
  org-export-as-html, where it gets TITLE, DATE, AUTHOR,
  DESCRIPTION, and KEYWORDS values."
   (let ((creators (split-string author " and "))
 (subjects (split-string keywords ", ?"))
 fdate)
 (when (string-match "[0-9]+-[0-9]+-[0-9]+" date)
   (setq fdate (match-string 0 date)))
 (goto-char (point-min))
 (when (re-search-forward "")
   (goto-char (match-beginning 0))
   (while creators
 (insert
  (format "\n"
  (car creators)))
 (setq creators (cdr creators)))
   (insert
(format
 "
  
  \n"
 title fdate description))
   (while subjects
 (insert
  (format "\n"
  (car subjects)))
 (setq subjects (cdr subjects))


  (add-hook 'org-export-html-final-hook 'org-export-with-dc)
#+end_src

Yours,
Christian




Re: [O] HTML export and Zotero-friendly headers

2011-11-22 Thread Christian Moe

Hi, Adam Smith,

You're repeating my misunderstanding -- that's not what he's looking 
for, see the thread above.


Christian

On 11/22/11 7:35 PM, adam.smith wrote:



Yes, though it doesn't need to be only COinS.  Zotero supports a number
of different formats, but COinS looks like it may be the easiest and the
most concise.


You're aware that bibliographies exported as HTML from Zotero already
contain COinS?











Re: [O] HTML export and Zotero-friendly headers

2011-11-22 Thread adam . smith

> Yes, though it doesn't need to be only COinS.  Zotero supports a number
> of different formats, but COinS looks like it may be the easiest and the
> most concise.
> 
You're aware that bibliographies exported as HTML from Zotero already 
contain COinS?







Re: [O] HTML export and Zotero-friendly headers

2011-11-22 Thread Erik L. Arneson
On Tue, 22 Nov 2011, Christian Moe wrote:
> Hi,
>
> Then I misunderstood you, sorry about the noise (to both Eriks, A. and
> H.). I thought you meant including Zotero-readable metadata for each
> citation in the Org document.

No problem.  I tried to be clear, but obviously I wasn't.  :)

> Do I then understand correctly that what you want to do is simply to
> generate one COinS snippet with metadata about the document itself
> (author, title, etc.)?

Yes, though it doesn't need to be only COinS.  Zotero supports a number
of different formats, but COinS looks like it may be the easiest and the
most concise.

-- 
Erik L. Arneson 
  GPG Key ID : 1024D/62DA1D25   BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
  Office : +1.541.291.9776Skype : callto://pymander
   http://www.leisurenouveau.com/ http://www.transformason.org/




Re: [O] HTML export and Zotero-friendly headers

2011-11-22 Thread Christian Moe

Hi,

Then I misunderstood you, sorry about the noise (to both Eriks, A. and 
H.). I thought you meant including Zotero-readable metadata for each 
citation in the Org document.


Do I then understand correctly that what you want to do is simply to 
generate one COinS snippet with metadata about the document itself 
(author, title, etc.)?


Yours,
Christian



On 11/21/11 10:14 PM, Erik L. Arneson wrote:


I thought zotero-plain was used to add citations.  What I'm trying to do
is use org-mode to export HTML files with Zotero-friendly headers that
the Zotero plugin will pick-up on in the browser.

I can make the COinS  snippets myself using the tool available on
the COinS website, but it would be handy if org-mode could do that
automatically using the org header data that already exists.





Re: [O] HTML export and Zotero-friendly headers

2011-11-21 Thread Erik Hetzner
At Mon, 21 Nov 2011 13:14:02 -0800,
Erik L. Arneson wrote:
> 
> On Mon, 21 Nov 2011, Christian Moe wrote:
> > Hi,
> >
> > Does Erik Hetzner's zotero-plain work for you?
> 
> I thought zotero-plain was used to add citations.  What I'm trying to do
> is use org-mode to export HTML files with Zotero-friendly headers that
> the Zotero plugin will pick-up on in the browser.
> 
> I can make the COinS  snippets myself using the tool available on
> the COinS website, but it would be handy if org-mode could do that
> automatically using the org header data that already exists.

Hi Erik,

There has been some discussion recently of export to ODT with
citations. Jambunathan K has outlined a way of doing this using a
binary added to zotero-plain, zotcite. This might be repurposed for an
HTML export.

best, Erik

Sent from my free software system .


Re: [O] HTML export and Zotero-friendly headers

2011-11-21 Thread Erik L. Arneson
On Mon, 21 Nov 2011, Christian Moe wrote:
> Hi,
>
> Does Erik Hetzner's zotero-plain work for you?

I thought zotero-plain was used to add citations.  What I'm trying to do
is use org-mode to export HTML files with Zotero-friendly headers that
the Zotero plugin will pick-up on in the browser.

I can make the COinS  snippets myself using the tool available on
the COinS website, but it would be handy if org-mode could do that
automatically using the org header data that already exists.

-- 
Erik L. Arneson 
  GPG Key ID : 1024D/62DA1D25   BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
  Office : +1.541.291.9776Skype : callto://pymander
   http://www.leisurenouveau.com/ http://www.transformason.org/




Re: [O] HTML export and Zotero-friendly headers

2011-11-21 Thread Christian Moe

Hi,

Does Erik Hetzner's zotero-plain work for you?

If so, I'd try this experiment: set zotero-default-bibliography-style 
to "COinS". Then insert a citation in Org using zotero-plain. In the 
link description, instead of a nicely formatted bibliographic 
reference, I imagine you should get the COinS data.


If that works, zotero-plain could be very easily extended with a 
function to insert COinS data for all items in zotero links, and it 
could be run as a hook on HTML export.


It hasn't worked for me lately, so I can't try the experiment myself.

Yours,
Christian


On 11/21/11 7:19 PM, Erik L. Arneson wrote:

Howdy,

I've just stumbled across Zotero and have been reading about how folks
are working to integrate it with org-mode, but from what I've read so
far, all of the work has been on the citation end.

Has anybody pursued creating Zotero-friendly headers/metadata in HTML
exports?  I use org-mode to manage a few websites and it would be handy
to have the HTML snippets generated automatically.  It looks like both
COinS[1] and Dublin Core are fairly straightforward.



I'm looking forward to hearing if anybody has done anything with this
yet.

Thanks,

Erik

Footnotes:
[1]  http://ocoins.info/






[O] HTML export and Zotero-friendly headers

2011-11-21 Thread Erik L. Arneson
Howdy,

I've just stumbled across Zotero and have been reading about how folks
are working to integrate it with org-mode, but from what I've read so
far, all of the work has been on the citation end.

Has anybody pursued creating Zotero-friendly headers/metadata in HTML
exports?  I use org-mode to manage a few websites and it would be handy
to have the HTML snippets generated automatically.  It looks like both
COinS[1] and Dublin Core are fairly straightforward.

I'm looking forward to hearing if anybody has done anything with this
yet.

Thanks,

Erik

Footnotes: 
[1]  http://ocoins.info/

-- 
Erik L. Arneson 
  GPG Key ID : 1024D/62DA1D25   BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
  Office : +1.541.291.9776Skype : callto://pymander
   http://www.leisurenouveau.com/ http://www.transformason.org/