pandoc-markdown-ghci-filter-0.1.0.0: Pandoc-filter to evaluate `code` section in markdown and auto-embed output.

Safe HaskellNone
LanguageHaskell2010

CodeBlockExecutor

Description

Module that communicates with GHCid, splits the commands in the code block, gather the results and emits the trasnformed JSON based Pandoc AST.

Synopsis

Documentation

applyFilterToBlock Source #

Arguments

:: Block

The Block yielded by toJSONFilter in Text.Pandoc.JSON

-> IO Block

The newly minted Block

Apply the filter block only if the language attribute is set to haskell and `code-filter` property is *not* set to Off

Example: ``` {.haskell code-filter=Off} ``` will turn off any kind of transformation.

By default the filer is On

runCodeBlock Source #

Arguments

:: Block

Block to execute. Only CodeBlock is executed.

-> IO Block

transformed code block

Run the commands in the Block in one single GHCid session.

processResults Source #

Arguments

:: [Text]

List of commands that were executed

-> [Text]

List of results for the executed commands

-> String

New string that will form the bodyof the modified Code Block.

Post-processing function that interleaves command and results