Re: [Haskell-cafe] viewing HS files in Firefox
Adding the following to my lighttpd config (on Ubuntu Feisty) solves the problem from the server side: external configuration files ## mimetype mapping # change mime type for haskell source files so they get displayed # inside the browser include_shell /usr/share/lighttpd/create-mime.assign.pl mimetype.assign += ( .hs = text/plain, .lhs = text/plain ) -- Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
Johan Tibell wrote: Adding the following to my lighttpd config (on Ubuntu Feisty) solves the problem from the server side: external configuration files ## mimetype mapping # change mime type for haskell source files so they get displayed # inside the browser include_shell /usr/share/lighttpd/create-mime.assign.pl mimetype.assign += ( .hs = text/plain, .lhs = text/plain ) Fortunately the new haddock uses hscolour, so HS files are served as (colourised!) HTML and the problem is no longer a problem, for me. Jules ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
On Jan 10, 2008 1:55 PM, Jules Bean [EMAIL PROTECTED] wrote: Johan Tibell wrote: Adding the following to my lighttpd config (on Ubuntu Feisty) solves the problem from the server side: external configuration files ## mimetype mapping # change mime type for haskell source files so they get displayed # inside the browser include_shell /usr/share/lighttpd/create-mime.assign.pl mimetype.assign += ( .hs = text/plain, .lhs = text/plain ) Fortunately the new haddock uses hscolour, so HS files are served as (colourised!) HTML and the problem is no longer a problem, for me. Jules My problem is when viewing plain darcs repositories (like mine on darcs.johantibell.com which I recently fixed with the above mime type hack.) -- Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
Isaac Dupree wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience It is really annoying, and it is an astoundingly old bug in firefox. Apparently it's very hard to fix due to annoying details of the firefox architecture. It would be simplest for everyone if haskell.org was prepared to send out the files as text/plain (even though this is the wrong mime type), as I believe it used to do. The browser plugins can help, though. Jules ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
Jules Bean wrote: Isaac Dupree wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience It is really annoying, and it is an astoundingly old bug in firefox. Apparently it's very hard to fix due to annoying details of the firefox architecture. It would be simplest for everyone if haskell.org was prepared to send out the files as text/plain (even though this is the wrong mime type), as I believe it used to do. ... Yes, it does appear to be a bug in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=57342 not to attempt to display text/x-haskell as if it were text/plain, but to get really obsessive I'm not convinced text/plain is strictly speaking the 'wrong' media-type if that's what the user-agent requests. For example, my FireFox 1.5.0.5 says to the server it will Accept these media-types text/xml, application/xml, application/xhtml+xml, text/html; q=0.9, text/plain; q=0.8, image/png,*/*; q=0.5 This is in order of what it would most like to get back from the server. The server then goes off and tries to find the best media-type for my browser - it can supply different ones depending on what the browser says it wants. By returning it as text/x-haskell the server has given the resource to my browser in */* which is the least wanted media-type. This is perfectly correct behaviour, but if the server was also capable of providing the same thing as text/plain it would be better to give this, or even better a pretty coloured text/html one if the server had one available. I think the underlying file returned as text/x-haskell or text/plain can be the exact same file assuming all x-haskell are also plain. Could be wrong, but that's my understanding of content negotiation. Richard. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
I would love an answer to this as well. Isaac Dupree [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 10/27/2007 06:48 PM To Haskell-cafe haskell-cafe@haskell.org cc Subject [Haskell-cafe] viewing HS files in Firefox When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience Thanks, Isaac ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
The Open in Browser Firefox extension -- quite possibly the handiest thing since hoogle as a custom search engine plugin (if not handier!) http://www.spasche.net/mozilla/ --S On Oct 27, 2007, at 8:16 PM, Thomas Schilling wrote: On Sat, 2007-10-27 at 18:48 -0400, Isaac Dupree wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience I believe those kinds of problem have to do with the MIME-encoding on the server side: The server uses text/x-haskell. For Firefox to display the document inline it probably has to be text/plain. Not sure what the proper fix is, though. / Thomas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
Thomas Schilling wrote: On Sat, 2007-10-27 at 18:48 -0400, Isaac Dupree wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience I believe those kinds of problem have to do with the MIME-encoding on the server side: The server uses text/x-haskell. For Firefox to display the document inline it probably has to be text/plain. Not sure what the proper fix is, though. It should probably be fixed in one of the Apache config files. In the HTTP headers from darcs.haskell.org (viewed with the Live HTTP headers extension in FireFox) I'm getting Server: Apache/2.2.3 (Debian) Content-Type: text/x-haskell returned when I request the Map.hs file. For Apache 2.2 there seem to be various solutions. The web admin should probably be looking at these sorts of things http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addtype http://httpd.apache.org/docs/2.2/mod/core.html#forcetype http://httpd.apache.org/docs/2.2/mod/core.html#defaulttype and maybe rummaging in file httpd.conf Richard. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience In Windows what I do is save the file on the desktop when it asks you to save it. Then right-click the file and select open with and choose wordpad to open it with. Check the box open with this application every time. Now close it and go back to your browser and click on the file. It should now open up in wordpad each time. At least that is the behavior in IE. Thanks, Isaac Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
Shachaf Ben-Kiki wrote: Richard Kelsall wrote: Thomas Schilling wrote: On Sat, 2007-10-27 at 18:48 -0400, Isaac Dupree wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience I believe those kinds of problem have to do with the MIME-encoding on the server side: The server uses text/x-haskell. For Firefox to display the document inline it probably has to be text/plain. Not sure what the proper fix is, though. It should probably be fixed in one of the Apache config files. In the HTTP headers from darcs.haskell.org (viewed with the Live HTTP headers extension in FireFox) I'm getting Fixed? It's already fixed. text/x-haskell is the right Content-Type to send; this is Haskell after all, not just plaintext. It's your browser's responsibility to display it any way it likes. People have had this discussion in #xmonad, and it seems that MIME edit (https://addons.mozilla.org/en-US/firefox/addon/4498) is a workable solution (I don't use it myself, though). Of course, Sterling Clover's suggestion (Open in Browser) would also work well. Hello Shachaf, I hope you intended this for the list, as I haven't seen it come through, if not my apologies for posting it. Ah, yes I see what you mean, text/x-haskell is the best media-type, however I think it ought to be possible to use 'content negotiation' http://httpd.apache.org/docs/2.2/content-negotiation.html with more than one representation to supply the same file as text/plain to non-Haskell-capable browsers. I haven't actually done this though so can't be certain of it or provide configuration details. If somebody really wanted to get clever with it it could also supply pretty coloured Haskell for a text/html representation. Sorry, I couldn't find the #xmonad discussion, is this published somewhere? Richard. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
On 27/10/2007, Isaac Dupree [EMAIL PROTECTED] wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience I've looked into this before but haven't found a satisfactory answer. At best, you can get the offending MIME types to open in a third party text viewer. But I don't know how to force the internal text viewer. Actually, a thought occurs. The address bar prefix view-source: works for html. As in, http://www.haskell.org; - view-source:http://www.haskell.org;. This might be an effective workaround though I don't have a page to test it on right now. Cheers, D. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
Dougal Stanton wrote: On 27/10/2007, Isaac Dupree [EMAIL PROTECTED] wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience I've looked into this before but haven't found a satisfactory answer. At best, you can get the offending MIME types to open in a third party text viewer. But I don't know how to force the internal text viewer. Actually, a thought occurs. The address bar prefix view-source: works for html. As in, http://www.haskell.org; - view-source:http://www.haskell.org;. This might be an effective workaround though I don't have a page to test it on right now. hmm, taking http://darcs.haskell.org/ghc-6.6/packages/base/Data/Map.hs that works, but it's rather inconvenient to convince Firefox to put the URL into the address bar so I can type view-source in front. I had to use copy link location, make a new tab, and paste into the empty address bar (unless there's some way I didn't find) ISaac ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] viewing HS files in Firefox
On Sat, 2007-10-27 at 18:48 -0400, Isaac Dupree wrote: When I try to go to one of the Module.hs files, e.g. on darcs.haskell.org, it now has type HS and Firefox refuses to display it (and only lets me download it). Does anyone know how to make Firefox treat certain file types as others (HS as plain text, in particular)? so that I can browse them with any convenience I believe those kinds of problem have to do with the MIME-encoding on the server side: The server uses text/x-haskell. For Firefox to display the document inline it probably has to be text/plain. Not sure what the proper fix is, though. / Thomas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe