Archive for category Blogging

Moved

This is my last post on Wordpress.

My blog has moved here.

The reasons for the move are:

  • I want everything to be part of my website
  • I want to be able to write posts faster which my new blog enables me to do via:
    • markdown support
    • built in code highlighting
    • external snippet support

In case you got interested, check out the blogging engine I created to enable that:

NodeJs powered Developer blOGging engine.

Advertisements

,

Leave a comment

How to make your code samples in your blogs look like they look in Vim

Four simple Steps

  1. Open the code sample in your favorite editor (that would be vim)
  2. Execute :TOhtml (this generates a complete html file including a <style> section that contains the needed CSS and a <body> section that contains the HTMLversion of your code)
  3. Copy the generated CSS into the CSS file of your blog (in wordpress you’d get there via Appearance/Edit CSS)
  4. Include the generated HTML body in your blog

I haven’t tried this, but alternatively you could just copy the entire html (including the <style>) into your blog and thus combine steps 3 and 4.

The disadvantage of that approach is that in this case you’d have to include the CSS part in every blog that has a code sample.

If you don’t want to upgrade

In case you don’t want to pay the $15/year for the Custom CSS upgrade, scrap steps 3 and 4 and instead do the following in order to inline the CSS.

  1. Copy the code generated in step 2 from above to the clipboard
  2. Go to http://premailer.dialect.ca/
  3. Select Paste HTML as the source
  4. Paste your code into the text field
  5. In the Options check everything except  Don’t remove <style> and <link> elements
  6. Hit Submit and copy the HTML results
  7. Include the copied HTML in your blog

2 Comments

%d bloggers like this: