|Aerdan b8f63e26d4 README: More useful usage block.||7 months ago|
|contrib||7 months ago|
|unown||7 months ago|
|.gitignore||7 months ago|
|LICENSE.txt||7 months ago|
|README.md||7 months ago|
|setup.py||7 months ago|
|unown.py||7 months ago|
Unown is a script for generating an EPUB 3.0 Container from a set of files. It includes support for whitelists and blacklists.
The script outputs EPUBs based on the title specified in the config
file. For whitelist and blacklist generation, it incorporates the name
of the list. For example, a whitelist named 'story' for a book with the
title "An Example" would generate
An Example story.epub.
The following is a minimalistic configuration for Unown, with comments.
title="An Example" #subtitle="..." language="en-US" # Not actually used, but should be the copyright year. copyright=2018 creator="John Doe" contributors=[ "Jane Doe" ] # Where we should look for your files. directory="example" # This setting will cause Unown to generate a 'complete' package even # if whitelists or blacklists are specified. generate_all=true # The uuid is generated by Unown and should be left intact if present, # unless you're copying an old configuration, in which case it should # be removed. #uuid = "..." # Whitelists are presumed to consist only of viewable documents under # the OEBPS subdirectory of the directory configured above. Other # files (CSS, etc.) should be in the configured directory. # # Whitelist UUIDs are used in lieu of the primary UUID for whitelist- # based EPUB generation. #[whitelist] #story=[ 'foo.html', 'bar.html' ] #story_uuid = "..." # Blacklists exclude only files in the OEBPS subdirectory of the # directory configured above. Other files in the configured directory # are included regardless. #[blacklist] #choice=[ 'baz.html' ] #choice_uuid = "..."
Unown includes a set of Jinja2 templates in the
The following is a list of templates for Unown.
container.xml-- Not actually a template, but it's part of the EPUB 3.0 Container specification, and it points to the
nav.html-- Used to generate the table of contents for navigation.
package.xml-- Used to generate the EPUB 3.0 Package Document for the ebook. This file is specified in
There are two scripts included with Unown which may be of interest.
extract_4chan.py extracts all posts from a 4chan thread into the
specified target directory. The second takes a directory of such posts
and merges them in to a single file. It uses the id of the first post
in the thread to name the resulting file.
These scripts include their own Jinja2 templates, which are documented below:
post.html-- Used by
extract_4chan.pyto render individual posts.
thread.html-- Used by
merge_4chan.pyto render the whole thread.
thread_post.html-- Used by
merge_4chan.pyto render posts in the thread.
Additional scripts may be incorporated for other purposes.