From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: Re: How to get parsed output of org-eww-copy-for-org-mode ? Date: Tue, 24 Dec 2019 11:26:38 +0100 Message-ID: <84zhfi10kh.fsf@gmail.com> References: <87lfr259jq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39099) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijhOs-0007la-8e for emacs-orgmode@gnu.org; Tue, 24 Dec 2019 05:26:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ijhOr-0002V6-Aj for emacs-orgmode@gnu.org; Tue, 24 Dec 2019 05:26:50 -0500 Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:39022 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ijhOr-0002Ud-47 for emacs-orgmode@gnu.org; Tue, 24 Dec 2019 05:26:49 -0500 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1ijhOo-0012SJ-OP for emacs-orgmode@gnu.org; Tue, 24 Dec 2019 11:26:46 +0100 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" To: emacs-orgmode@gnu.org stardiviner 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