-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate Epub #19
Comments
Some ideas:
|
Working on this now (using a go script for now run from command line). My strategy thus far has been to let Hugo do most of the work:
This works ok to create an HTML dump of each directory in docs and circumvents the shortcodes problem (the site has already been rendered, so the shortcodes will be as well). Need to refine and automate it further - css doesn't get to the right place on its own, I haven't done the pandoc stuff yet, and my cssClass injection magic isn't working yet. Also it has those anchors for each header and it probably shouldn't. But all in all this seems workable. |
Followup: The above works great for creating an HTML dump (which can then be Pandoc'd into a standalone HTML page) but that HTML doesn't transfer to ePub worth anything. So I'm going to keep that for HTML export but I've also created a markdown compiler using the same general steps (scrape TOC, use the TOC indexing to pick up markdown files in order, clean and dump into a single markdown document). Cleanup of Hugo headmatter tags is working, I have a kludge for shortcodes that works (since I only used columns, it just gets rid of columns and displays things sequentially) that I'm going to clean up further. I've also got a general workflow for ePub/HTML creation via pandoc that works ok. Also the CSS from Platen/Hugo doesn't apply to the ePub doc for reasons of ePub being very particular about formatting, so we're going to have to find a way to export that. Right now I just wrote a very basic version of the CSS but it's not quite as good looking. |
I wonder how much CSS we need to concern ourselves with for the ePub since so much of it can/will be overridden by the reader/app. This is sounding promising as hell. |
I'm not terribly concerned, it's just that a) it's an extra step and b) some readers do dumb things with tables (like Calibre just ignores any sort of separation lines and they look like shit). Side note, I tried the resulting ePub on my phone and iBooks doesn't like linebreaks inside tables (it throws an error at that part) so further iteration is required as to what's ok vs. not. |
Answer: linebreaks need the trailing slash: Some CSS transference to epub (right now I just have some very basic "make the tables have lines/alternating backgrounds" level stuff, not gonna bother doing like font-embedding, but a CSS file is there in case a user might want to add more) and a more rigorous shortcode eraser are implemented on bsg-site. Prior to VSCode extensions (I have no idea how to go about doing that) and any better shortcode handling that should cover the features for the most part. I'll document/clean up everything and make a proper PR for it after 36W is released. |
As a writer, it would be useful to generate a single epub file for a game text hosted in a platen site.
The text was updated successfully, but these errors were encountered: