nifey / epub2sphinx Goto Github PK
View Code? Open in Web Editor NEWepub2sphinx is a tool to convert epub files to ReST for Sphinx
Home Page: https://pypi.org/project/epub2sphinx/
License: MIT License
epub2sphinx is a tool to convert epub files to ReST for Sphinx
Home Page: https://pypi.org/project/epub2sphinx/
License: MIT License
Fonts are not getting copied. We also need to avoid copying any other files that we don't need like the ncx file and creating empty folders.
We can change --include-custom-css to --include-custom-style to copy both CSS stylesheets and font files together i.e. either copy both stylesheets and fonts or none of them.
We should find a way to update the progress bar after each stage of conversion.
In the generate rst stage, we can update after every file is converted to ReST.
We add genindex to the index.rst but the HTML page is empty.
We can find out why that is happening and fix it or remove genindex since most sphinx themes have a table of contents.
Any help would be great, as I am a writer who likes to host my own ebooks and Vellum (vellum.pub) generates very
nice epub files and would be an easy way to make static html files. Thanks.
I'm on a Mac in the terminal and after doing the following and restarting:
... but I get this error everytime:
...............................
iMac ~ % epub2sphinx --version
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/epub2sphinx", line 33, in
sys.exit(load_entry_point('epub2sphinx==0.0.3', 'console_scripts', 'epub2sphinx')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/epub2sphinx", line 25, in importlib_load_entry_point
return next(matches).load()
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/metadata/init.py", line 202, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/epub2sphinx-0.0.3-py3.11.egg/cli.py", line 1, in
import click
ModuleNotFoundError: No module named 'click'
...............................
iMac info:
Intel, Ventura 13.2.1
iMac ~ % brew -v
Homebrew 4.0.10
iMac ~ % python3 --version
Python 3.11.1
... other python github projects are working just fine, so what am I missing, thoughts?
Right now, the tool is bottlenecked especially by the generate rst stage.
Some possible approaches to improve speed of conversion:
Right now, if the port 8000 is already being used, the tool prints a stack trace.
We can instead catch that exception and try a different port number instead or just print that the port is unavailable.
We can also add an optional argument for the user to specify a port to serve on if --serve is used.
As of now, the tool aborts with an error message if the output directory already exists.
Instead of aborting we can ask the user if it is okay to overwrite the directory and then delete the directory if the user says yes.
We can also add a --overwrite flag for the user to explicitly tell that overwriting the output directory is okay.
Right now we have hardcoded some HTML transformation like removing epub:type, converting image tag to img tag, etc.
Different epub creators have different structure, like title page, TOC, about page, etc.
It would be nice to have some hooks similar to plugins of Ebooklib to allow doing some extra modifications specific to an epub creator. Eg: Books from project gutenberg have a notice at the beginning and end. This hook can allow moving the notice to a different chapter.
Instead of implementing our own templating using regex, we can use an existing templating library like jinja.
Thanks for the great work.
Testing with this book.
https://freetamilebooks.com/ebooks/namma_ooru_kovai/
epub2sphinx -o out_dir -t alabaster namma_ooru_kovai.epub -b -s
There are too many "Front Page" test as links on index pages and side bar.
we should get only the chapter titles as the main links.
Please explore on this.
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.