Ticket #53 (closed defect: fixed)

Opened 6 years ago

Last modified 22 months ago

DocPic is not handled in Haddock.Interface.Rename.renameDoc and other places

Reported by: pgavin Owned by:
Priority: major Milestone:
Version: 2.2.1 Keywords:
Cc:

Description

I'm not sure which version of GHC that constructor was introduced in, but Gtk2HS uses it for a few things, and I was trying to get Haddock 2.2.2 working with it. I went ahead and implemented it as best I could given what I know about Haddock & GHC :)

I tested the patch against Gtk2HS, and images show up as they should. The output for images under Hoogle is empty, since I don't really know anything about how Hoogle works or if it even supports images. I'm sure some ifdefs or something will probably have to be added whenever GHC doesn't support DocPic?, also.

Change History

Changed 6 years ago by pgavin

Hmm, I tried attaching the patch as a file, but that didn't work. Here's the patch:

[implement DocPic? Peter Gavin <pgavin@…>**20080820235905] { hunk ./src/Haddock/Backends/Hoogle.hs 201 + markupPic = const $ str "", hunk ./src/Haddock/Backends/Html.hs 1499 + markupPic = \path -> image ! [src path], hunk ./src/Haddock/Interface/Rename.hs 190 - DocURL str -> return (DocURL str) + DocURL str -> return (DocURL str) + DocPic? str -> return (DocPic? str) hunk ./src/Haddock/InterfaceFile.hs 409 + put_ bh (DocPic? ao) = do + putByte bh 14 + put_ bh ao hunk ./src/Haddock/InterfaceFile.hs 457 + 14 -> do + ao <- get bh + return (DocPic? ao) hunk ./src/Haddock/Types.hs 197 + markupPic :: String -> a, hunk ./src/Haddock/Utils.hs 322 +markup m (DocPic? img) = markupPic m img hunk ./src/Haddock/Utils.hs 344 + markupPic = DocPic?, }

Changed 6 years ago by pgavin

Hrrm, it got reformatted... try again with preview this time:

[implement DocPic
Peter Gavin <pgavin@gmail.com>**20080820235905] {
hunk ./src/Haddock/Backends/Hoogle.hs 201
+  markupPic           = const $ str "",
hunk ./src/Haddock/Backends/Html.hs 1499
+  markupPic           = \path -> image ! [src path],
hunk ./src/Haddock/Interface/Rename.hs 190
-  DocURL str -> return (DocURL str) 
+  DocURL str -> return (DocURL str)
+  DocPic str -> return (DocPic str)
hunk ./src/Haddock/InterfaceFile.hs 409
+    put_ bh (DocPic ao) = do
+            putByte bh 14
+            put_ bh ao
hunk ./src/Haddock/InterfaceFile.hs 457
+              14 -> do
+                    ao <- get bh
+                    return (DocPic ao)
hunk ./src/Haddock/Types.hs 197
+  markupPic           :: String -> a,
hunk ./src/Haddock/Utils.hs 322
+markup m (DocPic img)          = markupPic m img
hunk ./src/Haddock/Utils.hs 344
+  markupPic           = DocPic,
}

Changed 6 years ago by waern

  • milestone set to 2.3.0

Hi,

Thanks for doing this! I merged the DocPic? stuff from Haddock 0.9 into the GHC parser before releasing Haddock 2.0.0.0, but as you noticed, I forgot to handle DocPic? at certain places in Haddock. I will make sure your fix gets into the next release.

Changed 6 years ago by waern

  • status changed from new to closed
  • resolution set to fixed

Applied.

Changed 22 months ago by anonymous

  • milestone 2.3.0 deleted

Milestone 2.3.0 deleted

Note: See TracTickets for help on using tickets.