aboutsummaryrefslogtreecommitdiff
path: root/filter-standalone.hs
diff options
context:
space:
mode:
Diffstat (limited to 'filter-standalone.hs')
-rw-r--r--filter-standalone.hs39
1 files changed, 0 insertions, 39 deletions
diff --git a/filter-standalone.hs b/filter-standalone.hs
deleted file mode 100644
index 8bd769d..0000000
--- a/filter-standalone.hs
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env runhaskell
--- filter.hs
-{--
-A filter to help convert a markdown file to an org file.
-It does the following:
-1. Remove all headings
---}
-import Text.Pandoc.JSON
-import Data.Text
-import Data.Map.Strict
-
-main :: IO ()
-main = toJSONFilter filter''
-
-filter'' :: Pandoc -> Pandoc
-filter'' (Pandoc meta blocks) =
- Pandoc meta (filter' <$> blocks)
-
-getFilename :: Meta -> Text
-getFilename meta =
- case lookupMeta (pack "filename") meta of
- Just (MetaString s) -> s
- _ -> pack ""
-
-makeInlines :: Text -> [Inline]
-makeInlines s = [Str s]
-
-getFilenameInlines :: Meta -> [Inline]
-getFilenameInlines = makeInlines . getFilename
-
-makeCustomId :: Text -> Attr
-makeCustomId s = (pack "", [], [(pack "CUSTOM_ID", s)])
-
-emptyAttr :: Attr
-emptyAttr = (pack "", [], [])
-
-filter' :: Block -> Block
-filter' (Header _ _ _) = Null
-filter' x = x