Support "lhs" as name for literate Haskell #4510
Comments
The behavior is exactly as documented in the manual, isn't it?
Nothing is said here about |
I think it's actually quite useful to have a way to do both of these things in a Markdown document:
|
Yeah, I guess you're right! It just bugs me, that it's not really correct markdown, or rather markdown which other parsers can easily handle. E.g. Commonmark will do this:
Which is not really what anyone wants, who writes this code... Other parsers completely mess it up: gettalong/kramdown#503 It would be cool if there was a more standard compliant way to differentiate between Haskell code which gets displayed and code which gets executed ... |
You could use a very simple lua filter to change code blocks
with class `lhs` to `literate haskell`, and use this when you're
converting using pandoc...
|
Well, for the time being I use this workaround to execute / compile the Haskell: cat document.md \
| sed 's/```haskell/```{.literate .haskell}/g' \
| pandoc \
--from markdown \
--to markdown+lhs \
--output temp.lhs \
| stack runhaskell \
--resolver lts-11.1 \
--package cmdargs \
-- \
temp.lhs \
; rm -f temp.lhs Not glamorous, but get's the job done =P. |
When converting markdown to markdown+lhs following 2 variants should yield the same output:
``` {.literate .haskell} main = putStr "Hello World!" ```
```lhs main = putStr "Hello World!" ```
should both yield
The text was updated successfully, but these errors were encountered: