[Haddock] [haddock] #142: Special handling of URLs in documentation

haddock haddock at projects.haskell.org
Sun Feb 12 08:54:55 GMT 2012


#142: Special handling of URLs in documentation
---------------------------------+------------------------------------------
Reporter:  KrzysztofSkrzetnicki  |        Owner:  SimonHengel
    Type:  enhancement           |       Status:  assigned   
Priority:  minor                 |    Milestone:  2.7.0      
 Version:  2.6.0                 |   Resolution:             
Keywords:                        |  
---------------------------------+------------------------------------------

Comment(by SimonHengel):

 If we assume that a URL reaches as far as we do not see any whitespace,
 it's easy (and possible to do in the lexer, see
 [https://github.com/sol/haddock/commit/79c24f724905508cd37ffe979e044edbabb7d2d6
 this commit]).

 But what about:

 {{{
    for more see http://example.com.
 }}}

 Here the user's intention is probably, not to include the trailing dot
 into the URL (same for any of {{{,;?!}}}).  This is still possible, but
 not particularly beautiful (see
 [https://github.com/sol/haddock/commit/cab80ac05faa1a0e9c70088144ebcca8cec80dca
 this commit]).

 It gets uglier:

 {{{
     some text (see http://example.com)
 }}}

 GitHub's code for [http://github.github.com/github-flavored-markdown/ GFM]
 includes
 [https://github.com/tanoku/sundown/blob/63d995158ec8e5f988f34086f96376b93ac751f9/src/autolink.c#L99
 more such examples].

 I haven't followed that route, but I think it could get quite messy.

 To sum up, what options do we have?
  1. Close as won't fix
  1. Make a partial solution, like "a URL reaches as far as we do not see
 any whitespace"
  1. Implement the full-fledged beast, similar to what GitHub does
  1. Anything else?

 Personally, I think (2.) is just trading one shortcoming for an other.
 Both (1.) and (3.) work for me.  (3.) is more work and may give us trouble
 in the future, so I'd tend to go for (1.) and rather do a sensible
 implementation of #190.

 Opinions?

-- 
Ticket URL: <http://trac.haskell.org/haddock/ticket/142#comment:3>
haddock <http://www.haskell.org/haddock>
Haddock, The Haskell Documentation Tool


More information about the Haddock mailing list