emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Price <moptop99@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: HTML --> Org-mode?
Date: Mon, 26 Jan 2015 23:42:06 -0500	[thread overview]
Message-ID: <CAN_Dec-3ib7NBj76bwq0CFSN7dLX3SDKWFQmUj9z9Q=B_RpHEg@mail.gmail.com> (raw)
In-Reply-To: <87a9154670.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2512 bytes --]

I think the answer may be something like:

(shell-command-to-string (concat  "pandoc -f html -t org <<< '"  :html "'" )

Though I'm not quite sure how to go about it just yet.

On Mon, Jan 26, 2015 at 3:50 PM, Tory S. Anderson <torys.anderson@gmail.com>
wrote:

> man pandoc will be your friend. It guided me to the following simple
> (interactive) use:
>
> pandoc -f html -t org
> <b> how are you? </b>
> <i> I am good </i>
> *how are you?* /I am good/
>
> I won't be able to help you much farther than that, though.
> - Tory
>
> Matt Price <moptop99@gmail.com> writes:
>
> > That should be enough. I would need to feed a string form emacs to
> > pandoc, then capture the output as a new string that can be output in
> > the export filter. Do you know how to do that part?
> > Thanks,
> > Matt
> >
> > On Mon, Jan 26, 2015 at 3:31 PM, Tory S. Anderson
> > <torys.anderson@gmail.com> wrote:
> >
> >     Using the magic wizard program Pandoc, I just had success with a
> >     simple little example:
> >
> >     pandoc -o test.org test.html
> >
> >     Input test.html:
> >     <html>
> >     <body>
> >     <strong>TEST strong!</strong>
> >     <div class='table'>
> >     <div class='cell'>Cell 1</div>
> >     <div class='cell'>Cell 2</div>
> >     <div class='cell'>Cell 3</div>
> >     <div class='cell'>Cell 4</div>
> >     </div>
> >     </body>
> >     </html>
> >
> >     Output test.org:
> >     *TEST strong!*
> >     Cell 1
> >     Cell 2
> >     Cell 3
> >     Cell 4
> >
> >     I'm not sure how sophisticated the strings you are dealing with,
> >     but pandoc might do the trick for you.
> >     - Tory
> >
> >
> >
> >
> >     Matt Price <moptop99@gmail.com> 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,
> >     >
> >     > Matt
> >
>

[-- Attachment #2: Type: text/html, Size: 3998 bytes --]

  parent reply	other threads:[~2015-01-27  4:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 20:15 HTML --> Org-mode? Matt Price
2015-01-26 20:31 ` Tory S. Anderson
     [not found]   ` <CAN_Dec_FD7ys9zoOQ3pNym+E_0=D=acHUapKYHbQWxjL=huoNA@mail.gmail.com>
     [not found]     ` <87a9154670.fsf@gmail.com>
2015-01-27  4:42       ` Matt Price [this message]
2015-01-27  8:23 ` Willem Rein Oudshoorn
2015-01-27 11:55   ` Matt Price
2015-01-27 13:58     ` Wim Oudshoorn
2015-01-27 18:59     ` Willem Rein Oudshoorn
2015-01-28  2:12       ` Matt Price
2015-01-27  8:27 ` Eric S Fraga
2015-01-27  9:51 ` Albert Krewinkel

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN_Dec-3ib7NBj76bwq0CFSN7dLX3SDKWFQmUj9z9Q=B_RpHEg@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 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).