From 87c3fa5b75fb055e0d7d7175adf3598c98ef3e7b Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Sat, 25 Jul 2020 01:17:47 +0200 Subject: [PATCH] rename description to desc --- make-pages/Depend.hs | 6 +++--- make-pages/IndexPage.hs | 4 ++-- make-pages/Info.hs | 36 ++++++++++++++++++------------------ make-pages/Main.hs | 4 ++-- make-pages/Options.hs | 14 +++++++------- make-pages/RSS.hs | 8 ++++---- make-pages/SinglePage.hs | 4 ++-- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/make-pages/Depend.hs b/make-pages/Depend.hs index a607c76..0a6b429 100644 --- a/make-pages/Depend.hs +++ b/make-pages/Depend.hs @@ -44,7 +44,7 @@ dependGallery ginfo infos build data_ tmp = dependGallery' :: GalleryInfo -> [(FilePath, Info)] -> FilePath -> FilePath -> FilePath -> Builder -dependGallery' (GalleryInfo {title, description, prefix, filters}) +dependGallery' (GalleryInfo {title, desc, prefix, filters}) infos' build data_ tmp = let infos = filter (matchFilters filters . #second) infos' files = map #first infos @@ -66,7 +66,7 @@ dependGallery' (GalleryInfo {title, description, prefix, filters}) $$(call gallery,$title',$@prefix,$flags) $@rss: $@files' $$(MAKEPAGES) - $$(call rss,$title',$description',$@prefix,$@data_) + $$(call rss,$title',$desc',$@prefix,$@data_) $rules @@ -75,7 +75,7 @@ dependGallery' (GalleryInfo {title, description, prefix, filters}) where flags = filtersToFlags filters title' = substComma title - description' = substComma description + desc' = substComma desc substComma = textMap \case ',' -> "$(comma)"; c -> fromChar c makeRules :: FilePath -- ^ prefix diff --git a/make-pages/IndexPage.hs b/make-pages/IndexPage.hs index e37dcf7..a939336 100644 --- a/make-pages/IndexPage.hs +++ b/make-pages/IndexPage.hs @@ -51,8 +51,8 @@ make' (IndexInfo {title, galleries, links, footer}) = [b|@0 |] makeItem :: GalleryInfo -> Builder -makeItem (GalleryInfo {title, description, prefix, filters}) = [b|@4 - $*title +makeItem (GalleryInfo {title, desc, prefix, filters}) = [b|@4 + $*title |] where nsfw = if hasNsfw filters then " class=nsfw" else "" diff --git a/make-pages/Info.hs b/make-pages/Info.hs index 50fe344..483041f 100644 --- a/make-pages/Info.hs +++ b/make-pages/Info.hs @@ -27,16 +27,16 @@ import Text.Read (readMaybe) data Info = Info { - date :: !Day, - title :: !Text, - artist :: !(Maybe Artist), -- nothing = me, obv - tags :: ![Text], - nsfwTags :: ![Text], - description :: !(Maybe Text), - nsfwDescription :: !(Maybe Text), - images :: ![Image], - thumb' :: !(Maybe FilePath), - links :: ![Link] + date :: !Day, + title :: !Text, + artist :: !(Maybe Artist), -- nothing = me, obv + tags :: ![Text], + nsfwTags :: ![Text], + desc :: !(Maybe Text), + nsfwDesc :: !(Maybe Text), + images :: ![Image], + thumb' :: !(Maybe FilePath), + links :: ![Link] } deriving (Eq, Show) @@ -100,8 +100,8 @@ instance FromYAML Info where <*> m .:? "artist" <*> m .:? "tags" .!= [] <*> m .:? "nsfw-tags" .!= [] - <*> m .:? "description" - <*> m .:? "nsfw-description" + <*> m .:? "desc" + <*> m .:? "nsfw-desc" <*> (m .: "images" >>= imageList) <*> m .:? "thumb" <*> m .:? "links" .!= [] @@ -150,16 +150,16 @@ instance FromYAML Link where data GalleryInfo = GalleryInfo { - title :: !Text, - description :: !Text, - prefix :: !FilePath, - filters :: !GalleryFilters + title :: !Text, + desc :: !Text, + prefix :: !FilePath, + filters :: !GalleryFilters } deriving (Eq, Show) data GalleryFilters = GalleryFilters { - nsfw :: !NsfwFilter, + nsfw :: !NsfwFilter, artist :: !ArtistFilter, require, exclude :: ![Text] } @@ -211,7 +211,7 @@ matchFilters (GalleryFilters {nsfw, artist, require, exclude}) i = instance FromYAML GalleryInfo where parseYAML = YAML.withMap "gallery info" \m -> GalleryInfo <$> m .: "title" - <*> m .: "description" + <*> m .: "desc" <*> m .: "prefix" <*> m .:? "filters" .!= noFilters diff --git a/make-pages/Main.hs b/make-pages/Main.hs index bac61f4..841fe4b 100644 --- a/make-pages/Main.hs +++ b/make-pages/Main.hs @@ -63,11 +63,11 @@ main2 (IndexPage {file, output}) = do let page = IndexPage.make info writeOutput output page -main2 (RSS {files, title, description, root, prefix, output, dataDir}) = do +main2 (RSS {files, title, desc, root, prefix, output, dataDir}) = do infos <- mapM (infoYAML dataDir) files printV $ "infos" := infos let output' = takeFileName <$> output - let rss = RSS.make root title description prefix output' infos + let rss = RSS.make root title desc prefix output' infos writeOutput output rss main2 (DependSingle {file, nsfw, output, prefix, buildDir, dataDir}) = do diff --git a/make-pages/Options.hs b/make-pages/Options.hs index 28bdbd7..0398130 100644 --- a/make-pages/Options.hs +++ b/make-pages/Options.hs @@ -30,13 +30,13 @@ data ModeOptions = output :: Maybe FilePath } | RSS { - files :: [FilePath], - title :: Text, - description :: Text, - root :: Text, - prefix :: FilePath, - output :: Maybe FilePath, - dataDir :: FilePath + files :: [FilePath], + title :: Text, + desc :: Text, + root :: Text, + prefix :: FilePath, + output :: Maybe FilePath, + dataDir :: FilePath } | DependSingle { file :: FilePath, diff --git a/make-pages/RSS.hs b/make-pages/RSS.hs index 3d0eb85..a3219aa 100644 --- a/make-pages/RSS.hs +++ b/make-pages/RSS.hs @@ -48,20 +48,20 @@ make' root title desc prefix output infos = [b|@0 |] makeItem :: Strict.Text -> FilePath -> FilePath -> Info -> Builder -makeItem root prefix path (Info {title, description, date}) = [b|@4 +makeItem root prefix path (Info {title, desc, date}) = [b|@4 $*title $link $link - $description' + $desc' $date' |] where dir = takeDirectory path link = [b|$*root/$@prefix/$@dir|] - description' = - case description of + desc' = + case desc of Nothing -> "" Just d -> [b|@6 diff --git a/make-pages/SinglePage.hs b/make-pages/SinglePage.hs index 3ecd3e5..6065e05 100644 --- a/make-pages/SinglePage.hs +++ b/make-pages/SinglePage.hs @@ -31,7 +31,7 @@ make nsfw dir = toLazyText . make' nsfw dir make' :: Bool -> FilePath -> Info -> Builder make' nsfw dir (Info {date, title, artist, tags, nsfwTags, - description, nsfwDescription, images, links}) = [b|@0 + desc, nsfwDesc, images, links}) = [b|@0 @@ -84,7 +84,7 @@ make' nsfw dir (Info {date, title, artist, tags, nsfwTags, download0 = fromMaybe path0 (#download image0) path0' = pageFile path0 - descSection = makeDesc nsfw description nsfwDescription + descSection = makeDesc nsfw desc nsfwDesc tagsList = makeTags nsfw tags nsfwTags linksList = extLinks nsfw links