aboutsummaryrefslogtreecommitdiff
path: root/src/epub.rs
Commit message (Collapse)AuthorAgeFilesLines
* Add license details properlyA Farzat2026-03-101-0/+4
|
* Make maximum parallel downloads configurableA Farzat2026-03-101-4/+2
| | | | Still limit it to 8 as more is ineffective and could trigger O'Reilly.
* Add parallel downloadingA Farzat2026-03-101-15/+47
| | | | | This can be helpful when files are small in size, like the components of an EPUB.
* Stream downloads to files directlyA Farzat2026-03-101-10/+10
|
* Use a generic writer in write_container_xmlA Farzat2026-03-091-12/+9
| | | | This should allow for easier testing down the line.
* Add EPUB descriptions to OPF filesA Farzat2026-03-081-1/+3
|
* Use XDG directories to map downloadsA Farzat2026-03-081-0/+3
| | | | | | | | This provides standard locations for files regardless of the location of the binary and/or the working directory. Could allow some customization in the future, both as a permanent config or one-time case.
* Stream files to zip in chunksA Farzat2026-03-081-6/+5
| | | | Doing so reduces peak memory.
* Avoid using string buffers when modifying chaptersA Farzat2026-03-071-7/+6
| | | | | This saves on memory. Bytes are read from the file as needed, and written to zip as soon as they are ready.
* Replace format! macro with xml! where xml is usedA Farzat2026-03-071-14/+1
| | | | | This commit does not produce a working version, as processed_fragment is escaped by xml!. This needs to be resolved.
* Use xml! macro for cleaner xml handlingA Farzat2026-03-071-9/+9
|
* Fix chapter contents to proper xmlA Farzat2026-03-071-9/+24
| | | | | | | Change resource URLs using attribute matching (only img src for now, should add more later). Add respective stylesheets to chapters.
* Gather stylesheet file entries for each chapterA Farzat2026-03-061-1/+12
| | | | This prepares them to be added to their xhtml content.
* Deserialize URLs to Url type directlyA Farzat2026-03-051-13/+6
| | | | | This saves the effort of having to do it manually later on. Also avoids duplication in parsing.
* Initiate full_path as RelativePathBufA Farzat2026-03-051-12/+8
| | | | | | | This is better than having it as string then converting it to path whenever we want to use it. It also ensures better interoperability between operating systems (though it would probably worked fine beforehand, but better be safe for the future).
* Convert URLs pointing upstream to local relativeA Farzat2026-03-041-3/+33
| | | | EPUB standard only recognizes relative paths. Fixes image rendering.
* Generate the EPUB fileA Farzat2026-03-031-2/+21
|
* Add container.xml to zipA Farzat2026-03-031-14/+21
| | | | | Instead of writing it to file and then reading it again, we write container.xml straight to zip, just like we did with mimetype.
* Start with the create_epub_archive functionA Farzat2026-03-031-1/+15
| | | | | For now, only mimetype is added. Next step is adding all the other files in epub_root.
* Revert "Add a function to write mimetype"A Farzat2026-03-031-8/+0
| | | | | | | | This reverts commit 6aad662ec59a3974cbca6c423c1e08e8bc5e90f6. There is no need to write it out to epub_root as it needs to be manually written to the zip file later on anyway. Not including it saves us the trouble of avoiding it when walking epub_root later.
* Add a function to write container.xmlA Farzat2026-03-031-0/+26
|
* Add a function to write mimetypeA Farzat2026-03-031-0/+8
|
* Add file download logicA Farzat2026-03-031-0/+34
All files in file_entries are downloaded according to their full_path.