Right_to_Left.mdwn 1.4 KB

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