Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Last active August 29, 2015 14:01
Show Gist options
  • Save gdamjan/79f346db1a5b20f6e17f to your computer and use it in GitHub Desktop.
Save gdamjan/79f346db1a5b20f6e17f to your computer and use it in GitHub Desktop.
#! /usr/bin/env python3
from lxml import html, etree
from lxml.html import builder as E
...
Moved to https://github.com/gdamjan/polaris-to-html
@gdamjan
Copy link
Author

gdamjan commented May 19, 2014

TODO:

  • евентуално мета информации да се извлечат и форматираат да ги најде calibre (автор, наслов, слика)
  • chapter breaks
  • center chapter number

@gdamjan
Copy link
Author

gdamjan commented May 19, 2014

  • автор, наслов - средено
  • chapter breaks - може во калибре да се среди ако се одбере h2 и h3 да ги третира, може и тука да ги свичнам сите h2 во h1, а h3 во h2
  • center chapter number - css го средува ова, исто во calibre

останува cover image-от

@gdamjan
Copy link
Author

gdamjan commented May 19, 2014

плус TODO

  • автоматизирана конверзија html во azw3
  • серија и индекс во серијата на книги (на пр „Roboti-Carstvo-Zadužbina“) - series и series_index во meta tag-овите
  • meta/pubdate и meta/publisher

@gdamjan
Copy link
Author

gdamjan commented May 21, 2014

to run it on the whole collection:

 find polaris_sf_complete/html/* -type d -print0 | 
 xargs -0 --verbose -P3 -I{}  sh -c "cd {}; polaris-to-ebook.py --epub" &> out.log

kind of ugly with the sh -c "cd {}; ... but I'm lazy to implement chdir in the program itself.

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