chipplechipple

Blog - Movable Type Macron plugin

Technology Movable Type Macron plugin

ma·cron ['mA-"krän, 'ma-, -kr&n] n. A mark placed over a vowel to indicate that the vowel is long [...]
(Source: Webster)

I am very fond of "macrons" to write romanized Japanese. The macron's meaning is obvious and it makes pronounciation easier to interpret for non-Japanese speakers, plus it generally looks neater than the "u" that results from strict romanization.

Example:
  Japanese: 高速道路 (highway)
  Strict romanization: kousoku douro
  Romanization with macron: kōsoku dōro

While the macron is present in Unicode, as the "combining macron" character at position U+0304, it's still very little used on computers and the Web probably because it can't be input easily. One way to input it in HTML is to use the character entity ̄, still not easy to remember.
This is however a thing of the past, at least in your blog if you use Movable Type.

Movable Type Macron plugin

Let's spread the use of the macron on the Web!

Download

Macron plugin version 1.3.2
Tested with Movable Type 3.2, 3.3, 3.4, 4.0, 4.1, 4.3 (may work with earlier versions)
Your blog's character set must be UTF-8

Macron_1_3_2.zip (5K)

Movable Type 3.2 (or earlier) users must download the plugin BigPAPI version 1.04 and put it in the AddComment folder.
BigPAPI_1_04.zip (3K)

Installation

  1. Place the Macron folder inside of your Movable Type installation's plugins folder (typically /cgi-bin/mt/plugins/).
  2. Movable Type 4.x users: Copy what's found in the images-4.0 folder into your /mt-static/images/ (or equivalent) folder.
    Movable Type 3.3+ users: Copy what's found in the images-3.3 folder into your /mt-static/images/ (or equivalent) folder.
    Movable Type 3.2 users: Copy what's found in the images-3.2 folder into your /mt-static/images/ (or equivalent) folder.

That's all!

Version history

How to use

In supported browsers, the Macron button Macron will appear next to the Underline button Underline, located above the entry editing area in Movable Type's regular editing page and also in bookmarkets.

Select only one character in your text, and click the Macron button Macron. The macron will appear above the character.

Remember that the combining macron itself counts as one character. To remove a macron, place your cursor after the letter that has a macron and use backspace, only the macron will disappear.

Limitations of the macron's use

Bonus patch #1 - Hide macrons from search engines

Since the macron isn't widely used, search engines are likely to misinterpret it and it could prevent searches from being successful. Therefore I recommend removing the macron from responses to search engine robots.

This is sample code to hide macrons from Googlebot using PHP. Add the following lines to a PHP include or at the top of your templates.

<?
if (strpos($_SERVER["HTTP_USER_AGENT"],"Googlebot") !== false) ob_start("f_Gen_GooglebotCallback");
function f_Gen_GooglebotCallback ($sIn) { // Hide combining macron from Google, because it may prevent searches $sOut = str_replace("\xcc\x84","",$sIn); // UTF-16 0304 -> UTF 8 CC84 (11001100 10000100) return $sOut; }
?>

Bonus patch #2 - Add keyboard shortcut
(Movable Type 3.x only)

To add a keyboard shortcut for the Macron, you must modify the /mt-static/mt.js file (or equivalent). Open it in a text editor, find the mtShortCuts function, and add the following line at the very end of the function (just before }).

    if (ch == 'C') insertMacron(el);

To use the keyboard shortcut, press Ctrl+Shift+C.

Suggestions and comments

Suggestions to improve this plugin, or general ideas spread the use of the macron on the Web are very welcome.

Update notifications

To be notified of the latest updates to this plugin and other great plugins, please install MT Plugin Network.

Posted on November 19, 2005 at 00:46 | Tweet |


Trackback


Comments RSS

Excellent!! I'll use this plugin when I have time to upgrade to 3.2 later.

Posted by Roy on November 20, 2005 at 19:08


It _may_ work with earlier versions. I don't know too much about the history of MT plugins so I have no clue. In either case, it's nothing dangerous, so if you wish you can try dropping the "Macron" folder in your plugins folder and see if it works or breaks. If it doesn't work, then just delete the Macron folder.

Posted by Patrick on November 20, 2005 at 19:32


Are you using this plugin to display macrons here? If so, I'm using Safari and I see them just fine.

Posted by Brad on November 20, 2005 at 21:54


Good news if it works! I only have access to an older version of Safari (the latest one that runs on OS 10.2) which doesn't display macrons properly.

Posted by Patrick on November 20, 2005 at 21:59


OK, I'm running 10.4.3 so maybe that's it. I've got installed on my blog now. Thanks, this is really cool!

Posted by Brad on November 20, 2005 at 22:02


Great! Glad to hear that! :)

Posted by Patrick on November 20, 2005 at 22:05


macronについて賛成です! I remember when I used to make for webpages, I'd memorized the sequences & # 333; and & # 363; which are... "ō" and "ū" respectively? And I'll keep the search engine tip in mind ^_^

Posted by Michelle on November 21, 2005 at 01:43


So I wasn't the only one using the macron! :) I didn't know about those separate macron characters.

Posted by Patrick on November 21, 2005 at 10:50


Er, I'm using OS 10.4.3 and the most recent version of Safari, and they've never displayed properly for me .... I'm using a G3 iBook with a crap graphics card, but that shouldn't have anything to do with it should it?

Posted by Tim on November 22, 2005 at 00:44


Maybe it has to do with installed fonts then?

Posted by Patrick on November 22, 2005 at 07:50


Ah, I wished this would be solve for Mac browsers!

I did a little test using OS 10.4.2 (gonna get .3 tomorrow:
- Safari: little sqaures in place of the macrons
- Opera little ugly squares with crosses (also for some of the other Japanese characters unless I select unicode encoding: maybe because there is a quote missing before utf in charset=utf-8" ?)
- Firefox: same as Safari
- Netscape (yes I have 'em all): same as firefox
- Explorer: almost good, there is a small whitespace below the macron, after the letter (I think I noticed this with firefox on a pc at work too)

But I'm not going back to Microsoft!

Posted by Erik on November 25, 2005 at 02:52


I certainly haven't installed any additional fonts, so it could be. I tried changing the text encoding to unicode and a few others, but none of them worked any better for the macrons.

Posted by Tim on November 25, 2005 at 09:36


Too bad that it doesn't work out on your end. I agree that Microsoft isn't an option. :)

I'm guessing it's a font issue since it seems to work well for Brad, I just wish we could figure out what it exactly is...

Here on PC it works good in all recent browsers I've got (Firefox, Opera 7+, IE5+) with no odd consequence.

Posted by Patrick on November 25, 2005 at 09:40


tommy febru-latte, makaron?

Posted by ndkent on December 16, 2005 at 21:22


Haha :)

(As you probably know) Latte and Macaron are actually the names of the 2nd(?) generation Sony Aibo dog robots. There's also a Sweet Robots Against The Machine track titled "Latte & Macaron" also sampling the robots.

Posted by Patrick on December 16, 2005 at 21:30



« Techno Kayō Night #3 report | Back to main page | Ceci n'est pas un burger. »