RTL Tiddlers in TiddlyWiki

Update – For TiddlyWiki 5 see RTL Tiddlers in TiddlyWiki 5.

I’ve been using TiddlyWiki for a while now, and it became a very useful tool for me. Today, I’ve decided to organize my various recipes (somehow cooking and especially making deserts has turned into an hobby of mine), and as you can expect I’ve decided to use TiddlyWiki for the tasks.

There was a slight problem as some of the recipes are in Hebrew, and it seems TiddlyWiki doesn’t have built-in support for RTL (right-to-left) tiddlers. However, such support can be added via custom stylesheets and the tiddlers’ tags. The idea for this method is taken from this TiddlyWiki.

Create a new tiddler called “StyleSheet” (without the quotes). This is a special tiddler (a shadow tiddler) that lets you add additional CSS code for your wiki. Insert the following code into the newly created tiddler:

/*{{{*/
div[tags~="RTL"].tiddler {
    direction: rtl;
}
div[tags~="RTL"].tiddler .subtitle {
    direction: ltr;
}
div[tags~="RTL"].tiddler .tagged {
    direction: ltr;
    float: left;
}
/*}}}*/

Now for every tiddler you want to be in RTL direction just add RTL to its list of tags. After you do it, the tiddler will appear correctly. Here is an example of what in RTL looks like after the fix:

A screenshot of an RTL tiddler
A screenshot of an RTL tiddler

7 thoughts on “RTL Tiddlers in TiddlyWiki”

  1. Yeah but…
    CSS3 is not supported by MSIE 🙁
    So your code will not work with MSIE :/

    If you show me the page perhaps i can help you…

    regards

  2. Someone named Yitzhak wrote to me and pointed out that for Hebrew tiddlers one could add the following

    div[tags~="RTL"].tiddler ol {
        list-style: hebrew;
    }
    

    in order to get Hebrew numbering. I personally prefer normal numbering but I thought other might find it useful.

    @config: I know that this solution doesn’t work in IE (at least for now), but I look at it as a no-problem, as I don’t use IE 🙂 You need to use a decent browser in order to enjoy elegant solutions.

  3. Hi, I tried this but I get /Filter error: Unterminated regular expression in filter expression/ when I save the StyleSheet TiddlyWiki. Also, do I need to add RTL to the tags of the TiddlyWiki (the one used for tag categorizing)? Or should I write

    text

    ?
    either maybe?

  4. Hi Amitai, I’m not sure I understand your problem you’re describing. There are not regular expressions involved, so no such errors should happen.

    The RTL tag should be added to the tags of the tiddler itself.

  5. Guy, thank you very much. I’ve deciden on TiddlyWiki because of this feature of yours.

Leave a Reply

Your email address will not be published. Required fields are marked *