Open ousia opened 9 years ago
I hadn't heard of that. Nice idea. As far as I can see, it's not too different from EPUB. For reference: http://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf
I don't see myself getting to this in the near future, but someone else might want to take on the project, starting with a refactoring of the EPUB writer code to make it more modular, so we can re-use common bits.
looking forward to this
Hey, I intend to start work on this and I haven't contributed before. What documentation would be key for understanding the interface the writer will have to implement? What are the most important modules it will interact with? I'm going to model the AZW3 writer off of the EPUB writer, so some things will be obvious, but any advice would be appreciated as well.
The EPUB writer is somewhat special in that it basically calls the HTML writer and does some pre- and post-processing and then zips everything. If EPUB and AZW3 are very, very similar, it might even make sense to implement azw3 as an extension to the EPUB writer.
Personally, I would probably convert to epub and then use calibre of KindleGen to go to AZW3, instead of writing a pandoc writer, but maybe there are use-cases which I'm not considering...
I should also say that (as the author of the EPUB writer) I don't think the code quality is very good. (It should be broken down into smaller units, and types should be used more.) But as far as the interface goes, it should give you a good idea of what needs to come in and go out!
Note that everything happens in an instance of PandocMonad, which gives you functions for issuing warnings, fetching resources, and putting resources in a "media bag." Studying what the EPUB writer does should show you how this works, but of course we're happy to answer any questions.
As @mb21 says, if there are just a few changes from EPUB, we could consider adding an extension to EPUB (and maybe HTML) so we wouldn't actually need a completely new module.
Mauro Bieg notifications@github.com writes:
The EPUB writer is somewhat special in that it basically calls the HTML writer and does some pre- and post-processing and then zips everything. If EPUB and AZW3 are very, very similar, it might even make sense to implement azw3 as an extension to the EPUB writer.
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/jgm/pandoc/issues/1865#issuecomment-407881030
@jgm, I wonder whether a writer for the Kindle native format could be added to issue #1852.