R2 - Node.js Module for LTR to RTL Layout Swapping

ATIA Web Space and its theme are built on the top of Twitter Bootstrap. Twitter Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development. But it lacks RTL (right-to-left) support. Indeed that was a problem when building the بالعربى section of my web space. So I googled for RTL support in Bootstrap and I found a very handy open source Node.js module named R2 that enabled me from swapping Bootstrap and site theme layout from LTR to RTL.

How to use R2 to achieve layout swapping?

  1. Download and install Node.js for your platform. Be sure to check the "npm package manager" option to be installed.
  2. Download and install R2 Module that is available on the Node Packaged Modules Registry
    • use Node.js command line to run the following command to install R2 module npm install -g R2
    • install is a an NPM command that installs a package, and any packages that it depends on.
    • -g indicated that package to be installed as a global package i.e. adds it to the System Path so you can run it from any command line.
  3. Run R2 Module on the LTR CSS files to convert them to LTR. Use Windows command line (CMD.exe) to run the following command to swap layout from LTR to RTL r2 input.css output.css
    where input.css is the name of the input LTR file and output.css is the name of the output RTL file
Show Comments