Awkee / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

xxx+lhs output format doesn't distinguish where Haskell input came from #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using Pandoc on a Literate Haskell file with Markdown like:

> module Foo where

This is a literate haskell module!

~~~~ { .haskell }
import Prelude hiding (putStrLn)
putStrLn = undefined

main = do putStrLn "Hello World" putStrLn "Hi" -- here's a comment x <- readFile "yowza.txt" putStrLn x

Fin.

... And then running

pandoc -f markdown+lhs -t html+lhs Foo.lhs -o Foo.html

results in an HTML that looks approximately like (in a browser):

module Foo where

This is a literate haskell module!

import Prelude hiding (putStrLn) putStrLn = undefined

main = do putStrLn "Hello World" putStrLn "Hi" -- here's a comment x <- readFile "yowza.txt" putStrLn x

Fin.

The code examples in the lhs become indistinguishable from the actual source code. This is perhaps the intended behavior, but what I expected was to be able to cut and paste from the (browser-rendered) HTML into an editor, compile it, and get back the original program (in terms of behavior). It seems desirable (to me at least!) to keep the examples separate from the actual source, both so the reader can see the difference and so the reader could actually cut and paste the text and run the software. The markdown reader provides enough info already to do this, it looks like (it adds the 'sourceCode' class to the attributes of the actual code blocks, whereas the example blocks just get the specified 'haskell' class).


Original issue reported on code.google.com by `robgrea...@gmail.com` on 27 Oct 2009 at 9:27
GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1618.

Original comment by fiddloso...@gmail.com on 3 Nov 2009 at 6:50

GoogleCodeExporter commented 9 years ago
Thanks for the suggestion. As of r1618, only code that was "literate" in the 
input
will appear as "literate" in the output.

Original comment by fiddloso...@gmail.com on 3 Nov 2009 at 6:52