{"id":16488603,"url":"https://github.com/kerams/epubfs","last_synced_at":"2026-02-28T15:02:54.360Z","repository":{"id":133762925,"uuid":"525338127","full_name":"kerams/EpubFs","owner":"kerams","description":"EPUB authoring library for F#.","archived":false,"fork":false,"pushed_at":"2022-08-17T11:20:50.000Z","size":62,"stargazers_count":29,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-12T18:07:00.368Z","etag":null,"topics":["dotnet","ebook","epub","fsharp"],"latest_commit_sha":null,"homepage":"","language":"F#","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/kerams.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}},"created_at":"2022-08-16T10:50:24.000Z","updated_at":"2025-05-03T04:22:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce4e7976-59ec-4010-8213-18c0113bca1b","html_url":"https://github.com/kerams/EpubFs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kerams/EpubFs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2FEpubFs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2FEpubFs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2FEpubFs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2FEpubFs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kerams","download_url":"https://codeload.github.com/kerams/EpubFs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2FEpubFs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269707863,"owners_count":24462474,"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-08-10T02:00:08.965Z","response_time":71,"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":["dotnet","ebook","epub","fsharp"],"created_at":"2024-10-11T13:39:20.942Z","updated_at":"2026-02-28T15:02:49.317Z","avatar_url":"https://github.com/kerams.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EpubFs\n\nEPUB authoring library for F#.\n\n## Nuget package\n[![Nuget](https://img.shields.io/nuget/v/EpubFs.svg?colorB=green)](https://www.nuget.org/packages/EpubFs)\n\n## Project status\n\nThis library has been extracted from a personal project of mine and represents the bare minimum necessary to create EPUB files for my purposes. As such, I do not intend to continue developing any new major features.\n\nHowever, if you or your company have a need for a particular feature or require that some other part of the EPUB spec be implemented, and you are willing to pay for the development, I would be more than happy to work with you!\n\nBug reports and PRs will naturally still be looked at.\n\n## Usage\n\nIn order to create an EPUB, you need to supply some metadata and a file manifest including the title page, list of files with the actual book content as well as any CSS files you want to use.\n\n### Content files\n\nContent files are accepted in the form of `XmlNode list`, which you can construct using the [`Giraffe.ViewEngine` DSL](https://github.com/giraffe-fsharp/Giraffe.ViewEngine), or as a `Stream` containing an XHTML that you have obtained in some other way.\n\n### CSS files\n\nYou can also include stylesheets to be used in the book. If a content file is provided as `XmlNode list`, every CSS file will automatically be referenced therein. On the other hand, if you're supplying a full XHTML file, you need to import the stylesheet (in the traditional HTML fashion) yourself by using the `FileName` of a matching CSS file.\n\n### Table of contents (navigation document)\n\nEvery EPUB requires a navigation document. There are two choices here - either you supply an XHTML (it has to conform to the navigation spec!) directly, or you let the library generate a simple table of contents page with hyperlinks to each of your content files (whose `Navigation` is not set to `None`).\n\n### Example\n\n```fsharp\nopen EpubFs\nopen EpubFs.Write\nopen Giraffe.ViewEngine\nopen System.IO\nopen System.Text\n\nlet metadata = {\n    // A unique book identifier, could be ISBN or URL...\n    Id = \"my-book\"\n    Title = \"Ὀδύσσεια\"\n    // List of language tags - you should use ISO 639-2\n    // If you specify more than one, the first is considered the primary language of the book\n    Languages = [ \"grc\" ]\n    // `None` defaults to DateTimeOffset.UtcNow\n    ModifiedAt = None\n    Source = Some \"https://el.wikisource.org/wiki/%CE%9F%CE%B4%CF%8D%CF%83%CF%83%CE%B5%CE%B9%CE%B1\"\n    Creators = [ \"John Doe\"; \"Ὅμηρος\" ]\n}\n\n// The CSS Stream you would like to use throughout the book\nlet css = new MemoryStream (Encoding.UTF8.GetBytes \".red-font { color: red }\")\n\n// Let's declare the title page document using `Giraffe.ViewEngine`\n// Use the `red-font` class from our stylesheet\nlet titlePage = {\n    FileName = \"title.xhtml\"\n    Title = \"Title\"\n    Input = Structured [\n        h1 [ _class \"red-font\" ] [\n            str \"Ὀδύσσεια\"\n        ]\n    ]\n    Navigation = None\n}\n\n// We already have a pre-built XHTML of the first content document, so pass it as a stream\n// Notice the manual reference to our stylesheet\nuse chapter1Stream =\n    \"\"\"\u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"\u003e\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\u003chead\u003e\u003clink href=\"main.css\" type=\"text/css\" rel=\"stylesheet\"/\u003e\u003ctitle\u003ePage one\u003c/title\u003e\u003c/head\u003e\u003cbody\u003e\u003cdiv class=\"red-font\"\u003eἌνδρα μοι ἔννεπε, Μοῦσα, πολύτροπον, ὃς μάλα πολλὰ\u003c/div\u003e\u003cdiv\u003eπλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσε·\u003c/div\u003e\u003c/body\u003e\u003c/html\u003e\"\"\"\n    |\u003e Encoding.UTF8.GetBytes\n    |\u003e MemoryStream\n\nlet chapter1 = {\n    FileName = \"chapter1.xhtml\"\n    Title = \"Chapter 1\"\n    Input = ContentInput.Raw (RawInput.Stream page1Stream)\n    // Setting navigation to `Some` so that this document appears in the table of contents\n    Navigation = Some Linear\n}\n\nlet manifest = {\n    // Usually used by e-book readers as the book thumbnail\n    CoverImage = None\n    // Table of contents will be generated for us\n    NavXhtml = Autogenerated\n    TitlePage = titlePage\n    ContentFiles = [ chapter1 ]\n    CssFiles = [\n        // The file will be stored in the archive under this name\n        // It's also what you use to reference the stylesheet in XHTML\n        { FileName = \"main.css\"; Input = RawInput.Stream css }\n    ]\n}\n\nuse fs = File.OpenWrite \"odyssey.epub\"\nwrite fs metadata manifest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerams%2Fepubfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkerams%2Fepubfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerams%2Fepubfs/lists"}