From ff568eef10514a975ad1d4b2ddb0c7ee2d028790 Mon Sep 17 00:00:00 2001 From: Alex Raubach Date: Sun, 2 Sep 2018 11:07:59 -0400 Subject: [PATCH] Allow arbitrary sites to include a cover url --- examples/practical1.json | 3 ++- sites/arbitrary.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/practical1.json b/examples/practical1.json index 00e1d20..214dae0 100644 --- a/examples/practical1.json +++ b/examples/practical1.json @@ -4,5 +4,6 @@ "author": "erraticerrata", "chapter_selector": "#main .entry-content > ul:nth-of-type(1) > li > a", "content_selector": "#main .entry-content", - "filter_selector": ".sharedaddy, .wpcnt, style" + "filter_selector": ".sharedaddy, .wpcnt, style", + "cover_url": "https://gitlab.com/Mikescher2/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE_front.png" } diff --git a/sites/arbitrary.py b/sites/arbitrary.py index d2864f2..2cba937 100644 --- a/sites/arbitrary.py +++ b/sites/arbitrary.py @@ -18,7 +18,8 @@ Example JSON: "author": "erraticerrata", "chapter_selector": "#main .entry-content > ul > li > a", "content_selector": "#main .entry-content", - "filter_selector": ".sharedaddy, .wpcnt, style" + "filter_selector": ".sharedaddy, .wpcnt, style", + "cover_url": "https://gitlab.com/Mikescher2/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE_front.png" } """ @@ -33,6 +34,7 @@ class SiteDefinition: chapter_selector = attr.ib(default=False) # If this is present, it's used to filter out content that matches the selector filter_selector = attr.ib(default=False) + cover_url = attr.ib(default='') @register @@ -52,7 +54,8 @@ class Arbitrary(Site): story = Section( title=definition.title, author=definition.author, - url=url + url=url, + cover_url=definition.cover_url ) if definition.chapter_selector: