I want to be able to highlight a section of a web page (which could be any web page I happen to be viewing) and copy it to the clipboard then save it to my local disk as markdown. I need an efficient way to do that. I'm on Kubuntu 12.04 and I want to use PySide. (I don't have any experience with Python, Qt or any related tools, but I googled around and found PySide highly recommended and I completed a Hello World tutorial so far.)
My current cumbersome method is:
cd
to the directory where I saved the HTMLpandoc -s -r html /home/me/a/b/mydoc.html -o /home/me/a/b/mydoc.md
Obviously, I need a better method!
Here's my original question:
https://unix.stackexchange.com/questions/78395/save-html-from-clipboard-as-markdown-text
That pointed me to this possible answer:
getting HTML source or rich text from the X clipboard
The above is what motivated me to do this in Python.
I need a KDE/PySide version of the answer above that also incorporates the pandoc conversion to markdown step. It seems simple enough except for replacing the gtk.Clipboard commands with their equivalent KDE Clipboard commands. I have no idea about that.
This can be done via recent versions of xclip which support the -t text/html (target selection) and pandoc to convert html to markdown.
See the details: Save HTML from clipboard as markdown text - Unix & Linux Stack Exchange
Thanks to @mountainx for asking again on the Unix stackexchange, which provided this solution, as noted in a comment above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With