Contents |
./configure --prefix=$HOME/local --without-perl --without-magick-plus-plus --disable-openmp
failed with error code "Specified key was too long"which happened before. I guess this is because I'm using utf8[1].
./configure -prefix ~/fresh-ocamlYou also should call the following, to build ocamlopt.
make world; make opt; make install
Error : Failed to parse (Can't write to or create math output directory)
let cmd_dvips tmpprefix = "dvips -R -E " ^ tmpprefix ^ ".dvi -f >" ^ tmpprefix ^ ".ps"
let cmd_latex tmpprefix = "latex " ^ tmpprefix ^ ".tex >/dev/null"
let cmd_convert tmpprefix finalpath = "convert -quality 100 -density 120 " ^ tmpprefix ^ ".ps " ^ finalpath ^ " >/dev/null 2>/dev/null"
let cmd_dvipng tmpprefix finalpath = "/free/home/bluebrown/local/bin/dvipng -quality 100 -density 120 -T tight " ^ tmpprefix ^ ".dvi -o " ^ finalpath ^ " >/dev/null 2>/dev/null"
exception ExternalCommandFailure of string
let render tmppath finalpath outtex md5 =
let tmpprefix0 = (string_of_int (Unix.getpid ()))^"_"^md5 in
let tmpprefix = (tmppath^"/"^tmpprefix0) in
let unlink_all () =
begin
(* Commenting this block out will aid in debugging *)
Sys.remove (tmpprefix ^ ".dvi");
Sys.remove (tmpprefix ^ ".aux");
Sys.remove (tmpprefix ^ ".log");
Sys.remove (tmpprefix ^ ".tex");
Sys.remove (tmpprefix ^ ".ps");
end in
let f = (Util.open_out_unless_exists (tmpprefix ^ ".tex")) in
begin
output_string f (Texutil.get_preface ());
output_string f outtex;
output_string f (Texutil.get_footer ());
close_out f;
if Util.run_in_other_directory tmppath (cmd_latex tmpprefix0) != 0
then (unlink_all (); raise (ExternalCommandFailure "latex"))
else if (Sys.command (cmd_dvipng tmpprefix (finalpath^"/"^md5^".png")) != 0)
then (unlink_all (); raise (ExternalCommandFailure "dvipng"))
else unlink_all ()
end
This is a nice extension to present formatted source code, which is called GeSHiCodeTag [4]. Actually, there are many extensions using GeShi[5], but most of them supports only higher version than mine. When you are using php4 and hense using Mediawiki version less than 1.7, you should pick this. To use this package, you also have to download GeSHi, too. Put both of them in the extension file. Oh, and you should put the following tag after $wgSiteName. When I put it next to require_once lists, it didn't work.
## GeSHiCodeTag extension
include("extensions/GeshiCodeTag.php");
This is a tricky one. It's pretty easy to restrict editing from an anonymous user[6], but it's hard to restrict viewing particular pages from an anonymous user. Actually, there is a nice extension called Oversight[7], but it only supports Mediawiki version 10 or higher. But I found some hack, using userCan hook (Note that this is only available version 6 or higher). Although you have to modify LocalSettings.php everytime you want to change the restriction, it works. pretty well.[8]
function user_restriction($title, $user, $action, $result) {
if ($action == 'read') {
if (!$user->isLoggedIn() && $title->getText() == 'Hierarchical Motion Controller') {
$result = false;
}
}
}
$wgHooks['userCan'][] = 'user_restriction';