]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/allow_to_specify_text_direction_for_RTL_support.mdwn
Suggest initial Right-To-Left page support implementation
[ikiwiki.git] / doc / todo / allow_to_specify_text_direction_for_RTL_support.mdwn
1 Currently ikiwiki does not support left-to-right languages like Hebrew and Arabic,
2 in the sense that page text is always aligned to the left. Unless you do some CSS
3 hacking which doesn't scale well when you have many RTL pages.
4
5 In the future it would be nice to make the while wiki UI go right-to-left if the user
6 chooses, but right now what's really important to me as an RTL language user
7 is that the body text can go right-to-left.
8
9 This can be done with CSS easily:
10
11 [[!format css """
12 body {
13     text-align: right;
14 }
15 """]]
16
17 Currently there are two ways to make specific pages be RTL:
18
19 1. Include a local.css file with the above code as an attachment of each RTL page
20 2. Specify CSS with the [[ikiwiki/directive/meta]] directive
21
22 The problem is that option 2 requires [[plugins/htmlscrubber]] to be off.
23
24 My suggestion: Add a parameter to the meta directive, which allows adding
25 an *rtl.css* file in addition to the exisiting ones. This file can be both at the top-level
26 and per-page overriden, just like local.css. The page.tmpl file can then use the
27 meta field to conditionally use the rtl.css, both the wiki-global one and the
28 per-page one (just like it does with local.css, IIRC).
29
30 And it won't require htmlscrubber off, just like local.css doesn't.
31
32 In the future rtl.css can be extended to also RTLize the whole UI, e.g. including the
33 location of the "buttons" at the top, the page name, code blocks and so on.
34
35 What do you think? I can try this and send a patch. It just requires an additional
36 meta field and a CSS file.
37
38 For example, to make a page RTL include something like this inside it:
39
40     \[[!meta dir="rtl"]]
41
42 Please tell me what you think.
43
44 --[[fr33domlover]]
45
46 [[!tag wishlist]]