From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: HTML --> Org-mode? Date: Tue, 27 Jan 2015 06:55:45 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11342dde663fa4050da0ef66 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG4kH-0001Q9-2v for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 06:55:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YG4kF-0002NG-9Q for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 06:55:49 -0500 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]:53799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YG4kE-0002N8-TG for emacs-orgmode@gnu.org; Tue, 27 Jan 2015 06:55:47 -0500 Received: by mail-lb0-f172.google.com with SMTP id l4so12674980lbv.3 for ; Tue, 27 Jan 2015 03:55:46 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Willem Rein Oudshoorn , Org Mode --001a11342dde663fa4050da0ef66 Content-Type: text/plain; charset=UTF-8 Thank you Willem, This looks very helpful. I am trying the code out in a scratch buffer and I am unable to gnerate org syntax, e.g. with this test string: (h-2-o-insert-org-source-for-html "

hello world
foo

" ) Am I doing something wrong? Thanks, Matt On Tue, Jan 27, 2015 at 3:23 AM, Willem Rein Oudshoorn wrote: > Matt Price writes: > > > Hmm, > > > > Looks like I asked this about a year ago and didn't follow up on it. > Does > > anyone know a way to generate org-mode syntax from an html string? I > would > > like to extend zotxt slightly (see my last post) and at present zotxt can > > pull citations 7 bibliography entries from Zotero only in plain-text and > > HTML form. The plaintext form loses information, so I would like to > > translate the HTML into org-mode syntax. > > > > Since this would have to happen in the context of an > > > > (org-add-link-type ) > > > > invocation, it would be best if this could be done directly in emacs > > somehow... > > > > Thanks as always, > > Not sure if this helps, but I recently hacked some code to convert a > simple subset of HTML to org. It is quite hackish and not nearly > finished (and I might never finish). > > However it is pure elisp. > > Code is at: > > http://github.com/woudshoo/html-2-org > > Usage is: > > (h-2-o-insert-org-source-for-html HTML-STRING) > > which inserts a org blob in the current buffer at point. > > Wim Oudshoorn. > > > > --001a11342dde663fa4050da0ef66 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you Willem,

This looks v= ery helpful.

I am trying the code out in a scratch buffer and= I am unable to gnerate org syntax, e.g. with this test string:

(h-2= -o-insert-org-source-for-html=C2=A0 "<p><a href=3D\"http://example.org/\">hello</a&= gt; <span style=3D\"font-style:italic;\">world<br/> f= oo</span></p>" )


Am I doing something wro= ng?=C2=A0 Thanks,
Matt


On Tue, Jan 27, 2015 at 3:23 AM, Willem Rein Oudshoor= n <woudshoo@xs4all.nl> wrote:
Matt Price <moptop99@gmail.com> writes:

> Hmm,
>
> Looks like I asked this about a year ago and didn't follow up on i= t.=C2=A0 Does
> anyone know a way to generate org-mode syntax from an html string? I w= ould
> like to extend zotxt slightly (see my last post) and at present zotxt = can
> pull citations 7 bibliography entries from Zotero only in plain-text a= nd
> HTML form.=C2=A0 The plaintext form loses information, so I would like= to
> translate the HTML into org-mode syntax.
>
> Since this would have to happen in the context of an
>
> (org-add-link-type=C2=A0 )
>
> invocation, it would be best if this could be done directly in emacs > somehow...
>
> Thanks as always,

Not sure if this helps, but I recently hacked some code to conv= ert a
simple subset of HTML to org.=C2=A0 =C2=A0It is quite hackish and not nearl= y
finished (and I might never finish).

However it is pure elisp.

Code is at:

http://= github.com/woudshoo/html-2-org

Usage is:

=C2=A0(h-2-o-insert-org-source-for-html HTML-STRING)

which inserts a org blob in the current buffer at point.

Wim Oudshoorn.




--001a11342dde663fa4050da0ef66--