MediaWiki  REL1_22
README
Go to the documentation of this file.
00001 =CSSJanus=
00002 
00003 _Flips CSS from LTR to an RTL orienation and vice-versa_
00004 
00005 Author: `Lindsey Simon <[email protected]>`
00006 
00007 ==Introduction==
00008 
00009 CSSJanus is CSS parser utility designed to aid the conversion of a website's
00010 layout from left-to-right(LTR) to right-to-left(RTL). The script was born out of
00011 a need to convert CSS for RTL languages when tables are not being used for layout (since tables will automatically reorder TD's in RTL).
00012 CSSJanus will change most of the obvious CSS property names and their values as
00013 well as some not-so-obvious ones (cursor, background-position %, etc...).
00014 The script is designed to offer flexibility to account for cases when you do
00015 not want to change certain rules which exist to account for bidirectional text
00016 display bugs, as well as situations where you may or may not want to flip annotations inside of the background url string.
00017 Note that you can disable CSSJanus from running on an entire class or any
00018 rule within a class by prepending a /* @noflip */ comment before the rule(s)
00019 you want CSSJanus to ignore.
00020 
00021 CSSJanus itself is not always enough to make a website that works in a LTR
00022 language context work in a RTL language all the way, but it is a start.
00023 
00024 ==Getting the code==
00025 
00026 View the trunk at:
00027 
00028   http://cssjanus.googlecode.com/svn/trunk/
00029 
00030 Check out the latest development version anonymously with:
00031 
00032 {{{
00033   $ svn checkout http://cssjanus.googlecode.com/svn/trunk/ cssjanus
00034 }}}
00035 
00036 ==Using==
00037 
00038 Usage:
00039   ./cssjanus.py < file.css > file-rtl.css
00040 Flags:
00041   --swap_left_right_in_url: Fixes "left"/"right" string within urls.
00042   Ex: ./cssjanus.py --swap_left_right_in_url < file.css > file_rtl.css
00043   --swap_ltr_rtl_in_url: Fixes "ltr"/"rtl" string within urls.
00044   Ex: ./cssjanus.py --swap_ltr_rtl_in_url < file.css > file_rtl.css
00045 
00046 If you'd like to make use of the webapp version of cssjanus, you'll need to
00047 download the Google App Engine SDK
00048   http://code.google.com/appengine/downloads.html
00049 and also drop a "django" directory into this directory, with the latest svn
00050 from django. You should be good to go with that setup. Please let me know
00051 otherwise.
00052 
00053 ==Bugs, Patches==
00054 
00055 Patches and bug reports are welcome, just please keep the style
00056 consistent with the original source. If you find a bug, please include a diff
00057 of cssjanus_test.py with the bug included as a new unit test which fails. It
00058 will make understanding and fixing the bug easier.
00059 
00060 ==Todo==
00061 
00062 * Include some helpers for some typical bidi text solutions?
00063 * Aural CSS (azimuth) swapping?
00064 
00065 ==Contributors==
00066 
00067 Additional thanks to Mike Samuel for his work on csslex.py, Andy Perelson for
00068 his help coding and reviewing, Stephen Zabel for his help with i18n and my sanity,
00069 and to Eric Meyer for his thoughtful input.
00070 Thanks to Junyu Wang for the Chinese translation.
00071 Thanks to Masashi Kawashima for the Japanese translation.
00072 Thanks to Taaryk Taar and Tariq Al-Omaireeni for an updated Arabic translation.
00073 Thanks to Jens Meiert for the German translation.
00074 
00075 ==License==
00076 
00077 {{{
00078   Copyright 2008 Google Inc. All Rights Reserved.
00079 
00080   Licensed under the Apache License, Version 2.0 (the 'License');
00081   you may not use this file except in compliance with the License.
00082   You may obtain a copy of the License at
00083 
00084       http://www.apache.org/licenses/LICENSE-2.0
00085 
00086   Unless required by applicable law or agreed to in writing, software
00087   distributed under the License is distributed on an 'AS IS' BASIS,
00088   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00089   See the License for the specific language governing permissions and
00090   limitations under the License.
00091 }}}