title: getting HTML source or markdown text from the KDE clipboard with PySide
body: <p>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.)</p>
  
  <p>My current cumbersome method is:</p>
  
  <ol>
  <li>highlight section and copy to clipboard</li>
  <li>open Libre Office Writer</li>
  <li>paste into Writer</li>
  <li>save Writer doc as HTML</li>
  <li>open terminal </li>
  <li><code>cd</code> to the directory where I saved the HTML</li>
  <li><code>pandoc -s -r html /home/me/a/b/mydoc.html -o /home/me/a/b/mydoc.md</code></li>
  </ol>
  
  <p>Obviously, I need a better method! </p>
  
  <p>Here's my original question:<br>
  <a href="https://unix.stackexchange.com/questions/78395/save-html-from-clipboard-as-markdown-text">https://unix.stackexchange.com/questions/78395/save-html-from-clipboard-as-markdown-text</a></p>
  
  <p>That pointed me to this possible answer:<br>
  <a href="https://stackoverflow.com/questions/3261379/getting-html-source-or-rich-text-from-the-x-clipboard">getting HTML source or rich text from the X clipboard</a></p>
  
  <p>The above is what motivated me to do this in Python. </p>
  
  <p>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.</p>