PROPOSAL: Literate Haskell in markdown noation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

PROPOSAL: Literate Haskell in markdown noation

Iavor Diatchki
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 <trevor at galois.com> 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-markdown<https://github.com/elliottt/ghc/tree/literate-markdown>
> [2] http://hackage.haskell.org/**trac/ghc/ticket/4836<http://hackage.haskell.org/trac/ghc/ticket/4836>
> [3] http://hackage.haskell.org/**trac/ghc/wiki/LiterateMarkdown<http://hackage.haskell.org/trac/ghc/wiki/LiterateMarkdown>
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130624/85aea5c6/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

PROPOSAL: Literate Haskell in markdown noation

David Luposchainsky
On 2013-06-24 22:25, Iavor Diatchki wrote:
> 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?

I'm all for this. Over the years, many markup languages have come up,
and juggling between Mediawiki, Haddoc, HTML, Latex and what not is
really unnecessary. Markdown has reached a certain de-facto standard for
beefed up text files. In the context of Haskell, it's easy to type (bird
tacks are pretty awful to write multiple lines fluently with if you ask
me), and it doesn't look as awkward than literate Tex Haskell, being
readable in text and rendered formats.

David


Reply | Threaded
Open this post in threaded view
|

PROPOSAL: Literate Haskell in markdown noation

Austin Seipp-4
This argument is a little tenuous in my opinion. Markdown is very
ill-specified formally speaking with many implementations (including
our beloved Pandoc) featuring various extensions. It is not really a
'standard' in the typical sense. Pandoc actually only recently
supported 'GitHub code delimiters' - as in the above patch - only as
of a year ago or so, I believe.

In fact I believe Gruber's Markdown does not even specify a way to
delimit code blocks syntactically like this. So any way you slice it,
it's pretty "not standard." As for the MD vs TeX argument, well, it's
a pretty different tool entirely.

All that said, I'd support this patch. But mostly because it doesn't
actually introduce Markdown in any way, as much as it introduces a
relatively-simple new literate-style delimiter, in essence. (There are
arguably other forms we could support too, like the simple ``` form,
but that's where the ill-specification begins to rear its head...)

Finally, before a merge, it'd be nice to get this mentioned in the
users guide, and the release notes of course (I've been trying to keep
them a little more up to date.)

On Mon, Jun 24, 2013 at 3:46 PM, David Luposchainsky
<dluposchainsky at googlemail.com> wrote:

> I'm all for this. Over the years, many markup languages have come up,
> and juggling between Mediawiki, Haddoc, HTML, Latex and what not is
> really unnecessary. Markdown has reached a certain de-facto standard for
> beefed up text files. In the context of Haskell, it's easy to type (bird
> tacks are pretty awful to write multiple lines fluently with if you ask
> me), and it doesn't look as awkward than literate Tex Haskell, being
> readable in text and rendered formats.
>
> David
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs



--
Regards,
Austin - PGP: 4096R/0x91384671


Reply | Threaded
Open this post in threaded view
|

PROPOSAL: Literate Haskell in markdown noation

Simon Hengel
In reply to this post by Iavor Diatchki
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 <trevor at galois.com> 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-markdown<https://github.com/elliottt/ghc/tree/literate-markdown>
> > [2] http://hackage.haskell.org/**trac/ghc/ticket/4836<http://hackage.haskell.org/trac/ghc/ticket/4836>
> > [3] http://hackage.haskell.org/**trac/ghc/wiki/LiterateMarkdown<http://hackage.haskell.org/trac/ghc/wiki/LiterateMarkdown>
> >
> >
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs at haskell.org
> > http://www.haskell.org/mailman/listinfo/ghc-devs
> >
> >

> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs



Reply | Threaded
Open this post in threaded view
|

PROPOSAL: Literate Haskell in markdown noation

Jason Dagit-3
In reply to this post by Iavor Diatchki
I would definitely take advantage of this feature (for blog posts
mostly) if it gets merged.

+1

On Mon, Jun 24, 2013 at 1:25 PM, Iavor Diatchki
<iavor.diatchki at gmail.com> 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 <trevor at galois.com> 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-markdown
>> [2] http://hackage.haskell.org/trac/ghc/ticket/4836
>> [3] http://hackage.haskell.org/trac/ghc/wiki/LiterateMarkdown
>>
>>
>> _______________________________________________
>> ghc-devs mailing list
>> ghc-devs at haskell.org
>> http://www.haskell.org/mailman/listinfo/ghc-devs
>>
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>


Reply | Threaded
Open this post in threaded view
|

PROPOSAL: Literate Haskell in markdown noation

Simon Peyton Jones
In reply to this post by Iavor Diatchki
Certainly ok with me.  Thanks!

(There should be a ticket; and user-manual docs.)

Simon

From: Iavor Diatchki [mailto:iavor.diatchki at gmail.com]
Sent: 24 June 2013 21:26
To: Trevor Elliott
Cc: ghc-devs at haskell.org; Simon Peyton-Jones
Subject: PROPOSAL: Literate Haskell in markdown noation

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 <trevor at galois.com<mailto:trevor at galois.com>> 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-markdown
[2] http://hackage.haskell.org/trac/ghc/ticket/4836
[3] http://hackage.haskell.org/trac/ghc/wiki/LiterateMarkdown


_______________________________________________
ghc-devs mailing list
ghc-devs at haskell.org<mailto:ghc-devs at haskell.org>
http://www.haskell.org/mailman/listinfo/ghc-devs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130625/630b3c55/attachment.htm>