diff options
author | Yuchen Pei <me@ypei.me> | 2021-07-01 12:35:30 +1000 |
---|---|---|
committer | Yuchen Pei <me@ypei.me> | 2021-07-01 12:35:30 +1000 |
commit | 661762ba8fd5fd685bfbe99473d7286efa85b381 (patch) | |
tree | cfad97238a7e8ce897c6e1d5f689b98fd284a4a8 /filter-standalone.hs | |
parent | 6c8e5849392cc2541bbdb84d43ce4be2d7fe4319 (diff) |
removed temporary scripts for the migration.
Diffstat (limited to 'filter-standalone.hs')
-rw-r--r-- | filter-standalone.hs | 39 |
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 |