No description provided.
Add reader for Haddock markup based on Haddock's own lexer/parser.
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?
Para [Str "hi\n"]
Para [Str "hi"]
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.
I fixed the problem, but haven't tested much beyond that. Some good tests are still needed.
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.
pandoc -f haddock
The reader only parses Haddock markup directly, not Haskell comments that contain markup as in the pipes example.
How should I report parse errors?
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).