aboutsummaryrefslogtreecommitdiff
path: root/src/epub.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use a generic writer in write_container_xmlA Farzat20 hours1-12/+9
| | | | This should allow for easier testing down the line.
* Add EPUB descriptions to OPF filesA Farzat34 hours1-1/+3
|
* Use XDG directories to map downloadsA Farzat38 hours1-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 Farzat45 hours1-6/+5
| | | | Doing so reduces peak memory.
* Avoid using string buffers when modifying chaptersA Farzat2 days1-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 Farzat3 days1-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 Farzat3 days1-9/+9
|
* Fix chapter contents to proper xmlA Farzat3 days1-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 Farzat4 days1-1/+12
| | | | This prepares them to be added to their xhtml content.
* Deserialize URLs to Url type directlyA Farzat4 days1-13/+6
| | | | | This saves the effort of having to do it manually later on. Also avoids duplication in parsing.
* Initiate full_path as RelativePathBufA Farzat5 days1-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 Farzat5 days1-3/+33
| | | | EPUB standard only recognizes relative paths. Fixes image rendering.
* Generate the EPUB fileA Farzat6 days1-2/+21
|
* Add container.xml to zipA Farzat6 days1-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 Farzat7 days1-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 Farzat7 days1-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 Farzat7 days1-0/+26
|
* Add a function to write mimetypeA Farzat7 days1-0/+8
|
* Add file download logicA Farzat7 days1-0/+34
All files in file_entries are downloaded according to their full_path.