Arabic and markdown

Today was my second Arabic lesson.

I’d hoped to share with you some of what I learned, instead I will share with you how to mix your markdown with some Arabic.

For those unfamiliar: markdown is a simple, very popular, text-mostly markup language. For those unfamiliar: Arabic is very popular, beautiful human language which is hurting my tongue with the pronouncing, but we’re getting there.

First issue: SublimeText, my editor of choice, has no support for right-to-left text. None. Zero. Not even remotely.

Solution: TextEdit, however has some support, so I will jump to TextEdit when writing Arabic prose. (TextMate apparently also has support, but I removed my copy when I first moved to sublime text. Apparently that was a mistake.)

Second issue: I’m used to typing markdown in monospaced text and whatever the fallback font used by my Mac for Arabic support is, it is decidedly not monospaced

Solution: Download DejaVu Sans Mono

Third issue: I don’t trust browsers with the right-to-lefting skills, especially in mixed documents.

Solution: Sprinkle a liberal helping of <span lang='ar'></span> everywhere, and throw this in the SCSS (given you’re using compass )

[lang='ar'] {
  direction: rtl;
  text-align: right;

I’m a wee bit sad about having to use raw HTML for the lang attributes, but all my research turned up nothing.1

Fourth: I spent all my time trying to find out how to do this, and none typing any Arabic.

Solution: اسمي دانا.

  1. More correctly: it turned up a lot about setting the language of code blocks for syntax colouring parsers to enjoy.