Announce: markdown 0.1

66 views
Skip to first unread message

Michael Snoyman

unread,
Jul 15, 2012, 10:28:05 AM7/15/12
to web-devel, yeso...@googlegroups.com
Hi all,

I've just released the first version of the markdown package to
Hackage[1]. I've been using this package for a while already for
rendering blog posts on yesodweb.com. I put in some time today
cleaning it up and fixing some features, and feel it's now ready for
an experimental release.

The distinguishing features of this library versus other options are:

* Uses blaze-html types natively, making it easy to use with many
existing libraries (Hamlet included).
* Permissive license (BSD3).
* attoparsec and conduit used for parsing.
* Built in XSS protection (though you can disable it if desired).

The library also has a very thorough test suite, but I'd be happy to
accept more test cases. Please report issues/send pull requests on
Github[2].

Michael

[1] http://hackage.haskell.org/package/markdown
[2] https://github.com/snoyberg/markdown

Vincent Ambo

unread,
Jul 16, 2012, 8:56:59 AM7/16/12
to yeso...@googlegroups.com
Nice! Been using this for a few weeks now and being able to get it from Hackage is definitely even nicer! ;-)

Oh btw, on http://www.yesodweb.com/book/wiki-chat-example it still says that this package is not available from Hackage.

Cheers,
Vincent

Michael Snoyman

unread,
Jul 16, 2012, 9:20:00 AM7/16/12
to Simon Hengel, web-devel, yeso...@googlegroups.com
On Sun, Jul 15, 2012 at 7:03 PM, Simon Hengel <s...@typeful.net> wrote:
> Hi Michael,
>
>> I've just released the first version of the markdown package to
>> Hackage[1]. I've been using this package for a while already for
>> rendering blog posts on yesodweb.com. I put in some time today
>> cleaning it up and fixing some features, and feel it's now ready for
>> an experimental release.
>
> I'm looking for an replacement for pandoc to unlit Haskell code from
> README.markdow files (so that I can make sure that code examples from
> the README actually work). The pain with pandoc is, that it takes quite
> some time to build. This is especially an issue if you use travis-ci,
> as it delays failure reports about 5 minutes.
>
> In terms of build times, this package is already an improvement, but
> still not ideal.
>
> Cheers,
> Simon

Hi Simon,

One thing that has slowed build times significantly before is the
`pack` function from `text`. Starting with 0.11.2, that's been
improved drastically. I'm not sure if that's affecting you at all. But
in general, I'm not trying to optimize for build times. I intend
markdown to be another web library, and in then vein will allow it to
depend on any library that I consider a "standard" web library. In
this case, that includes some heavy hitters, like attoparsec.

But for your purposes, I think the Text.Markdown.Block module itself
(documentation hidden on Hackage, but have a look at the source) will
probably provide you with the best API, and it only depends on
`conduit`. It might be worth looking into building a tool based on
that module alone. If that works for you, we can discuss different
ways to make that available (compile time flags or a separate package
seem like valid options).

Michael

Michael Snoyman

unread,
Jul 16, 2012, 9:20:52 AM7/16/12
to yeso...@googlegroups.com
Thanks for the heads-up on the book, it's fixed. (It's so convenient
having a commit hook to update the site...)

Michael Snoyman

unread,
Jul 17, 2012, 12:05:44 AM7/17/12
to John MacFarlane, web-devel, yeso...@googlegroups.com
Thank you for the link to the test suite! I thought I'd seen
references to it elsewhere, but didn't know where to find it. I've
already started making some changes based on it.

As for discount and sundown: I actually forgot to mention in my
"distinguishing features" that the markdown package is pure Haskell,
which makes it far simpler to get it working on Windows, and
simplifies to some extent uploading executables to a server. In
theory, markdown also has the potential to be a very fast renderer,
though I have neither benchmarked it nor optimized it yet.

On Tue, Jul 17, 2012 at 12:48 AM, John MacFarlane
<fiddlo...@gmail.com> wrote:
> Michael,
>
> Have you tested this using the markdown test suite (and preferably also
> the PHP markdown test suite)? There are so many complexities in parsing
> markdown correctly that aren't obvious at first. (I say this from
> experience!)
>
> http://six.pairlist.net/pipermail/markdown-discuss/2007-May/000616.html
> http://www.mail-archive.com/markdown...@six.pairlist.net/msg01542.html
>
> I can see from a few cursory tests that the library is FAR from being
> an accurate and complete markdown renderer.
>
> -------------- nested lists
>
> % ./markdown # <- a shell around Text.Markdown with default options
> 1. one
> 1. two
> - three
> <ol><li>one</li></ol><pre><code>1. two
> - three</code></pre>
>
> % Markdown.pl # <- original markdown perl script
> 1. one
> 1. two
> - three
> <ol>
> <li>one
> <ol><li>two
> <ul><li>three</li></ul></li></ol></li>
> </ol>
>
> -------------- inline code
>
> % ./markdown
> ``` `` ```
> <p>``<code> </code>``</p>
>
> % Markdown.pl
> ``` `` ```
> <p><code>``</code></p>
>
> -------------- reference-style links
>
> % ./markdown
> [Hi][]
>
> [Hi]: /url
> <p>[Hi][]</p><p>[Hi]: /url</p>
>
> % Markdown.pl
> [Hi][]
>
> [Hi]: /url
> <p><a href="/url">Hi</a></p>
>
> Some advice: If you want a fast, non-GPL markdown parser, use
>
> http://hackage.haskell.org/package/discount
>
> or
>
> http://hackage.haskell.org/package/sundown
>
> (which wraps the library used by github).
>
> John
>
> +++ Michael Snoyman [Jul 15 12 17:28 ]:
>> _______________________________________________
>> web-devel mailing list
>> web-...@haskell.org
>> http://www.haskell.org/mailman/listinfo/web-devel
>>
Reply all
Reply to author
Forward
0 new messages