aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconvert_microposts.sh12
-rwxr-xr-xconvert_microposts_standalone.sh11
-rw-r--r--filter-standalone.hs39
-rw-r--r--filter.hs41
-rwxr-xr-xmathjax-librejs.sh5
-rwxr-xr-xmd2org.sh9
6 files changed, 0 insertions, 117 deletions
diff --git a/convert_microposts.sh b/convert_microposts.sh
deleted file mode 100755
index 8df8a3f..0000000
--- a/convert_microposts.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-for md in $(ls ./microposts/*.md); do
- base=$(basename $md)
- fname="${base%%.*}"
-# pandoc -s -f markdown -t org -o ./microposts/${fname}.org ./microposts/${md}
- echo "pandoc -s -f markdown -t org --filter ./filter.hs --metadata filename=${fname} -o ./microposts/${fname}.org ${md}"
- pandoc -s -f markdown -t org --filter ./filter.hs --metadata filename=${fname} -o ./microposts/${fname}.org ${md}
-done
-
-rm ./microposts/microblog.org -f
-cat ./microposts/*.org > ./microposts/microblog.org
diff --git a/convert_microposts_standalone.sh b/convert_microposts_standalone.sh
deleted file mode 100755
index b78b733..0000000
--- a/convert_microposts_standalone.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-for md in $(ls ./microposts/*.md); do
- base=$(basename $md)
- fname="${base%%.*}"
-# pandoc -s -f markdown -t org -o ./microposts/${fname}.org ${md}
- echo "pandoc -s -f markdown -t org --filter ./filter.hs --metadata filename=${fname} -o ./microposts/${fname}.org ${md}"
- pandoc -s -f markdown -t org --filter ./filter-standalone.hs --metadata title=${fname} -o ./microposts/${fname}.org ${md}
-# sed -i "s/:END:/&\n/" ./microposts/${fname}.org # add a new line before the content
-done
-sed -i 's/^\(#+date:\s\+\)\(.\{10\}\)/\1<\2>/' ./microposts/*.org # fix the dates
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
diff --git a/filter.hs b/filter.hs
deleted file mode 100644
index 8db4980..0000000
--- a/filter.hs
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env runhaskell
--- filter.hs
-{--
-A filter to help convert a vimwiki file to an org file.
-It does the following:
-1. Remove metadata
-2. Add filename or empty as a level three heading
-3. Remove all other 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 {unMeta = Data.Map.Strict.empty}) ((Header 3 (makeCustomId $ getFilename meta) ((docDate meta) ++ [Str $ pack ": "] ++ (getFilenameInlines 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
diff --git a/mathjax-librejs.sh b/mathjax-librejs.sh
deleted file mode 100755
index 592a15d..0000000
--- a/mathjax-librejs.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-sed -i 's/^\s*\*\s*Copyright/ * @licstart The following is the entire license notice for the \n * JavaScript code in this page.\n *\n&/' $1
-
-sed -i 's/^\s*\*\// *\n * @licend The above is the entire license notice\n * for the JavaScript code in this page.\n&/' $1
diff --git a/md2org.sh b/md2org.sh
deleted file mode 100755
index ef01b6d..0000000
--- a/md2org.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-dir=$1
-for file in $(ls $dir); do
- base=$(basename $file)
- name="${base%%.*}"
- echo "pandoc -f markdown -t org -s -o $dir/$name.org $dir/$file"
- pandoc -f markdown -t org -s -o $dir/$name.org $dir/$file
-done