On 06/01/2021 13:41, Gerardo Moro wrote:
Basically that: as I copy (Control-C) text from the browser (Chrome), I would like those copied sentences to be sent to a ordered list in an OrgMode document:

- copied text 1
- copied text 2
- etc.

Any ideas? This would be very useful.

To add to emacs a key binding that runs a script calling pandoc, something like (untested, you are asking for ideas), and inserting new text from clipboard

in_file=`mktemp --tmpdir convert.XXXXXX.html`
out_file=`mktemp --tmpdir convert.XXXXXX.org`
xclip -out -target text/html >"$in_file"
pandoc --output="$out_file" "$in_file"
xclip -in <"$out_file"

No need to setup org-protocol. Maybe it is possible to avoid temporary files.

TODO:
- Temporary files should be removed
- Unsure if pandoc is safe in respect to peculiar HTML formatting, maybe it has some special options for conversion of non-trusted files.



Reply via email to