Blog

Here’s something that I never imagined would require over two hours to solve. Markdown is a nice simple markup language which you can use to format type in plain text. There are lots of programs which can interpret it and convert it to common rich-text formats. Ah, but what if you want to go the other direction, and convert rich-text to Markdown? What then? Well, down that path lies madness, my friend, but if you really must do it, here is one very convoluted way that it can be managed.

Edit: A new, easier method (we’ll call it Method Two) has been discovered! See below.

Method One:

Get Pandoc. If you’re on Linux, it’s probably in your repository. If not, you can download Mac or Windows binaries here.

Save your file as an HTML document. I used Open Office to do this, I’m guessing Word would work as well but I didn’t test it. I did test AbiWord, but the HTML documents it produces are formatted really stupidly and don’t work for our purposes. Note: Do not use Open Office’s “export” feature (use Save As instead), as it seems to cause problems too for some reason.

Use Pandoc to convert the HTML to Markdown. Basic console use is outside the scope of this tutorial, so hopefully this part is self-explanatory. The command is structured thusly:

pandoc inputfile.html -t markdown -o outputfile.txt

Check your output file for excessive line breaks. This is the fault of the way that OpenOffice exports HTML files. For some idiotic reason it puts in tons of line breaks. If your text has no extra line breaks, congratulations! You’re done! If not, proceed to Step Five.

Use this online tool to nix the excessive line breaks. I sure hope this tool is still around when you or I next need it, because it’s a godsend.

Repeat as necessary.

Method Two:

This method is probably easier than Method One but I haven’t tested it much yet so I can’t vouch for its overall reliability. It’s inspired by these delightful instructions.

OpenOffice/LibreOffice:

Open the find/replace box, drop down “More Options” and check Regular Expressions.

A little mini-tutorial here, brought to you by the school of Learning Things the Hard Way. I don’t know about the rest of you, but lately I’ve been having a lot of trouble with Linux installs failing to set up GRUB properly (particularly Ubuntu-based distros, for some reason). So, the following mini-tutorial is the result of a couple hours of headaches today. I’m not promising that it will work in every case, but if you’re having issues involving GRUB either not existing or not including options to boot one of your OSes, you might as well give this a shot.

If you’re lucky, that will fix GRUB very nicely. It should be noted that this does require you to have some semblance of a working grub installation, however. In the event that you do not, I’d suggest running the Ubuntu Boot-Repair utility. In some cases, in fact, that may be all you need to do. As for me, it didn’t detect my Windows install, but it did succeed in getting GRUB installed, which is more than I can say about the original OS installer. Good luck everyone!

I’ve been making some vector icons for a client and one of them involved a slide carousel… not exactly something easy to draw in SVG! However, I took a quick shortcut through 3D which I’m now going to share with you. Take a look:

I started by modeling a simple slide carousel in Blender, which took only a few minutes. I only needed the shapes, not the lighting, so I rendered it with some shadeless materials, thusly:

I then used Illustrator’s auto-tracing function to get the shapes from the render. Since the source image was very high-contrast, the tracer did a great job for once. At this stage I also drew in many of the simpler shapes, primarily circles.

Finally, I imported the Illustrator file into Inkscape to apply gradient fills, because Illustrator’s gradient tools are a leading cause of brain cancer in graphic designers. (It’s true!) The slide dividers benefit nicely from some clever banded circular gradients, to give this final result:

Not bad! Had I tried to draw this from scratch in Illustrator, I’d probably still be working… instead it took less than half an hour, and is about as photoreal as vector graphics can be.

I just set up something really convenient for myself and I have to share it, though it’s somewhat outside of the normal scope of this blog. I use a laptop that’s normally connected to a full-size monitor, so I often have to switch between two different monitor configurations–kind of a hassle. But not anymore, because now I can switch using hotkeys. Here’s how it’s done:

Get the monitor config tool “ArandR” ($ sudo apt-get install arandr)

Use it to create and save two monitor configurations, one for the laptop and one for the main screen. These configuration files are actually shell scripts.

Run gconf-editor and navigate to apps/metacity/keybinding_commands. Set the values of two commands to the paths to your shell scripts. (i.e., /path/to/script.sh)

In apps/metacity/global_keybindings, set the hotkey combination for the commands you just set.

Enjoy easy monitor configuration!

Thanks to this tutorial for showing how to set the hotkeys. Note that this uses Metacity, so it will not work if running other window managers, such as Compiz.