epubcheck | The conformance checker for EPUB publications | Media library
kandi X-RAY | epubcheck Summary
kandi X-RAY | epubcheck Summary
The conformance checker for EPUB publications
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Report a start tag
- Find a prefix for a namespace URI
- Marks a start element
- Finds a prefix for a given QName
- Generate the report
- Returns the name of the given path
- Generate property element
- Start tag
- Add a prefix mapping
- Searches the contents of the given entry for the given entry
- Build the search dictionary
- Validates the manifest
- Initialize the system
- Marks a given declaration
- Validates the package
- Loads overridden messages
- Builds CSS search dictionaries
- Set the selectors
- Searches the ZIP file for the entry for the entry
- Marks a Css Declaration
- Retrieve the opf version from an input stream
- Marks the beginning of an XML element
- Validates that the xml file is valid
- Add a script element
- Validates the ZIP file
- Information about this feature
epubcheck Key Features
epubcheck Examples and Code Snippets
Community Discussions
Trending Discussions on epubcheck
QUESTION
I am trying to create a Kindle dictionary that can be used for offline lookup. I already have the words and their inflections, but turning this into a working dictionary is difficult.
There is some documentation about this provided by Amazon. It basically says that you should:
- Create an XHTML file with their special markup specifying all inflections etc.
- Turn it into an epub
- Open it with Kindle Previewer
- Export it with Kindle Previewer to MOBI
So I created a large XHTML file (23 MB or so) according to the Amazon specifications and opened it in Kindle Previewer, and it looked fine. However, Kindle Previewer does not let you export XHTML files to MOBI. They want you to create an intermediate epub file.
I tried using Pandoc to do the conversion, which did not work because it stripped out all the specific HTML tags and only left in paragraphs. Then I tried using calibre. The normal XHTML -> epub conversion failed because the XHTML file was too large, according to an error message. Calibre suggests to turn on the "heuristic mode" if you run into this error, which I tried, but which did not finish running after hours of runtime.
Then I attempted to create the epub file myself, using a sample file taken from this tutorial. I discovered that this is not trivial, and a check using epubcheck revealed many hard-to-understand errors in my generated file. The generation of the epub file is also a bit complicated by the fact that you probably need to split the XHTML files into many smaller files, which should maybe be 250 kb in size, because e-readers tend to struggle with parsing larger files.
So I thought there should maybe be an easier way to do this, or maybe a library that helps doing this. Maybe it would even be a good idea to output the words + inflections into some other easier dictionary format and then convert it to a MOBI using an existing library and leaving out the XHTML generation completely. Currently I am using Python, but I'd also use other languages if it is necessary. What could I try?
Edit: To add to the things I have tried: there is an apparently closed source script here that unfortunately doesn't support inflections, so does not work. And there are instructions here that advise converting the file to PRC using Mobipocket Creator and then opening it with Kindle Previewer. The problem with this approach is that Kindle Previewer throws the error:
Kindle Previewer does not support this file, which has either been created using an older version of KindleGen or a third party application. We recommend using EPUB or DOCX format directly for previewing and publishing your book on Kindle.
There are also more detailed instructions for Mobipocket Creator here, which tell you to directly move the generated .prc file onto the kindle. I tried that but it is not being recognized as a dictionary.
...ANSWER
Answered 2021-Nov-22 at 18:21I figured it out by myself. First I implemented a solution myself, then I found the pyglossary library (right now the code below only works with the version from Github and not from pip) and used it like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install epubcheck
You can use epubcheck like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the epubcheck component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page