Package logo's

Bas van Dijk v.dijk.bas at gmail.com
Mon Oct 24 08:27:04 CEST 2011


On 23 October 2011 00:58, Max Bolingbroke <batterseapower at hotmail.com> wrote:
> Hi Bas,
>
> On 22 October 2011 21:15, Bas van Dijk <v.dijk.bas at gmail.com> wrote:
>> Attached is the package logo patch I was working on.
>
> I wonder if perhaps you should implement this more like how Duncan
> implemented change logs. i.e.:
>
>  1. Add a rendLogo field to PackageRender
>  2. Have doPackageRender fill rendLogo out by doing an IO-monad query
> similar to getLogoHtml but which is of type e.g. IO (Maybe String),
> where the String will be the URI of the logo
>  3. Change packagePage to build HTML (i.e. img or object tag) from
> this URI based on the extension
>
> I think the advantage of this approach is that:
>  a) You won't have to add the logo-finding code to both the package
> page and the candidate-package page, since PackageRender is shared
> code between them
>  b) The rendLogo field of PackageRender could sensibly be consumed by
> other users -- e.g. a feature producing JSON representing a package
>  c) It is more uniform with how stuff like this is currently
> implemented (I'm mainly thinking of changelogs here)
>
> Thoughts?
>
> Max
>

I like the idea Max. Attached is the patch which implements it.
There's only one issue: In doPackageRender I can't make the
distinction between normal and candidate packages so I can't serve the
correct logo url. So currently candidate logo's are broken. Do you
have an idea to make them work again?

Regards,

Bas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: package-logos.dpatch
Type: application/octet-stream
Size: 89856 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/cabal-devel/attachments/20111024/020109a8/attachment-0001.obj>


More information about the cabal-devel mailing list