From e2cec0c7a7d56058773f3534c202e1b85f57baff Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Mon, 16 Oct 2023 19:08:27 +0200 Subject: reformat using new hindent (cuteness +63) --- Tags.hs | 55 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 25 deletions(-) (limited to 'Tags.hs') diff --git a/Tags.hs b/Tags.hs index 1a55453..c407dfd 100644 --- a/Tags.hs +++ b/Tags.hs @@ -44,8 +44,10 @@ sourceTagMetaFile fp = do case yml' of Left err -> error - ("Failed to load tag metadata from " ++ fp ++ ": " ++ - Y.prettyPrintParseException err) + ("Failed to load tag metadata from " + ++ fp + ++ ": " + ++ Y.prettyPrintParseException err) Right yml -> traverse_ go (KM.toList yml) where go :: (KM.Key, Y.Value) -> Site () go (k, v') = @@ -61,8 +63,10 @@ sourceTagMetaFile fp = do | v == ov = Just ov | otherwise = error - ("conflicting tag metadata for tag " ++ ks ++ " in " ++ - fp) + ("conflicting tag metadata for tag " + ++ ks + ++ " in " + ++ fp) ins Nothing = Just v in tagMeta %= M.alter ins kx @@ -87,10 +91,11 @@ sourceTags :: Site () sourceTags = do sgat <- map - (second $ map splitTag . - (^.. pageMeta . key "tags" . values . _String . to T.unpack)) . - M.assocs <$> - use pages + (second + $ map splitTag + . (^.. pageMeta . key "tags" . values . _String . to T.unpack)) + . M.assocs + <$> use pages ehtags .= M.fromList (invExpandTags sgat) htags .= M.fromList (invTags sgat) @@ -115,19 +120,19 @@ htagRenderMeta makeLink htag = do links <- map fromString <$> traverse makeLink htags names <- map fromString <$> traverse getTagGroupName htags metas <- traverse htagMeta htags - pure $ - Y.object - [ ("href", last links) - , ("name", last names) - , ("meta", last metas) - , ( "htag" - , Y.array $ - zipWith3 - (\l n m -> Y.object [("href", l), ("name", n), ("meta", m)]) - links - names - metas) - ] + pure + $ Y.object + [ ("href", last links) + , ("name", last names) + , ("meta", last metas) + , ( "htag" + , Y.array + $ zipWith3 + (\l n m -> Y.object [("href", l), ("name", n), ("meta", m)]) + links + names + metas) + ] data SortKey num = Negative num @@ -151,8 +156,8 @@ genericTaggedPagesRenderMeta :: -> M.Map [String] [FilePath] -> Site Y.Value genericTaggedPagesRenderMeta makePageMeta htag tagmap = - Y.array . map snd . sortOn (uncurry toSortKey) <$> - traverse metaPair (maybe [] id $ tagmap M.!? htag) + Y.array . map snd . sortOn (uncurry toSortKey) + <$> traverse metaPair (maybe [] id $ tagmap M.!? htag) where metaPair x = do m <- makePageMeta x @@ -190,6 +195,6 @@ htagRenderMetaWithSubtags makeLink extraMeta subtagMeta htag = do m <- subtagMeta x pure (joinPath x, m) subtagMetas <- - Y.array . filter (/= Y.Null) . map snd . sortOn (uncurry toSortKey) <$> - traverse metaPair subtags + Y.array . filter (/= Y.Null) . map snd . sortOn (uncurry toSortKey) + <$> traverse metaPair subtags pure $ meta `objMerge` Y.object [("subtags", subtagMetas)] `objMerge` em -- cgit v1.2.3