Hi, I'm using fossil for some projects, I've seen a clear limitation in mime types. I've added some mime types to fossil. I wonder if it wouldn't be useful to allow to add new mime types to the repository without recompiling.
Otherwise it would be interesting to pass a mime type to the doc link, so as to tell fossil how to show the page I had to modify doc.c to show source files as documentation. Sometimes it's useful to link source files in documentation without having to tie to a particular check-in. By example this would not work with official fossil: https://pizzahack.eu/fossil/thunderchez/doc/tip/nanomsg/bus It would open the file as external instead of showing it as embedded documentation. Another question... there is a way to link to a directory of the latest check-in? by example this link points to directory cairo, but of a particular check-in... https://pizzahack.eu/fossil/thunderchez/dir?ci=3c717fb0e55501e7&name=cairo Also I'm using fossil to store some screenshots of the program, you recommend using unversioned files in this case? Best regards Aldo Nicolas Bruno
diff -uru fossil-1.35/src/doc.c fossil-1.35-mio/src/doc.c --- fossil-1.35/src/doc.c 2016-06-14 13:10:39.000000000 +0200 +++ fossil-1.35-mio/src/doc.c 2016-09-04 20:33:02.680095406 +0200 @@ -218,7 +218,7 @@ { "rpm", 3, "audio/x-pn-realaudio-plugin" }, { "rtf", 3, "text/rtf" }, { "rtx", 3, "text/richtext" }, - { "scm", 3, "application/x-lotusscreencam" }, + { "scm", 3, "text/plain" }, { "set", 3, "application/set" }, { "sgm", 3, "text/sgml" }, { "sgml", 4, "text/sgml" }, @@ -230,12 +230,15 @@ { "skm", 3, "application/x-koan" }, { "skp", 3, "application/x-koan" }, { "skt", 3, "application/x-koan" }, + { "sld", 2, "text/plain" }, + { "sls", 2, "text/plain" }, { "smi", 3, "application/smil" }, { "smil", 4, "application/smil" }, { "snd", 3, "audio/basic" }, { "sol", 3, "application/solids" }, { "spl", 3, "application/x-futuresplash" }, { "src", 3, "application/x-wais-source" }, + { "ss", 2, "text/plain" }, { "step", 4, "application/STEP" }, { "stl", 3, "application/SLA" }, { "stp", 3, "application/STEP" }, @@ -693,8 +696,18 @@ style_footer(); #endif }else{ - cgi_set_content_type(zMime); - cgi_set_content(&filebody); + zMime = mimetype_from_content(&filebody); + if(zMime == 0) { + style_header("Documentation"); + @ <blockquote><pre> + @ %h(blob_str(&filebody)) + @ </pre></blockquote> + style_footer(); + } + else { + cgi_set_content_type(zMime); + cgi_set_content(&filebody); + } } if( nMiss>=ArraySize(azSuffix) ) cgi_set_status(404, "Not Found"); db_end_transaction(0);
_______________________________________________ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users