Skip to content

Instantly share code, notes, and snippets.

@handyman5
Created November 26, 2017 23:14
Show Gist options
  • Save handyman5/6444c26fc0f39fd8abad31f07180ba0a to your computer and use it in GitHub Desktop.
Save handyman5/6444c26fc0f39fd8abad31f07180ba0a to your computer and use it in GitHub Desktop.

Recently, I wanted to create epubs of some reading material, specifically some Wordpress-hosted blogs. Rather than implementing a separate script for each blog I wanted an epub from, I wrote a tool to figure it all out for me: trivialpub.

Usage is simple: provide a YAML config file, such as:

https://gist.github.com/92ac1eeeb415da79bbbe2144df8af79d

And trivialpub will do the rest:

https://gist.github.com/0ecad63e83dd6a2c76234bd652e532e9

I've included a number of examples in the repo, but basically, you either need to feed it a list of URLs to transform or a Python expression which, when eval'ed in context, will generate a list of URLs. (Yes, yes, eval() is the devil, I know.)

PRs and suggestions welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment