Is there any easy way to copy/paste text from a browser window into an org file, automatically converting links into [[][]] org-mode links? thanks!
Copying html in org format from eww
This requires emacs 24.4 or later.
Configure the
org-eww
module. It's not part of org, you'll have to pull the repo into some folder (git clone https://orgmode.org/org-mode.git
) or manually copy the file into some package folder, although git is recommended as it helps you keep things up to date.Then add the contribute folder into your path and say that org-eww is required. If you cloned from git, the
org-eww.el
file will be in/path/where/you/cloned/org-mode/contrib/lisp/
.(add-to-list 'load-path "/dir/path/containing/org-eww.el/")
(require 'org-eww)
Open a web-page in
eww
(eww is a browser in emacs,M-x eww
). You can get emacs to open links in eww via:(setq browse-url-browser-function 'eww-browse-url)
. This is useful in combination with helm-google + eww).Select the region you want to copy from the html page and do
M-x org-eww-copy-for-org-mode
. If no region is selected, the whole webpage is copied (including links to images). As of now theo
key is not bound to theeww-mode-map
. For convenience, this command can be bound to that key in that mode map:(define-key eww-mode-map (kbd "o") #'org-eww-copy-for-org-mode)
Then use
C-y
to paste into your org mode file/buffer. Withiimage-mode
you can even see the images from the website and links are converted to the org-mode format.
-
Thanks! The
pandoc
tool suggested in comments is another solution -- for me it would be a bit easier to implement, but it is nice to have a method that does not rely upon tools outside of Emacs... – laxxy Feb 13 '15 at 15:12 -
That seems promising. However the text formatting is still lost... For example italics, bold and
code
. Sometimes I just want to copy a part of the text instead of the whole web page, preserving the format. Is there any alternative topandoc
approach. – xji Apr 21 '15 at 5:36 -
I might still prefer to use some external tools such as
Evernote
orQuiver
if that's not possible. – xji Apr 21 '15 at 6:02
pandoc
. – abo-abo Jan 8 '15 at 18:11pandoc
, thanks! – laxxy Jan 8 '15 at 21:46