Perfect Preview With MarsEdit

September 6th, 2007

One of the most time-saving features of MarsEdit is its Preview window, which uses the power of Safari’s WebKit to render a browser-perfect version of your post before you send it to the blog. This is fantastic because you can spot formatting errors and typos before publishing the item.

Unfortunately, the initial setup is a little bit daunting. Straight out of the box, MarsEdit’s preview looks pretty bland. It won’t have any of the fantastic stylings of your blog until you edit the “template” that MarsEdit uses to generate the preview.

To be sure, there’s a lot MarsEdit could do to make this template-editing process easier. For instance, Windows Live Writer uses a nifty trick where it posts a temporary entry and then immediately deletes it, so that it can get a “reference” page to build a template from.

I’m going to look at ways of streamlining this process in MarsEdit, but for the time being I thought it would help to post a sort of tutorial about how you can get your own blog set up with “perfect previews” in MarsEdit.

Step 1: Open A Reference Entry

We’re going to build your template by starting with a “typical” entry page from your blog. Go to your blog and click on the title (usually) of one of your posts, to get the “all on one page” view. For instance, here’s the single page view for this entry.

From your browser, select “View Source.” This varies from browser to browser but in Safari you can just control-click the page content and then select it from the menu.

Step 2: Copy HTML Into MarsEdit

With a post editor window open in MarsEdit, click the Preview icon in the toolbar to open the Preview window. Then click the “Edit Template” button in the lower-right corner of the window. You’ll probably see the default template that MarsEdit uses for all new blogs. Delete the default template text to make room for your custom template.

Copy the HTML source from the web browser’s “View Source” window and paste it right into the MarsEdit template window. You should immediately see the preview window become a lot more like your blog looks on the web!

Step 3: Fix Links

This won’t be necessary for all blogs, but if your HTML has relative links in it, you’ll need to replace those links with full links. For instance, if your HTML links to CSS style sheet like this:

href=”blog/wp-content/themes/rsbubbles/style.css”

You’ll need to change it to include your host name:

href=”http://www.red-sweater.com/blog/wp-content/themes/rsbubbles/style.css”

You’ll probably know that you need to find some more links to change because something is missing or just doesn’t look right in the preview. Try Cmd-F to search for “href” and “url(” in your template.

Step 4: Insert Placeholders

By now you should have a pretty good looking preview! The only problem is, it shows you the content of your reference post! You need to insert placeholders where all the “interesting things” are. So you squint your eyes and go scrubbing through the template, looking for the “content” and replacing it with a template placeholder. Try Cmd-F to search for the first word in your blog post, and then select the text and all its HTML until you get to the end of the blog post. Delete all of that, then select “Insert Placeholder -> Body” from the placeholder popup.

Do the same for your post’s Title, Categories, etc. You’ll see your template start to magically come to life as a perfect mirror of the post you’re currently editing.

Caveat: Because of the way MarsEdit’s “instant” updates work in the preview window, you can’t use placeholders in the <head> secton of your template. This usually isn’t a problem, because you can use hard-coded references to your blog’s CSS files, etc.

Final Touch: Font Size & Style

As a final touch to make the content match the way it looks in your favorite browser, make sure to change the default preview fonts in Preferences -> Preview. You can look in your browser’s preferences to find the default fonts you’re using there, and ensure that you get the same look in MarsEdit.

As I said, the process of setting up a perfect preview is a bit tedious, but the results are simply amazing. For instance. I’m about to publish this post, and before ever seeing it on the web, I know just what it’s going to look like:

I hope you’ll find MarsEdit even more enjoyable after learning how well it can preview your posts.

MarsEdit 2.0 Is Out!

September 4th, 2007

Wow … I thought I’d try something new this time and release a product in “the wee hours.” So I put all the pages up live late last night, thinking they would be there in case anybody saw them.

Then the little “cash register” noise on my email started going off. Nice! The reaction to the public release was almost immediate, so I couldn’t go to sleep quite as instantly as planned. When I finally did grab some shuteye, I woke up to a world on fire with MarsEdit joy!

Err, let’s just say, people were ready for this upgrade, and so far, they seem to be really loving it.

Read the What’s New page for MarsEdit 2, to get a sense for what the major changes are in this revision.

Visit the MarsEdit Home Page to download a copy if you haven’t tried it yet!

I’m really excited to be able to share the app with all of you, after several months of hard work.

Markdown Scripts For MarsEdit

August 26th, 2007

Drew Thaler has put together a pair of scripts for streamlined use of Markdown in MarsEdit, when the blog server is not configured to automatically process Markdown for presentaton.

Markdown Scripts For MarsEdit

With Drew’s scripts, you can write a post entirely in Markdown, then easily convert it to HTML before sending it to your weblog. He also provides a reverse script so you can edit existing posts by first converting them to Markdown, editing them, and converting them back before republishing. Nifty!

This is a really cool example of a MarsEdit user taking good advantage of the scripts menu to extend the application’s functionality. As you might imagine, I get a lot of requests from users who want to see a particular feature added to MarsEdit. I love it when the feature can be sort of “prototyped” as a proof of concept with AppleScript. I could see functionality like what Drew has put together being incorporated into the standard distribution of MarsEdit at some point. As development moves forward for 2.1 and beyond, I am going to aim for making the app even more user-extensible, because that’s where the most exciting ideas comes from. It’s ideal when users can not only come up with the idea but also implement a working example!

If you’re interested in Markdown but not using a weblog server that supports it natively, Drew’s scripts might make a nice addition to your MarsEdit configuration!

MarsEdit 2’s New Look

August 24th, 2007

I promise this will be the last teaser. Some people have been, well, practically begging for more screenshots of MarsEdit 2, so I thought I would oblige.

In addition to some killer new features such as Flickr browsing, ability to add categories and edit slugs, advanced text editor macros, etc., MarsEdit 2.0 also sports a modernized look and feel that I honestly believe will improve your productivity. It’s just super slick. The UI feels even cleaner and more streamlined than the original MarsEdit. Because it is even cleaner! I also thought carefully about (mostly) invisible things, like organization of the menu bar items, and added a healthy dose of contextual menu functionality. In general, the usability of the application is greatly improved, over what was already a pretty darned usable app.

Oh, and it also looks amazing.

The anchors of the updated look are Bryan Bell’s brilliant new toolbar icons. Bryan also did the MarsEdit 1 icons, and to be honest I would have never guessed that they could be so improved upon. The new icons are sharper, more vibrant, and in general present a cleaner metaphor for what their actions are.

Of course, I already showed off the post editor a month ago, but it’s come a good deal further since then. Again, just look at the icons!

What I can’t really express with a picture is how much fun it is to just show and hide the options side-panel. I love the tactile feeling of the animation as the text scrunches up or expands to fill the space. I could just open and close the options pane all day. Except of course, then I’d never ship this thing.