Marky the Markdownifier, reintroductions

I’ve been working a bit on Marky the Markdownifier. It’s a project I started back in 2010 and use regularly, but it’s never really caught on with the Markdown masses. I’ve tweaked the algorithms and added to the API to make Marky as useful as possible within my own workflow, and hopefully within other’s as well.

At its most simple, Marky takes urls and converts them to Markdown text, removing comments and ads in the process. A web-based version of read2text. In the web interface, you can copy Markdown to the clipboard, preview it as HTML and a few other surface level tasks. You can also go straight to HTML view and use Marky as an Instapaper Mobilizer kind of tool. It can be more useful than that, though.

Starting with Bookmarklets for your browser, you can convert the current page to raw Markdown, open it as a preview, even save it directly to nvALT. Here are some more examples:

Create a System Service to convert entire folders full of html files to Markdown files

There are details for the API listed on the homepage for each of the two flavors of Marky (folksy and sailor versions). Some ready-made bookmarklets are there (open page in Marky, open as raw Markdown, save Markdown to NV, etc.); you can dissect them to see how they work, and use the API documentation to extend them. It’s not a gorgeous API, but it does the trick.

Here are a couple of Bash functions I use for clipping from the command line:

I’ve created a Ruby script that handles just about every combination of tasks you’d want to run on your local system. It can be chopped up and turned into Services or actions for your favorite launcher. I’m including a couple of example Services created that way below. Make it executable and run marky.rb -h for a list of options:

I use Marky primarily for clipping reference web pages, but I’ve tested it with all kinds of sites and it works well about 90% of the time. Some sites with bizarre markup don’t have their content recognized by the Readability algorithm, and you get blank pages (New York Times), and some sites don’t provide HTML markup for the article in the source (Gawker), so there’s nothing to grab. I had a workaround for Lifehacker and friends, but it broke recently. I’m working to update it.

I’ll be updating and making changes for a while, so I can’t guarantee 100% uptime at the moment. Also, it’s hosted on a shared Dreamhost account, so it’s not currently set up to scale to any extreme. Caveat emptor. If you have ideas for extending Marky to be more useful, let me know. In the meantime, feel free to start Markdownifying the web.