darcs repository web UI and hosting app. This is the main darcsden trunk, which also runs hub.darcs.net. (http://hub.darcs.net)
#143embedded svg images don't display
The svgs aren't showing at http://hub.darcs.net/pointfree/darcs-swag for some reason.
I found that when I change
(\(OK _) -> serveFileAs "text/plain" $ repoDir (view rOwner r) (view rName r) </> f)to
(\(OK _) -> serveFile $ repoDir (view rOwner r) (view rName r) </> f)in
getBrowseRawFileRthe SVGs display as images in the README.md just fine because then darcsden is not trying to display them as text files (when I embed the image I link to the
/raw-fileurl). So then, naturally
/raw-filePDFs display as PDFs, not as text files.
However, that's not really a solution yet in IMHO because when we want to view a
/raw-filewe don't necessarily want to download it which is what would happen when we go for the latter method.
One solution for display text files as text and binary files as their own filetype is to detect the character encoding of the file. If
Nothingis detected, assume it is binary, if a character encoding is detected assume it is
Hm, maybe http://hackage.haskell.org/package/magic-1.1 is more the thing for this. I will have to try it out.
The following patch will render binary files under
raw-file/if they are recognized by the browser and download them otherwise. As I think about it, I think more and more this is a good behavior (we view files as
browse/...right?) So, PDFs will be displayed as PDFs and SVGs will be displayed as SVGs under `raw-file/'
This fixes this issue because I was using
raw-file/paths to display the SVG images.
It would be nice to display unrecognized formats as
text/plainif they are identified as plain text by magic (uses the same system as the unix
filecommand). We may want to view the raw markdown of a
I have new patches to solve this problem in a more satisfactory way.
text/plainif MIME type begins with
Markdown files will be rendered as markdown under
browse/and viewed as text/plain under
raw-file/SVGs will be rendered when embedded or viewed as
raw-file/and viewed as code under
@simon, is this now WONTFIX?
No! Thanks for the bump. I am working on a new build now.
@pointfree, I have merged and deployed this, and see images at http://hub.darcs.net/pointfree/darcs-swag/browse/README.md (after shift-reloading), so I think it's working. Thanks!
(Unrelated: darcs hub's last darcsden build was in january, so we should now also have your username linkification in issues patch, but I don't see it working.)
- status set to closed
This works now.