]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/Right-to-left___40__RTL__41___page_text.mdwn
Merge branch 'master' of git://ikiwiki.branchable.com
[ikiwiki.git] / doc / tips / Right-to-left___40__RTL__41___page_text.mdwn
1 Here's a simple way to create pages in which the page body (or a part of it) goes right-to-left.
2 This includes things you insert into the page, such as polls and blockquotes and
3 lists and a progress bar and so on. Some things don't work perfectly, but if
4 you want to have some RTL pages in your wiki, this will probably do.
5
6 It does not modify the things around the body, such as the page header and the
7 footer. Only what is rendered from the mdwn file is affected.
8
9 # 1 Add an RTL Template
10
11 Create a new template page *templates/rtl.mdwn* with the following content:
12
13     <div class="rtl">
14     <TMPL_VAR text>
15     </div>
16     <TMPL_UNLESS text>
17     Use this template to insert RTL text into a page. 
18     This template has one parameter:
19     <ul>
20     <li>`text` - the text to display in RTL
21     </ul>
22     </TMPL_UNLESS>
23
24 # 2 Add an RTL class to the CSS
25
26 In your *local.css* add the following:
27
28 [[!format css """
29 /* rtl template */
30 .rtl {
31     direction: rtl;
32 }
33 """]]
34
35 # 3 Use the Template
36
37 To make a page or part of it RTL, use the [[ikiwiki/directive/template]] directive:
38
39     \[[!template id="rtl" text="""
40     
41     This text will be aligned to the right. You can write here in Hebrew, Arabic, etc. You can
42     put here anything you want to put on the page. As said above, some elements may not
43     align perfectly, but:
44
45     1. It can be solved per case
46     2. It's not critical, everything works quite well and is readable. If you have any comments,
47         suggestions, improvements, bugs, etc - please share here :-)
48     
49     """]]