I am using the haskell pandoc include filter
-- includes.hs
import Text.Pandoc.JSON
doInclude :: Block -> IO Block
doInclude cb@(CodeBlock (id, classes, namevals) contents) =
case lookup "include" namevals of
Just f -> return . (CodeBlock (id, classes, namevals)) =<< readFile f
Nothing -> return cb
doInclude x = return x
main :: IO ()
main = toJSONFilter doInclude
with the following code snippet in markdown
~~~~ {include="tasks/mdbook.js"}
~~~~
This actually includes the file at markdown, but I would like it to also include code formatting, for example
```js
file content here
```
How can I update the above haskell code to do this? with something like
~~~~ {code="tasks/mdbook.js", format="js"}
~~~~
source
share