{"id":24264608,"url":"https://github.com/yigger/rubyword","last_synced_at":"2025-10-06T18:06:22.472Z","repository":{"id":56893743,"uuid":"109278670","full_name":"yigger/rubyword","owner":"yigger","description":"RubyWord is a simple, efficient word document generation gem and easy to generate docx file","archived":false,"fork":false,"pushed_at":"2017-11-02T14:55:03.000Z","size":251,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-19T08:16:46.865Z","etag":null,"topics":["gem","ruby","rubyword","word"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/yigger.png","metadata":{"files":{"readme":"README.cn.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-02T14:53:40.000Z","updated_at":"2019-12-03T12:47:43.000Z","dependencies_parsed_at":"2022-08-20T16:10:46.331Z","dependency_job_id":null,"html_url":"https://github.com/yigger/rubyword","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yigger/rubyword","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yigger%2Frubyword","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yigger%2Frubyword/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yigger%2Frubyword/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yigger%2Frubyword/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yigger","download_url":"https://codeload.github.com/yigger/rubyword/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yigger%2Frubyword/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278655146,"owners_count":26022968,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["gem","ruby","rubyword","word"],"created_at":"2025-01-15T09:32:34.738Z","updated_at":"2025-10-06T18:06:22.435Z","avatar_url":"https://github.com/yigger.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RubyWord: Microsoft Word Generation For Ruby\n\u003e RubyWord 是一个便捷的 word 文档生成工具\n\n# 语言\n* [English](README.md)\n* [简体中文](README.cn.md)\n\n# 更新日志\n[ChANGELOG](CHANGELOG.md)\n\n# 使用前请先阅读\n这个项目正在开发中，因为只有我自己在开发，所以进度可能会比较缓慢以及可能会存在很多未知的问题。这方面请多谅解，同时也希望各位有兴趣的朋友也加入到开发来，欢迎多提宝贵意见或者直接提PR也是非常欢迎的，感谢支持。\n\n# 安装\n```\ngem install rubyword\n```\n或者将下面这句代码写入到Gemfile\n```\ngem 'rubyword'\n```\n# 特性\n+ 支持设置文档的属性，比如： 标题，副标题，作者以及等等\n+ 支持插入段落\n+ 支持根据一级标题，二级标题，多级标题自动生成目录结构\n+ 支持设置页头和页尾\n+ 支持插入多级标题\n+ 支持插入空行符以及空白页\n+ 支持插入图片\n+ 支持插入列表\n+ 支持插入超链接\n+ 支持插入表格\n+ 更多功能，敬请期待..\n\n# 用法说明\n```\nrequire \"rubyword\"\nRubyword::Document::generate('hello.docx') {\n  # word 文档的属性\n  information({\n    company: 'ruby word',\n    creator: 'young',\n    title: 'example word file',\n    description: 'this is a example docx',\n    subject: 'how to create doc info',\n    keywords: 'remark',\n    category: 'category'\n  })\n  \n  section {\n    text '普通段落1'\n    p(text_align: 'center') {\n      text '连续的文本1'\n      text '连续的文本'\n    }\n    text '普通段落2'\n\n    p {\n      text '不居中的文本 '\n      text '黄色的文本', bgcolor: 'yellow', text_align: 'center'\n    }\n  }\n\n  # 根据标题生成目录\n  title_directory font_size: 24\n\n  # 插入页头\n  add_header 'rubyword'\n\n  # 插入页尾，并以数字作为页码\n  add_footer nil, text_align: 'center', nums_type: 'number'\n  # 插入页尾，使用字符作为页码\n  # add_footer 'hello', text_align: 'center'\n\n  section {\n    # 二级标题\n    title_2 \"It's a subtitle\"\n    # 一级标题\n    title_1 'Database'\n    # 二级标题\n    title_2 'MySQL'\n    # 三级标题\n    title_3 'NoSQL'\n    # 一级标题，并且不把它列入目录生成的范围\n    title_1 \"It's a title\", ignore_dir: true \n    # 空白行\n    text_break 3\n    # 插入文本并指定样式\n    text 'hello word', bgcolor: 'yellow', text_align: 'center'\n    # 空白页\n    page_break 2\n    # 插入文本\n    text 'hello word', indent_between: '1440-1440'\n    text 'title', { font_size: 62, color: '996699', blod: true, text_align: 'center' }\n\n    # 插入标题\n    title_1 'section2 title'\n    title_2 'section2 title'\n    title_3 'section2 title'\n\n    # 插入链接\n    link 'baidu', 'http://www.baidu.com', text_align: 'center'\n  }\n\n  section {\n    # 插入文本\n    text 'another Section', bgcolor: 'yellow', text_align: 'center'\n\n    # 插入文本\n    text 'hello word', indent_between: '1440-1440'\n    text 'title', { font_size: 62, color: '996699', blod: true, text_align: 'center' }\n  }\n\n  # 插入列表\n  section {\n    list 'test1', 1\n    list 'test1', 2\n    list 'test3', 2\n    list 'test2', 1\n    list 'test2', 1\n  }\n\n  section {\n    # 插入链接\n    link 'baidu', 'http://www.baidu.com', text_align: 'center'\n    # 插入图片\n    image 'http://www.baidu.com/img/bd_logo1.png'\n    # 插入表格\n    table {\n      tr {\n        th 'id'\n        th 'name'\n        th 'age'\n      }\n      tr {\n        th '1'\n        th 'young'\n        th '66'\n      }\n    }\n  }\n\n\n}\n```\n\n# 文档\n[查看文档](doc/README.md)\n\n# 马上要做的\n+ 支持更多样式\n+ 支持markdown/html转换为word\n\n# 贡献\n非常欢迎有兴趣的朋友加入到开发中，以下是提交流程\n1. fork this project\n2. git clone your fork project\n3. git checkout -b fixed-something\n4. git commit fixed some bug.\n5. git push to your fork project\n6. create a new pr to request merge\n\n# 灵感\n首先非常感谢 [PHPWord](https://github.com/PHPOffice/PHPWord), 因为在无意中发现了 PHPWord 的这个非常强大项目， 并且该项目支持很多各种各样的特性。但是当我在寻找我大 Ruby 这类相关项目的时候居然找不到，本着学习的精神，参考了 PHPWord 的设计，就自己写了一个啦，欢迎 Star 支持一下。\n\n# 协议\nRubyWord is licensed under [The MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyigger%2Frubyword","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyigger%2Frubyword","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyigger%2Frubyword/lists"}