[Haskell-cafe] Problems with code blocks in the description field in a .cabal file

Josef Svenningsson josef.svenningsson at gmail.com
Mon Feb 4 17:25:19 CET 2013


On Mon, Feb 4, 2013 at 5:10 PM, Ryan Yates <fryguybob at gmail.com> wrote:

> Hi Josef,
>
> Sorry, I misunderstood the intent.  From what I can tell this is a
> Cabal deficiency.  The text from the description field first passes through
> the `tokeniseLine` function from here:
> https://github.com/haskell/cabal/blob/cabal-1.16/Cabal/Distribution/ParseUtils.hs#L428which seems to have no provision for escaping.
>
> Indeed. Bummer. And I notice now that there's already a bug filed in the
tracker about this:
https://github.com/haskell/cabal/issues/885

I guess I'll have to do without the example in my documentation for now.

Thank you very much!

Josef


> Ryan
>
>
> On Mon, Feb 4, 2013 at 8:37 AM, Josef Svenningsson <
> josef.svenningsson at gmail.com> wrote:
>
>> Hi Ryan,
>>
>> As far as I can tell I'm following the Haddock formatting just fine. I'm
>> using bird tracks for my code block and according to the Haddock manual
>> those code blocks are interpreted literally without any additional markup.
>>  To me that suggests that I should be able to write just about anything in
>> these code blocks. But that's evidently not so.
>>
>> The documentation for the lens package is indeed impressive. But it
>> doesn't help me with my particular conundrum of the curly braces.
>>
>> Thanks,
>>
>> Josef
>>
>> On Mon, Feb 4, 2013 at 2:01 PM, Ryan Yates <fryguybob at gmail.com> wrote:
>>
>>> Hi Josef,
>>>
>>> You should be fine if you follow Haddock formatting.  For example:
>>>
>>> http://hackage.haskell.org/package/lens
>>>
>>> Is from the cabal file:
>>>
>>> http://hackage.haskell.org/packages/archive/lens/3.8.5/lens.cabal
>>>
>>>
>>> Ryan
>>>
>>>
>>> On Mon, Feb 4, 2013 at 7:30 AM, Josef Svenningsson <
>>> josef.svenningsson at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm putting together a cabal package and I'd like to have some code
>>>> examples in my description file. In particular I would like to have a code
>>>> block containing markdown containing a code block of Haskell, like this:
>>>>
>>>> > ~~~{ .haskell }
>>>> > module Main where
>>>> >
>>>> > main = putStrLn "Hello World!"
>>>> > ~~~
>>>>
>>>> When I put the above code in my .cabal file and do `cabal haddock
>>>> --executables` I get the following error:
>>>>
>>>> haddock: failed to parse haddock prologue from file:
>>>> dist/doc/html/codeExtract/codeExtract/haddock-prolog31969.txt
>>>>
>>>> In general I can provoke the parse error from haddock whenever I have
>>>> something inside curly braces.
>>>>
>>>> So the error seems to stem from haddock. I've tried to track down what
>>>> happens inside haddock but I've run out steam. I'd like to know if there is
>>>> anything I can do to be able to write something like the above as part of
>>>> the description in my .cabal file.
>>>>
>>>> Thanks,
>>>>
>>>> Josef
>>>>
>>>> _______________________________________________
>>>> Haskell-Cafe mailing list
>>>> Haskell-Cafe at haskell.org
>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130204/6a8c0731/attachment.htm>


More information about the Haskell-Cafe mailing list