{"id":13483975,"url":"https://github.com/skoji/gepub","last_synced_at":"2025-05-14T13:06:22.892Z","repository":{"id":894972,"uuid":"647645","full_name":"skoji/gepub","owner":"skoji","description":"a generic EPUB library for Ruby : supports EPUB 3 ","archived":false,"fork":false,"pushed_at":"2025-05-06T03:30:52.000Z","size":29034,"stargazers_count":240,"open_issues_count":14,"forks_count":43,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-06T04:29:11.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skoji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"skoji"}},"created_at":"2010-05-05T01:21:18.000Z","updated_at":"2025-05-06T03:30:56.000Z","dependencies_parsed_at":"2024-07-31T04:48:05.211Z","dependency_job_id":"2991327e-c020-4e61-8c2d-b03e418402ac","html_url":"https://github.com/skoji/gepub","commit_stats":{"total_commits":540,"total_committers":24,"mean_commits":22.5,"dds":"0.26481481481481484","last_synced_commit":"fa5b385f0650ee74cdcf032be5594bd1d4b08370"},"previous_names":[],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoji%2Fgepub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoji%2Fgepub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoji%2Fgepub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoji%2Fgepub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skoji","download_url":"https://codeload.github.com/skoji/gepub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252623710,"owners_count":21778285,"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-07-31T17:01:17.480Z","updated_at":"2025-05-14T13:06:22.858Z","avatar_url":"https://github.com/skoji.png","language":"Ruby","readme":"# gepub  \n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/skoji/gepub?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![GitHub Actions Status](https://github.com/skoji/gepub/workflows/Test/badge.svg)](https://github.com/skoji/gepub/actions?query=workflow%3ATest)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/acd6df07e071a4bbb399/test_coverage)](https://codeclimate.com/github/skoji/gepub/test_coverage)\n[![Gem Version](https://badge.fury.io/rb/gepub.svg)](http://badge.fury.io/rb/gepub)\n\n* https://rubydoc.info/github/skoji/gepub\n\n## DESCRIPTION:\n\na generic EPUB parser/generator library.\n\n## FEATURES/PROBLEMS:\n\n* GEPUB::Book provides functionality to create EPUB files and parse EPUB files\n* Handle every metadata in EPUB2/EPUB3.\n\n* See [issues](https://github.com/skoji/gepub/issues/) for known problems.\n\nIf you are using GEPUB::Builder and do not like its behavior (e.g., GEPUB::Builder evaluates the block as inside the Builder instance),  consider using GEPUB::Book directly.\n\n## SYNOPSIS:\n\n### Example\n\n```ruby\nrequire 'rubygems'\nrequire 'gepub'\n\nbook = GEPUB::Book.new\nbook.primary_identifier('http://example.jp/bookid_in_url', 'BookID', 'URL')\nbook.language = 'ja'\n\nbook.add_title 'GEPUBサンプル文書', \n               title_type: GEPUB::TITLE_TYPE::MAIN,\n               lang: 'ja',\n               file_as: 'GEPUB Sample Book',\n               display_seq: 1,\n               alternates: {\n                       'en' =\u003e 'GEPUB Sample Book (Japanese)',\n                       'el' =\u003e 'GEPUB δείγμα (Ιαπωνικά)',\n                       'th' =\u003e 'GEPUB ตัวอย่าง (ญี่ปุ่น)' }\n               \n# you can do the same thing using method chain\nbook.add_title('これはあくまでサンプルです', title_type: GEPUB::TITLE_TYPE::SUBTITLE).display_seq(1).add_alternates('en' =\u003e 'this book is just a sample.')\n\n# use arguments\nbook.add_creator '小嶋智', \n                 display_seq:1, \n                 alternates: { 'en' =\u003e 'KOJIMA Satoshi' } \nbook.add_contributor '電書部',\n                     display_seq: 1,\n                     alternates: {'en' =\u003e 'Denshobu'}\nbook.add_contributor 'アサガヤデンショ',\n                     display_seq: 2, \n                     alternates: {'en' =\u003e 'Asagaya Densho'}\n# you can also use method chain\nbook.add_contributor('湘南電書鼎談').display_seq(3).add_alternates('en' =\u003e 'Shonan Densho Teidan')\nbook.add_contributor('電子雑誌トルタル').display_seq(4).add_alternates('en' =\u003e 'eMagazine Torutaru')\n\nimgfile = File.join(File.dirname(__FILE__),  'image1.jpg')\nFile.open(imgfile) do\n  |io|\n  book.add_item('img/image1.jpg',content: io).cover_image\nend\n\n# within ordered block, add_item will be added to spine.\nbook.ordered {\n  book.add_item('text/cover.xhtml',\n                content: StringIO.new(\u003c\u003c-COVER)).landmark(type: 'cover', title: 'cover page')\n                \u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n                \u003chead\u003e\n                  \u003ctitle\u003ecover page\u003c/title\u003e\n                \u003c/head\u003e\n                \u003cbody\u003e\n                \u003ch1\u003eThe Book\u003c/h1\u003e\n                \u003cimg src=\"../img/image1.jpg\" /\u003e\n                \u003c/body\u003e\u003c/html\u003e\n  COVER\n  book.add_item('text/chap1.xhtml').add_content(StringIO.new(\u003c\u003c-CHAP_ONE)).toc_text('Chapter 1').landmark(type: 'bodymatter', title: '本文')\n  \u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n  \u003chead\u003e\u003ctitle\u003ec1\u003c/title\u003e\u003c/head\u003e\n  \u003cbody\u003e\u003cp\u003ethe first page\u003c/p\u003e\u003c/body\u003e\u003c/html\u003e\n  CHAP_ONE\n  book.add_item('text/chap1-1.xhtml').add_content(StringIO.new(\u003c\u003c-SEC_ONE_ONE)) # do not appear on table of contents\n  \u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n  \u003chead\u003e\u003ctitle\u003ec2\u003c/title\u003e\u003c/head\u003e\n  \u003cbody\u003e\u003cp\u003ethe second page\u003c/p\u003e\u003c/body\u003e\u003c/html\u003e\n  SEC_ONE_ONE\n  book.add_item('text/chap2.xhtml').add_content(StringIO.new(\u003c\u003c-CHAP_TWO)).toc_text('Chapter 2')\n  \u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\n  \u003chead\u003e\u003ctitle\u003ec3\u003c/title\u003e\u003c/head\u003e\n  \u003cbody\u003e\u003cp\u003ethe third page\u003c/p\u003e\u003c/body\u003e\u003c/html\u003e\n  CHAP_TWO\n  # to add nav file:\n  # book.add_item('path/to/nav').add_content(nav_html_content).add_property('nav')\n}\nepubname = File.join(File.dirname(__FILE__), 'example_test.epub')\n\n# if you do not specify a nav document with add_item, \n# generate_epub will generate simple navigation text.\n# auto-generated nav file will not appear on the spine.\nbook.generate_epub(epubname)\n```\n * [examples in this repository](https://github.com/skoji/gepub/tree/main/examples/) \n\n## INSTALL:\n\n* gem install gepub\n\n## DONATE:\n\n* Bitcoin Address: `1M69AwoxpgPZsp5KStLUEjP7so5dHVfDTH`\n","funding_links":["https://github.com/sponsors/skoji"],"categories":["Ebook"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskoji%2Fgepub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskoji%2Fgepub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskoji%2Fgepub/lists"}