...
This commit is contained in:
parent
45cd051257
commit
166429a005
@ -4,11 +4,14 @@ import Text.Pandoc.JSON
|
||||
import qualified Data.Text.IO as TIO
|
||||
import qualified Data.Text as T
|
||||
|
||||
file2Block :: FilePath -> IO [Block]
|
||||
|
||||
|
||||
doInclude :: Block -> IO Block
|
||||
doInclude cb@(CodeBlock (id, classes, namevals) contents) =
|
||||
doInclude cb@(Div (id, classes, namevals) contents) =
|
||||
case lookup (T.pack "include") namevals of
|
||||
Just f -> CodeBlock (id, classes, namevals) <$>
|
||||
TIO.readFile (T.unpack f)
|
||||
Just f -> Div (id, classes, namevals) <$>
|
||||
file2Block (T.unpack f)
|
||||
Nothing -> return cb
|
||||
doInclude x = return x
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user