aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add release build to GitHub workflowA Farzat13 hours1-0/+32
|
* Add GitHub workflow job for testsA Farzat14 hours1-0/+23
| | | | | Though we do not have any tests yet, this will make sure they are checked once they are there.
* Fix formattingA Farzat14 hours1-1/+3
| | | | | For future reference, the User-Agent was obtained from https://hasdata.com/blog/user-agents-for-web-scraping
* Add simple GitHub workflow job checking fmt & lintA Farzat14 hours1-0/+33
|
* Avoid useless jar clone and update User-AgentA Farzat17 hours1-2/+2
|
* Use a generic writer in write_container_xmlA Farzat17 hours1-12/+9
| | | | This should allow for easier testing down the line.
* Remove unused models, fields, and endpointsA Farzat25 hours2-48/+6
| | | | | | If they are ever needed again, they can be added back. Also set API endpoints fields to Url type instead of String.
* Allow cookies.json in config dirA Farzat25 hours2-9/+30
| | | | | This allows running the program from anywhere, given the cookies are placed in the config dir.
* Update the TODO listA Farzat30 hours1-3/+3
|
* Add EPUB descriptions to OPF filesA Farzat30 hours2-1/+11
|
* Create a function to modify OPF contentsA Farzat30 hours1-1/+45
| | | | The main purpose for now is to add the description.
* Use XDG directories to map downloadsA Farzat35 hours4-7/+70
| | | | | | | | 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.
* Add newline between wrapper and chapter contentA Farzat35 hours1-0/+2
| | | | | This makes it easier to identify diff lines caused by quick_xml from those of the wrapper.
* Allow skipping downloadsA Farzat38 hours1-4/+6
| | | | This streamlines testing.
* Hide unnecessary output in diff-epubs.shA Farzat38 hours1-2/+2
|
* Register roadmap progress in READMEA Farzat42 hours1-8/+4
|
* Stream files to zip in chunksA Farzat42 hours1-6/+5
| | | | Doing so reduces peak memory.
* Avoid using string buffers when modifying chaptersA Farzat2 days2-34/+41
| | | | | This saves on memory. Bytes are read from the file as needed, and written to zip as soon as they are ready.
* Fix attributes of more element types with linksA Farzat2 days1-3/+16
|
* Prevent processed_fragment from escapingA Farzat2 days1-4/+5
| | | | | | This is done by not including it in the xml! macro in the first place. Instead, it is inserted later by using format!. This is because ogrim does not support injecting raw xml yet (to my knowledge).
* Replace format! macro with xml! where xml is usedA Farzat2 days2-32/+38
| | | | | This commit does not produce a working version, as processed_fragment is escaped by xml!. This needs to be resolved.
* Add a util to diff epubsA Farzat3 days1-0/+13
| | | | This helps in debugging the effects of code changes.
* Use xml! macro for cleaner xml handlingA Farzat3 days3-10/+41
|
* Fix chapter contents to proper xmlA Farzat3 days6-10/+176
| | | | | | | Change resource URLs using attribute matching (only img src for now, should add more later). Add respective stylesheets to chapters.
* Add LICENSE fileA Farzat3 days2-1/+675
|
* Gather stylesheet file entries for each chapterA Farzat4 days2-2/+13
| | | | This prepares them to be added to their xhtml content.
* Add stylesheets to Chapter modelA Farzat4 days1-0/+7
| | | | | This allows these stylesheets to be added to the chapter contents later during zipping.
* Deserialize URLs to Url type directlyA Farzat4 days4-14/+11
| | | | | This saves the effort of having to do it manually later on. Also avoids duplication in parsing.
* Add READMEA Farzat4 days1-0/+113
|
* Initiate full_path as RelativePathBufA Farzat4 days3-14/+11
| | | | | | | 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 days4-4/+48
| | | | EPUB standard only recognizes relative paths. Fixes image rendering.
* Remove the sanity checksA Farzat6 days1-21/+1
| | | | They are no longer needed.
* Generate the EPUB fileA Farzat6 days2-3/+25
|
* Add container.xml to zipA Farzat6 days2-22/+22
| | | | | 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 Farzat6 days3-1/+96
| | | | | 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 Farzat6 days2-10/+1
| | | | | | | | 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 Farzat6 days2-1/+28
|
* Add a function to write mimetypeA Farzat6 days2-1/+10
|
* Add file download logicA Farzat6 days2-2/+43
| | | | All files in file_entries are downloaded according to their full_path.
* Add OPF file detectionA Farzat7 days1-0/+6
| | | | We need to know its full_path as it will be referenced in container.xml.
* Remove the search endpointA Farzat7 days2-25/+3
| | | | | | | | | | | It is not the best idea as it is non-deterministic, working on the assumption that searching by ISBN would return the book and in a consistent way. The contents previously extracted from it, such as authors and publishers, are already included in the OPF file which can be fetched from the files list. Further items such as description can be fetched from the metadata endpoint later if needed.
* Convert chapters and file_entries to HashMapsA Farzat7 days1-1/+22
| | | | | | | This makes them more useful as each will be referenced by either spine_items or toc_vec later on. This is demonstrated by the temporary sanity checks, which shall be replaced by code that actually use fields from the corresponding items.
* Add fetching of the spine and table of contentsA Farzat7 days2-3/+42
|
* Refactor away SearchResponse modelA Farzat7 days2-33/+15
| | | | | | | | | | Its functionality is covered by Paginated. The fetch_metadata function was also replaced by the more generic fetch_all_pages. Given that we are searching by the isbn, we should presumably get only 1 result, so only one call will be made even when fetch_all_pages is used. This behaviour is not documented though, so switching to the metadata endpoint in the future is recommended.
* Add file and chapter details fetchingA Farzat7 days2-1/+60
| | | | | | | | | | Fetching file details allows us to download them to the correct location later. Chapter details are currently limited to is_skippable, which might be used to determine whether to make the corresponding spine item non-linear. Other details such as the title shall be fetched from the spine and table-of-contents endpoints later.
* Add e-book metadata fetchingA Farzat7 days4-10/+75
|
* Add authentication using cookiesA Farzat8 days5-7/+2012
|
* Init commit: setup project and cli parsingA Farzat8 days4-0/+222