PopClip extensions: WebMarkdown fix
So Apple stopped shipping Python with macOS, which they warned quite a while ago they were going to do. Unfortunately, I still have a good number of apps and scripts that rely on Python scripts in the background, meaning people who haven’t installed the Command Line Tools are unable to use some of my tools. I’ve slowly been working to rectify this, but it’s going to take some time.
The Python script I’m most reliant on is Aaron Swartz’ html2text, used for converting HTML markup to Markdown text. Read2Text uses it, the PopClip extension WebMarkdown uses it, even Marked uses it for rendering Scrivener documents. So my first fix is for the WebMD extension. If it works for everyone, I’ll know I’m on the right track to solve this. (Then I have to port some Ruby scripts, but one thing at a time.)
The WebMarkdown extension lets you select text on a web page, and then select “WebMD” in PopClip to have a Markdown version of the selected text placed in your clipboard.
If you’re interested in the nitty gritty, coming to my rescue is Shahaf Levi and his Swift port of the html2text and Readability scripts. With those in hand I’m able to compile command line utilities as binaries that can be drop-in replacements for the various incarnations of the html2text script I’ve used. I made a very simple one for WebMarkdown that takes raw HTML from the
POPCLIP_HTML environment variable and converts it to Markdown. No Readability, no STDIN/argument input, just read the variable and output the result.
Please help me test. Download below, unzip, and locate the WebMarkdown extension in Finder. Double click it to install. If you already had the previous version installed, it will be updated.
If you haven’t tried it or it wasn’t working for you previously, give it a shot and let me know how it goes. If people run into issues, I’ll update this post with fixes.
I’ll also be publishing a replacement for Read2Text very soon.
Brett's PopClip Extensions v1.45.2
Download Brett's PopClip Extensions v1.45.2
A few PopClip extensions for Markdown writing and other useful tools
Updated 02/07/23. Changelog