{"id":18062798,"url":"https://github.com/ded/r2","last_synced_at":"2025-04-05T04:12:39.051Z","repository":{"id":1536415,"uuid":"1834885","full_name":"ded/R2","owner":"ded","description":"a CSS LTR ∞ RTL converter for i18 friendly layouts","archived":false,"fork":false,"pushed_at":"2019-10-17T09:37:55.000Z","size":311,"stargazers_count":160,"open_issues_count":7,"forks_count":29,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-27T05:36:07.942Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ded.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-06-02T00:34:18.000Z","updated_at":"2024-09-19T11:47:34.000Z","dependencies_parsed_at":"2022-08-16T13:40:28.316Z","dependency_job_id":null,"html_url":"https://github.com/ded/R2","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ded%2FR2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ded%2FR2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ded%2FR2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ded%2FR2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ded","download_url":"https://codeload.github.com/ded/R2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284951,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-31T05:08:28.274Z","updated_at":"2025-04-05T04:12:39.035Z","avatar_url":"https://github.com/ded.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"R2 [![build status](https://secure.travis-ci.org/ded/R2.png)](http://travis-ci.org/ded/R2) [![NPM version](https://badge.fury.io/js/R2.png)](http://badge.fury.io/js/R2)\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nR2 helps you achieve cross-language layout-friendly websites (including bi-directional text). It looks like this:\n\n``` css\n/* before */\n#content {\n  float: left;\n  margin-right: 2px;\n  padding: 1px 2px 3px 4px;\n  left: 5px;\n}\n.info {\n  text-align: right;\n}\n\n/* after */\n#content {\n  float: right;\n  margin-left: 2px;\n  padding: 1px 4px 3px 2px;\n  right: 5px;\n}\n.info {\n  text-align: left;\n}\n```\n\nInstall it\n----------\n\n    $ [sudo] npm install R2 -g\n\nUse it as a CLI\n---------------\n\n### Print to stdout\n    \n    $ r2 input.css\n  \n### Print to output file\n    \n    $ r2 input.css output.css\n\n### Print to output file without compression\n\n    $ r2 input.css output.css  --no-compress\n\n### Read from output of another command\n    \n    $ lessc input.less | r2 \u003e output.css\n\nRequire it as a Node module\n------------------------------\n\n``` js\nvar output = require('R2').swap(css)\n```\n\nTest It\n----------\n\n   $ npm test\n\nCaution\n--------\nR2 will only work as good as what you give it, therefore *inline-styles* embedded in your HTML will not converted, and therefore may cause unexpected results. However inline-styles apart from R2 is still a bad idea, and you should avoid it anyway in favor of separating content from presentation.\n\n**Happy layout Swapping!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fded%2Fr2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fded%2Fr2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fded%2Fr2/lists"}