demydd / pandoc

Automatically exported from code.google.com/p/pandoc
0 stars 0 forks source link

Add support for Haskell reader (lhs2tex) #72

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by srobertj...@gmail.com on 2 Jun 2008 at 7:39

GoogleCodeExporter commented 8 years ago
Pandoc is a great tool!

It would be great to be able to read Haskell syntax itself as a reader.  That 
is, 
lhs2tex converts Haskell syntax to TeX.  I'd love to be able to do something 
similar 
with Pandoc, but get HTML output (with the correct alignment and mathematical 
symbols), so I could edit it.

Original comment by srobertj...@gmail.com on 2 Jun 2008 at 7:41

GoogleCodeExporter commented 8 years ago
I think it would probably be overkill to add a lhs reader to pandoc.
It seems to me that everything you need could be achieved by piping the lhs 
source
through a simple filter and then passing the result to pandoc.  The filter,
lhs2pandoc, would simply convert "bird tracks" sections into code blocks, 
leaving everything else the same:

INPUT--------------------------------------------
Here's some *regular text* in markdown.
And now, some haskell code:
> fib 0 = 1
> fib 1 = 1
> fib n = (n-1) + (n-2)
-------------------------------------------------

OUTPUT--------------------------------------------
Here's some *regular text* in markdown.
And now, some haskell code:

    fib 0 = 1
    fib 1 = 1
    fib n = (n-1) + (n-2)

---------------------------------------------

This could then be processed by pandoc to produce HTML (or latex or ...) 
output.  
Would that work for your purposes?  I think the filter script would be a perl 
or ruby
one-liner.

If syntax highlighting is desired, you could have the filter create delimited
code blocks instead. (See the README in the development version of pandoc in 
svn.)
The development version of pandoc includes syntax highlighting for haskell and
other languages.

Original comment by fiddloso...@gmail.com on 3 Jun 2008 at 5:06

GoogleCodeExporter commented 8 years ago
What I really like about lhs2tex is that it produces code in true mathematical 
symbols (eg real arrows instead of -->, real func compisition rings instead of 
., 
real not-equals instead of /=).  What I'd like to be able to do is get similar 
info 
in HTML form (using entities).

Original comment by srobertj...@gmail.com on 3 Jun 2008 at 10:52

GoogleCodeExporter commented 8 years ago

Original comment by fiddloso...@gmail.com on 11 Jul 2008 at 12:19

GoogleCodeExporter commented 8 years ago
I'm not going to add a Haskell reader to pandoc. It seems to me you could get 
the
functionality you want with some easy modifications to hscolour.  Why not try 
that?

Original comment by fiddloso...@gmail.com on 12 Jul 2008 at 5:01