Re: [fossil-users] Adding custom mimetypes

2017-12-23 Thread Peter MacDonald
Thanks, now that you've pointed it out I see it in the code.

Adding it to the url is better than relying on a custom fossil binary.

BTW: What I should have said is "it would be nice to be able to define
aliased file extensions" as that is closer to what I was seeking.


On Sat, Dec 23, 2017 at 11:38 AM, Peter MacDonald  wrote:
> My project (jsish.org) requires defining a new extension .jsi that
> maps to the same as .js.
> This is so we can click on a link to example code, and have not download.
> For example, the link to ./fileSize.jsi on this page:
>
>   http://jsish.org/jsi/www/js-modules.wiki
>
> The only solution I could come up with was patching fossil (below).
> Is there no better way?
>
> Thanks, Peter
>
>
> --- doc.c.orig 2017-12-23 11:24:54.916316685 -0800
> +++ doc.c 2017-12-10 18:21:22.933162382 -0800
> @@ -150,6 +150,7 @@
>{ "jpeg",   4, "image/jpeg"},
>{ "jpg",3, "image/jpeg"},
>{ "js", 2, "application/x-javascript"  },
> +  { "jsi",3, "application/x-javascript"  },
>{ "kar",3, "audio/midi"},
>{ "latex",  5, "application/x-latex"   },
>{ "lha",3, "application/octet-stream"  },
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Adding custom mimetypes

2017-12-23 Thread Richard Hipp
On 12/23/17, Peter MacDonald  wrote:
> My project (jsish.org) requires defining a new extension .jsi that
> maps to the same as .js.
> This is so we can click on a link to example code, and have not download.
> For example, the link to ./fileSize.jsi on this page:
>
>   http://jsish.org/jsi/www/js-modules.wiki
>
> The only solution I could come up with was patching fossil (below).
> Is there no better way?

The /doc page accepts a mimetype=? query parameter.  I think.
Double-check behind me.  If I'm right, you should be able to add
?mimetype=text/plain to the link to have the text of the file
displayed rather than loaded as javascript, or whatever it is you want
to do.

-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] Adding custom mimetypes

2017-12-23 Thread Peter MacDonald
My project (jsish.org) requires defining a new extension .jsi that
maps to the same as .js.
This is so we can click on a link to example code, and have not download.
For example, the link to ./fileSize.jsi on this page:

  http://jsish.org/jsi/www/js-modules.wiki

The only solution I could come up with was patching fossil (below).
Is there no better way?

Thanks, Peter


--- doc.c.orig 2017-12-23 11:24:54.916316685 -0800
+++ doc.c 2017-12-10 18:21:22.933162382 -0800
@@ -150,6 +150,7 @@
   { "jpeg",   4, "image/jpeg"},
   { "jpg",3, "image/jpeg"},
   { "js", 2, "application/x-javascript"  },
+  { "jsi",3, "application/x-javascript"  },
   { "kar",3, "audio/midi"},
   { "latex",  5, "application/x-latex"   },
   { "lha",3, "application/octet-stream"  },
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users