From 1cdedbb50ed5ff9aea4a5ecf78e512dc52cc03af Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 13 May 2023 20:48:37 +0100 Subject: Add a command line interface --- src/Zettel/Transclusion.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Zettel/Transclusion.hs') diff --git a/src/Zettel/Transclusion.hs b/src/Zettel/Transclusion.hs index 617a475..63e1271 100644 --- a/src/Zettel/Transclusion.hs +++ b/src/Zettel/Transclusion.hs @@ -9,6 +9,10 @@ import Text.Pandoc.Walk (walk, query) import Zettel.Common import Zettel.Types +between :: Char -> Char -> Text -> Text +between c1 c2 t = + T.drop 1 . T.takeWhile (c2 /=) $ T.dropWhile (c1 /=) t + attrValue :: Text -> Text -> Maybe Text attrValue t v = viaNonEmpty head . drop 1 . dropWhile (/= v) $ T.words t -- cgit