Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I would like to be able to pop up a window on my Mac displaying a rendered HTML preview of selected text (ideally a completely chromeless window like that used by QuickLook, but an ordinary Web browser window could work if necessary, but the less chrome the better).

What tools are available to do this?

share|improve this question
1  
FWIW, there is a QL plugin for Markdown github.com/toland/qlmarkdown –  David Pearce Feb 21 '12 at 13:43
    
This doesn't totally fit what you're looking for, but you may have an interest in Marked. It can open .txt files and format them nicely, let you view them however you want, and export to a few different file types (including HTML, which I suppose could be used with @stuffe's answer below). –  timothymh Feb 22 '12 at 5:12

2 Answers 2

up vote 2 down vote accepted

I tried a few things (even a websocket node app I wrote) to do this, however I found an app, Marked, that does exactly what you asked. It constantly reads a text file and shows you HTML/MD on the fly as you type. It's pretty nifty, commercial, but nifty.

The Marked Bonus Pack comes with a service for previewing text selections.

share|improve this answer
    
Awesome tool for things saved to disk. It doesn't help with selected text that hasn't been saved, though. But worth having in the arsenal. –  Daniel Lawson Feb 21 '12 at 17:03
    
@Daniel The Marked Bonus Pack comes with a service for previewing text selections. –  ؘؘؘؘ Feb 21 '12 at 19:20

To view a HTML file (I'll leave you to work out exactly how you want to format it and parse the markdown etc) in a chromeless window similar to quicklook you can use the automator actions Get Urls From list > Safari Popup.

This will open the URL (which can be a local file://~/etc) in a box as follows (the following screenshot shows facebook - as you can also set window size and user agent in the safari popup options - I choice iPhone size and Mobile Safari agent to show how you can create a quick and dirty Facebook app using automator in 10 seconds). Clicking OK or cancel closes the app as it's the last Automator step, but you could easily extend it so a canel stops the workflow, but OK continues the actions, which may me to copy the file to an upload folder or whatever.

enter image description here

share|improve this answer
    
Awesome. Thanks! –  Daniel Lawson Feb 21 '12 at 14:59
    
Look forward to seeing the rest of the workflow! –  stuffe Feb 21 '12 at 15:09
    
You could just write the Markdown conversion after downloading Markdown.pl file. Either read the Markdown syntax from a file or from the clipboard and pipe through | perl Markdown.pl > /tmp/md.html then use @stuffe answer for display. –  afragen Feb 21 '12 at 21:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.