title: pandoc Include files filter in haskell
body: <p>I am using this haskell pandoc include files filter </p>
  
  <pre><code>#!/usr/bin/env runhaskell
  -- includes.hs
  import Text.Pandoc.JSON
  
  doInclude :: Block -&gt; IO Block
  doInclude cb@(CodeBlock (id, classes, namevals) contents) =
    case lookup "include" namevals of
         Just f     -&gt; return . (CodeBlock (id, classes, namevals)) =&lt;&lt; readFile f
         Nothing    -&gt; return cb
  doInclude x = return x
  
  main :: IO ()
  main = toJSONFilter doInclude
  </code></pre>
  
  <p>with the following code snippet in markdown</p>
  
  <pre><code>~~~~ {include="tasks/mdbook.js"}
  ~~~~
  </code></pre>
  
  <p>This does in fact include the file into the markdown however I would like it to also include the code formatting for example</p>
  
  <pre><code>```js
  file content here
  ```
  </code></pre>
  
  <p>How can I update the above haskell code to acomplish this? with something like</p>
  
  <pre><code>~~~~ {code="tasks/mdbook.js", format="js"}
  ~~~~
  </code></pre>