
I'm not against adding this to GHC, but it's trivial to have it as a separate program (see my markdown-unlit [1]). Maybe the external program is more flexible when it comes to extending/bug fixing? But if you decide to add it to GHC, then please also add test cases for the proposed code. As a side note, ```-style code block are not part of "standard" markdown. Cheers, Simon Hengel [1] http://hackage.haskell.org/package/markdown-unlit On Mon, Jun 24, 2013 at 01:25:43PM -0700, Iavor Diatchki wrote:
Hello,
I think that good support for writing literate Haskell in markdown notation would be great! Over the weekend I updated the wiki page with a fairly detailed description of the proposal, which Trevor implemented.
What do folks think about the feature, and if we are happy with the design, would there be objections if I merged it in?
-Iavor
On Wed, Jun 19, 2013 at 4:28 PM, Trevor Elliott
wrote: Hi All,
I've implemented support for literate markdown in a branch [1]. After doing a search on the bug tracker to see if anyone had already worked on this I came across bug #4836 [2], which details some unexpected interactions between the markdown format, unlit and CPP. Specifically, unlit attempts to keep CPP in the comment sections of a literate file, which clashes with the way that headings are defined in markdown.
The approach that I took is that when GHC is processing markdown files, it passes the -r and -# flags to unlit, causing it to remove CPP in the comment parts of the file. I've added support for .markdown and .md as source file extensions supported by GHC to be able to detect when this is necessary. CPP can still be used within code blocks, giving a path forward for the case where the file was generated by something that wishes to leave #line markers. I've documented the changes on the wiki at [3].
Does this approach sound reasonable? If so, should I attach a patch to #4836, or create a new ticket?
Thanks!
--trevor
[1] https://github.com/elliottt/**ghc/tree/literate-markdownhttps://github.com/elliottt/ghc/tree/literate-markdown [2] http://hackage.haskell.org/**trac/ghc/ticket/4836http://hackage.haskell.org/trac/ghc/ticket/4836 [3] http://hackage.haskell.org/**trac/ghc/wiki/LiterateMarkdownhttp://hackage.haskell.org/trac/ghc/wiki/LiterateMarkdown
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs