go-shiori / go-epub Goto Github PK
View Code? Open in Web Editor NEWThis project forked from bmaupin/go-epub
Go library for creating EPUB files
License: MIT License
This project forked from bmaupin/go-epub
Go library for creating EPUB files
License: MIT License
When calling epub.EmbedImages()
the added images are automatically named from the library. The problem is that the images are not cleaned when they come from URLs.
For example, a image of name: image.jpg?width=300
will try to create the same filename in the system, and some do not support symbols like that.
An example of this can be seen at: https://github.com/go-shiori/shiori/actions/runs/7819243851/job/21331283455?pr=837#step:5:369
The offending line: https://github.com/go-shiori/go-epub/blob/main/epub.go#L629-L630
Another possibility is to always create random filenames when calling EmbedImages()
, since it's automatic nobody should care.
A subsection should belong to its section in toc.ncx, for proper show in reader.
Currently subsection is the same as section in toc.ncx
currently AddCSS
just add file and that to manifest but not add that on document too, maybe it is not bad if we have option for that.
this make files not pass epubcheck
Currently the library can only use system files, but I would like to be able to use vfs too
if user try to add different or one file with same filename go-epub
not add the second one.
e.AddImage("path/to/file1.jpg", "filename.jpg")
e.AddImage(t"path/to/file2.jpg", "filename.jpg")
add second file with a new name and show a warning to the user
as an example this code use custom name SubSectionName
it generate SubSectionName
file without extension(xhtml) that can create error in some of ebook reader.
to avoid that go-epub
should add extension automatically or return error.
I see how in the future we could allow creating a new Epub instance providing a custom logger from log/slog
, but we can plan that later on.
Originally posted by @fmartingr in #5 (review)
Processing of chapters into subchapters does not work correctly in the AddSubSection function, I get an error like ParentDoesNotExistError, I cannot correctly process more complex nesting.
It would be nice if it was possible for user of the API to provide translations for English strings that are currently hardcoded. There is at least Table of contents
. Maybe more.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.