如何使用pandoc将鸟式文字Haskell代码块放入markdown枚举中

时间:2017-02-02 17:41:29

标签: markdown pandoc literate-programming

正常降价代码块可以是列表的一部分:

 *  Item1
 *  Item 2

    ```haskell
    instance Alternative Facts where …
    ```

    more explanation

        instance Alternative Syntax where …

    even more explanation

但是如果我使用pandoc’s markdown+lhs mode,并且我希望代码块在缩进列表中呈现,那么这似乎不起作用:

 *  Item 3

    Still indented

    > Not picked up by GHC as literate haskell

    More text

> Picked up by GHC, but not indented by pandoc

    Even more text of the item, but rendered as a code-block by pandoc.

我如何标记它以便GHC看到鸟式代码块,但是适当地缩进它并且之后继续该项目?

(在这种情况下,使用\begin{code}…\end{code}不是一个选项。)

1 个答案:

答案 0 :(得分:0)

  

我如何标记它以便GHC看到鸟式代码块,但是适当地缩进它并且之后继续该项目?

请注意,confirmed by pandoc’s authornow noted in the documentation