Generate a "newsrack" of periodicals for your ereader.
Uses calibre, GitHub Actions and hosted on GitHub Pages.
Enable Pages in your forked repository settings to deploy from GitHub Actions. If you wish to, from a different
branch, customise _recipes_custom.py and add your own recipes to the recipes_custom/ folder. Remember to set the
new branch as default so that GitHub Actions will build/deploy from the correct branch.
- The formats generated (
src_ext,target_ext) - When periodical recipes are enabled (
enable_on) - Remove/add recipes
- cron schedule and job timeout interval in .github/workflows/build.yml
Example fork repo / Example customisations
# Defined in _recipes.py
Recipe(
recipe="example", # actual recipe name
slug="example", # file name slug
src_ext="mobi", # recipe output format
category="news", # category
name="An Example Publication",
# display name, taken from recipe source by default. Must be defined for built-in recipes.
target_ext=[], # alt formats that src_ext will be converted to
timeout=300, # max interval (seconds) for executing the recipe, default 180 seconds
overwrite_cover=False, # generate a plain cover to overwrite Calibre's
enable_on=True, # determines when to run the recipe
retry_attempts=1, # retry attempts on TimeoutExpired, ReadTimeout
cover_options=CoverOptions(), # cover options
),Run a built-in Calibre periodical recipe:
Recipe(
recipe="Associated Press",
name="Associated Press", # Required for built-in recipes
slug="ap",
src_ext="mobi",
category="news",
),Only generate epubs:
Recipe(
recipe="example", # example.recipe.py
slug="example",
src_ext="epub", # generate epub
target_ext=[], # don't generate alt formats
category="example",
),Use enable_on to conditionally enable a recipe:
# instead of using the available functions, you can define your own custom functions for enable_on
from _recipe_utils import Recipe, onlyon_days, onlyat_hours, onlyon_weekdays
Recipe(
recipe="example1",
slug="example1",
src_ext="epub",
category="example",
enable_on=onlyon_weekdays([0]), # only on Mondays
),
Recipe(
recipe="example2",
slug="example2",
src_ext="epub",
category="example",
enable_on=onlyon_days([1, 14]), # only on days 1, 14 of each month
),
Recipe(
recipe="example3",
slug="example3",
src_ext="epub",
category="example",
enable_on=onlyat_hours(list(range(6, 12)), -5), # from 6am-11.59am daily, for the timezone UTC-5
),Use calibre-generated cover:
Recipe(
recipe="example",
slug="example",
src_ext="epub",
category="example",
overwrite_cover=False,
),Customise the generated cover:
from _recipe_utils import CoverOptions
Recipe(
recipe="example",
slug="example",
src_ext="epub",
category="example",
cover_options=CoverOptions(
text_colour="white",
background_colour="black",
title_font_path="path/to/example.ttf",
datestamp_font_path="path/to/example.ttf"
),
),In addition to built-in Calibre recipes, customised
recipes (recipes/*.recipe.py) are included in this repository.
Recipes customised here have a modified publication_date which is set to the latest article date. This allows the
outputs to be sorted by recency. The recipe title is also modified to include the latest article date or issue date/number.
In alphabetical order: