{"id":22328696,"url":"https://github.com/seangenabe/rubyfy","last_synced_at":"2025-07-29T18:31:36.886Z","repository":{"id":16805764,"uuid":"19564643","full_name":"seangenabe/rubyfy","owner":"seangenabe","description":"Easily write ruby annotations and output them as HTML.","archived":false,"fork":false,"pushed_at":"2024-02-16T12:47:49.000Z","size":258,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-27T13:38:39.825Z","etag":null,"topics":["html","parser","ruby-annotation"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seangenabe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-08T07:32:02.000Z","updated_at":"2024-02-14T12:31:45.000Z","dependencies_parsed_at":"2024-10-26T21:19:27.522Z","dependency_job_id":"e7898f3a-e08d-45d3-9183-106ed07c1b2b","html_url":"https://github.com/seangenabe/rubyfy","commit_stats":{"total_commits":63,"total_committers":4,"mean_commits":15.75,"dds":"0.38095238095238093","last_synced_commit":"08501da88c2133b5eda0d3081cfee9109eb83c8f"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seangenabe%2Frubyfy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seangenabe%2Frubyfy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seangenabe%2Frubyfy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seangenabe%2Frubyfy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seangenabe","download_url":"https://codeload.github.com/seangenabe/rubyfy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228034838,"owners_count":17859246,"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":["html","parser","ruby-annotation"],"created_at":"2024-12-04T03:13:16.229Z","updated_at":"2024-12-04T03:13:16.841Z","avatar_url":"https://github.com/seangenabe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rubyfy\n\nEasily write ruby annotations and output them as HTML.\n\n[![npm](https://img.shields.io/npm/v/rubyfy.svg?style=flat-square)](https://www.npmjs.com/package/rubyfy)\n[![node](https://img.shields.io/node/v/rubyfy.svg?style=flat-square)](https://nodejs.org/en/download/)\n\n## Usage\n\n```javascript\nimport { rubyfy } from \"rubyfy\"\n```\n\nConvert a string by wrapping the ruby text in full-width parentheses `（）`:\n\n```javascript\nrubyfy('日（に）本（ほん）語（ご）')\n// =\u003e \u003cruby\u003e日\u003crp\u003e(\u003c/rp\u003e\u003crt\u003eに\u003c/rt\u003e\u003crp\u003e)\u003c/rp\u003e\u003c/ruby\u003e\u003cruby\u003e本\u003crp\u003e(\u003c/rp\u003e\u003crt\u003eほん\u003c/rt\u003e\u003crp\u003e)\u003c/rp\u003e\u003c/ruby\u003e\u003cruby\u003e語\u003crp\u003e(\u003c/rp\u003e\u003crt\u003eご\u003c/rt\u003e\u003crp\u003e)\u003c/rp\u003e\u003c/ruby\u003e\n```\n\nThe type of the return value is an array of DOM `Node`s, which should be compatible with libraries like [bel](https://www.npmjs.com/package/bel).\n\nAny string of numerals 0-9, CJK characters, and the characters `々` and `ヶ`, will be captured.\n\n```javascript\nrubyfy('今日（きょう）')\n// =\u003e \u003cruby\u003e今日\u003crp\u003e(\u003c/rp\u003e\u003crt\u003eきょう\u003c/rt\u003e\u003crp\u003e)\u003c/rp\u003e\u003c/ruby\u003e\n```\n\nForce a portion of the text to be the ruby body using double full-width parentheses `（（））`:\n\n```javascript\nrubyfy('（（Alice））（アリス）')\n// =\u003e \u003cruby\u003eAlice\u003crp\u003e(\u003c/rp\u003e\u003crt\u003eアリス\u003c/rt\u003e\u003crp\u003e)\u003c/rp\u003e\u003c/ruby\u003e\n```\n\n## Advanced usage\n\nYou can take the parser and the renderer to use for yourself:\n\n```javascript\nimport { parse } from \"rubyfy/out/parser.js\"\nparse('漢（かん）字（じ）です')\n```\n\nOutput:\n```json\n[\n  { \"rb\": \"漢\", \"rt\": \"かん\" },\n  { \"rb\": \"字\", \"rt\": \"じ\"},\n  \"です\"\n]\n```\n\nRender using the parse result:\n```javascript\nimport { render } from \"rubyfy/out/render.js\"\nrender(parseResult)\n```\n\nMore details on the [API documentation](./API.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseangenabe%2Frubyfy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseangenabe%2Frubyfy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseangenabe%2Frubyfy/lists"}