Haddock reader #806

Merged
merged 1 commit into from Mar 28, 2013

Projects

None yet

2 participants

@davidlazar

No description provided.

@jgm jgm merged commit 18459b9 into jgm:master Mar 28, 2013

1 check passed

Details default The Travis build passed
@jgm
Owner

Thanks! I've merged this. I added stubs for automated tests: tests/haddock-reader.haddock and tests/haddock-reader.native. Can you replace these with something that tests all the haddock markup features?

Also, I noticed that if you run the reader on hi\n\n\n, you get Para [Str "hi\n"], which shouldn't happen. It should be Para [Str "hi"]. Can this be fixed?

@jgm jgm pushed a commit that referenced this pull request Mar 29, 2013
John MacFarlane Haddock writer: use 'text' builder instead of 'str'.
This articulates strings into Str, Space, allowing them to be
hard-wrapped intelligently by the writers.

This patch also fixes a bug with trailing spaces and newlines.
(See #806.)
3096997
@jgm
Owner

I fixed the problem, but haven't tested much beyond that. Some good tests are still needed.

@jgm
Owner

I tried pandoc -f haddock on the haddock in Pipes/Proxy/Tutorial.hs from pipes. It gives empty output. So something is wrong -- at the very least it should produce an error explaining why parsing failed.

@davidlazar

The reader only parses Haddock markup directly, not Haskell comments that contain markup as in the pipes example.

How should I report parse errors?

@jgm
Owner
@jgm
Owner

Would it be worth adding the attribute "haskell" to the code blocks? This would cause them to be highlighted. Unless you think it's bad to assume that code in Haddock documentation is haskell?

Instead of codeBlock, use codeBlockWith ("",["haskell"],[]).

You can do something similar with the inline code bits (codeWith).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment