{"id":31834834,"url":"https://github.com/javiorfo/liber","last_synced_at":"2026-03-03T16:13:49.712Z","repository":{"id":245930778,"uuid":"806682096","full_name":"javiorfo/liber","owner":"javiorfo","description":"Rust library for creating (sync/async) EPUB files","archived":false,"fork":false,"pushed_at":"2026-02-19T21:59:14.000Z","size":163,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-20T01:31:46.228Z","etag":null,"topics":["epub","epub-library","epub2","rust","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/javiorfo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-27T17:13:39.000Z","updated_at":"2026-02-19T21:58:50.000Z","dependencies_parsed_at":"2024-07-13T09:13:24.629Z","dependency_job_id":"1b4050bd-74eb-477c-815c-9061b1c3ecc6","html_url":"https://github.com/javiorfo/liber","commit_stats":null,"previous_names":["javiorfo/st","chaosystema/st","javiorfo/liber"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/javiorfo/liber","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fliber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fliber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fliber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fliber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javiorfo","download_url":"https://codeload.github.com/javiorfo/liber/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fliber/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30051315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T15:26:47.567Z","status":"ssl_error","status_checked_at":"2026-03-03T15:26:17.132Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["epub","epub-library","epub2","rust","rust-library"],"created_at":"2025-10-12T00:24:45.313Z","updated_at":"2026-03-03T16:13:49.707Z","avatar_url":"https://github.com/javiorfo.png","language":"Rust","funding_links":["https://www.paypal.com/donate/?hosted_button_id=FA7SGLSCT2H8G"],"categories":[],"sub_categories":[],"readme":"# liber\n*Go library for creating EPUB files*\n\n## Description\n- This library provides a high-level, ergonomic API for creating EPUB files (2.0.1). \n- It covers all [epubcheck](https://github.com/w3c/epubcheck) validations\n\n## Installation\n```bash\ngo get -u github.com/javiorfo/liber@latest\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n  \"log\"\n  \"os\"\n\n  \"github.com/javiorfo/liber\"\n  \"github.com/javiorfo/liber/body\"\n  \"github.com/javiorfo/liber/ident\"\n  \"github.com/javiorfo/liber/lang\"\n  \"github.com/javiorfo/liber/reftype\"\n  \"github.com/javiorfo/liber/resource\"\n)\n\nfunc main() {\n  f, err := os.Create(\"book.epub\")\n  if err != nil {\n\t  panic(err)\n  }\n  defer f.Close()\n\n  e := liber.EpubBuilder(\n\t  liber.MetadataBuilder(\"My Book\", lang.Spanish, ident.Default()).\n\t\t  Creator(\"Johan Gambolputty\").\n\t\t  Build(),\n  ).\n\t  Stylesheet(body.Raw(\"body {}\")).\n\t  CoverImage(resource.JpgFile(\"/path/cats.jpg\")).\n\t  AddResources(resource.PngFile(\"/path/cs.png\")).\n\t  AddContents(\n\t\t  liber.ContentBuilder(body.Raw(\n          `\u003cbody\u003e\n            \u003ch1\u003eChapter 1\u003c/h1\u003e\n\t\t    \u003ch2 id=\"id01\"\u003eSection 1.1\u003c/h2\u003e\n\t\t    \u003ch2 id=\"id02\"\u003eSection 1.1.1\u003c/h2\u003e\n\t\t    \u003ch2 id=\"id03\"\u003eSection 1.2\u003c/h2\u003e\n          \u003c/body\u003e`,\n          ), reftype.Text(\"Chapter 1\")).\n\t\t\t  AddContentReferences(liber.ContentReferenceBuilder(\"Section 1.1\").\n\t\t\t\t  AddChildren(liber.ContentReferenceBuilder(\"Section 1.1.1\").Build()).\n\t\t\t\t  Build()).\n\t\t\t  AddContentReferences(liber.ContentReferenceBuilder(\"Section 1.2\").Build()).\n\t\t\t  AddChildren(\n\t\t\t\t  liber.ContentBuilder(body.Raw(\"\u003cbody\u003e\u003ch1\u003eChapter 2\u003c/h1\u003e\u003c/body\u003e\"), reftype.Text(\"Chapter 2\")).Build(),\n\t\t\t\t  liber.ContentBuilder(body.Raw(\"\u003cbody\u003e\u003ch1\u003eChapter 3\u003c/h1\u003e\u003c/body\u003e\"), reftype.Text(\"Chapter 3\")).\n\t\t\t\t\t  AddChildren(liber.ContentBuilder(body.Raw(\"\u003cbody\u003e\u003ch1\u003eChapter 4\u003c/h1\u003e\u003c/body\u003e\"), reftype.Text(\"Chapter 4\")).\n\t\t\t\t\t\t  Build()).\n\t\t\t\t\t  Build(),\n\t\t\t  ).\n\t\t\t  Build(),\n\t  ).\n\t  Build()\n\n  if err := liber.Create(\u0026e, f); err != nil {\n      os.Remove(\"book.epub\")\n\t  log.Fatal(err)\n  }\n}\n```\n\n## Details\n- Every content is a **xhtml**. The entire xhml text or only the body could be added as content (the latter is more practical and secure because follows the standard). See [examples](https://github.com/javiorfo/liber/tree/master/examples))\n- Content (Ex: Chapter) and ContentReference (Ex: Chapter#ref1) could be named with filename and id methods respectively. If none is set, Content will be sequential c{number}.xhtml (c01.xhtml, c02.xhtml...) and ContentReferences will be id{number} (id01, id02...) corresponding to the Content.\n\n\n---\n\n### Donate\n- **Bitcoin** [(QR)](https://raw.githubusercontent.com/javiorfo/img/master/crypto/bitcoin.png)  `1GqdJ63RDPE4eJKujHi166FAyigvHu5R7v`\n- [Paypal](https://www.paypal.com/donate/?hosted_button_id=FA7SGLSCT2H8G)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaviorfo%2Fliber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaviorfo%2Fliber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaviorfo%2Fliber/lists"}