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
This requires emacs 24.4 or later.
org-ewwmodule. 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.elfile will be in
(add-to-list 'load-path "/dir/path/containing/org-eww.el/")
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 the
okey is not bound to the
eww-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)
C-yto paste into your org mode file/buffer. With
iimage-modeyou can even see the images from the website and links are converted to the org-mode format.
late to the party, but as @xji said,
org-eww-copy-for-org-mode doesn't preserve formatting, it only does links.
if you want to actually end up with org headings and preserved formatting, try https://github.com/alphapapa/org-web-tools.
w to copy URL of current page (or copy from another browser), then run
further details are in the readme.
I wrote an add-on Copy as Org-Mode for Firefox which can do this in browser directly, it even can convert HTML tables into Org-mode format.