5

I'd like to read the source code for a library (example), but with the Haddock comments rendered pretty (example) . http://www.haskell.org/ghc/docs has both of these views, but doesn't combine them together.

Has anyone made a UI to view these together? It would basically be the rendered view, but with the source code for each function/class/whatever inserted directly below each rendered doc item.

misterbee
  • 5,142
  • 3
  • 25
  • 34
  • 4
    This isn't quite what you're asking, but there is a "Source" link next to all the definitions which (should) bring you to the line of code where the corresponding definition occurs. – David Young Jan 10 '14 at 01:59
  • 1
    Yes, I know. I want to get the linked source on the same page. If Haddock emits end tags for each entity (besides the start tags that `Source` links to), then one could use AJAX and DOM manipulation to merge the two views. – misterbee Jan 10 '14 at 02:42
  • 1
    You could duplicate any non-type-signature code, prepending at the first non-whitespace with `-- >` to mark it up as example code, and re-run haddock on it, but maybe you weren't after an offline solution. – not my job Jan 10 '14 at 19:50
  • @chunksOf50 nice idea, I might try that! – misterbee Jan 12 '14 at 18:26

0 Answers0