emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marco Wahl <marcowahlsoft@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: How to get parsed output of org-eww-copy-for-org-mode ?
Date: Tue, 24 Dec 2019 11:26:38 +0100	[thread overview]
Message-ID: <84zhfi10kh.fsf@gmail.com> (raw)
In-Reply-To: 87lfr259jq.fsf@gmail.com

stardiviner <numbchild@gmail.com> writes:

> I try to get the parsed HTML content into Org format content for org capture
> template.
>
> #+begin_src emacs-lisp
> (require 'org-eww)
> (with-temp-buffer
>   (insert html)
>   (org-eww-copy-for-org-mode)
>   ;; FIXME does not yank converted content, inserted original HTML instead.
>   (current-kill 0)
>   (org-yank))
> #+end_src
>
> But in upper code snippet, the ~current-kill~ or ~org-yank~ (or
> ~yank~) can't get the
> output. I try to use *advice-add*, but I don't know which advice
> combinator can
> archive the purpose that get the parsed output of
> ~org-eww-copy-for-org-mode~ and
> save it somewhere like variable or register. So that I can yank in capture
> buffer again.

org-eww-copy-for-org-mode works reasonably only on a buffer that has
been prepared by the shr library.  The typical example for such buffer
is the output of eww.

If plain html is given and you want to use org-eww-copy-for-org-mode you
could prepare a suitable buffer along the lines of shr-render-buffer, I
think.


HTH

  reply	other threads:[~2019-12-24 10:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-24  9:59 How to get parsed output of org-eww-copy-for-org-mode ? stardiviner
2019-12-24 10:26 ` Marco Wahl [this message]
2019-12-25  8:08 ` Adam Porter
2019-12-25 11:00   ` stardiviner
2019-12-25 11:33   ` [SOLVED] " stardiviner
2019-12-25 21:54 ` Bob Newell
2019-12-27  1:35   ` stardiviner

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=84zhfi10kh.fsf@gmail.com \
    --to=marcowahlsoft@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).