emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get parsed output of org-eww-copy-for-org-mode ?


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
User-agent: Gnus/5.13 (Gnus v5.13)

stardiviner <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]