Friday, September 19, 2014

The Lazy Way to Write a Blog

start 8:42 pm

I rarely find time to sit down and write a blog. When I do, it's annoying how much time is wasting using this clunky WYSIWYG. It's not perfect, but here's what I've come up with to stream line the process.

Use Sublime

Screw writing in the browser. I live in ST3, so why not stay there?

Use Markdown

Writing HTML is for chumps; use Markdown.

Use Markdown Preview

Install the Makdown Preview package. When you're done previewing and want post your blog, use ctrl + shift + p, "Markdown Preview: Copy to Clipboard". Select the github option.

Create a new file, paste the contents, and delete everything except the body content. It will be a little unreadable, with lots of styles, but it's not hard to search for the body tag. You're in Sublime, right?

<!DOCTYPE html><html><head><meta charset="utf-8"><style></style> <title>blah</title></head><body><article class="markdown-body"><p>blah blah blah</p></article></body></html>

Take the remaining content and paste it into your blog.

Add the CSS

In Blogger, and probly other blogs, you can add global CSS for your pages. Use this CSS, which is the same stuff you just clipped out of your preview in the step before.

Summary

Now, you can crank out blogs that look reasonably well. The important thing for me is how code snippets look.

(function () {
    'use strict';

    var formatted = true;

    console.log('They look ' + (formatted ? 'good' : 'crappy') + '.');
}());

So, that's it. I haven't quite figured out how to deal with images, but this isn't bad. As you can see, including looking up references, it only took 21 minutes to write this.

end 9:03 pm

No comments:

Post a Comment