Page 1 of 1

Math in the Wiki

PostPosted: 04 Jul 2010, 00:47
by svenskmand
For some reason the LaTeX "math" tag does not work in the wiki, even though the "math" button is in the toolbox on the top when you edit a page. See for example the sandbox page, where I have tried tested the math in the wiki.

Xapantu: do you know what is wrong since the math tag is not working? Is it not installed even though the LaTeX-tool-button is available in the edit toolbox?

Re: Math in the Wiki

PostPosted: 04 Jul 2010, 14:16
by xapantu
Yes, I know the problem : http://www.mediawiki.org/wiki/Manual:Math The math extension isn't enabled. We have to compile it but... http://www.mediawiki.org/wiki/Manual:Enable_TeX it requires OCalm and :
{l Code}: {l Select All Code}
xapantu@shell-22009 htdocs]$ cd math/
[xapantu@shell-22009 math]$ ls
Makefile  html.mli    parser.mly       texutil.ml    texvc_test.ml
README    lexer.mll   render.ml        texutil.mli   texvc_tex.ml
TODO      mathml.ml   render_info.mli  texvc.ml      util.ml
html.ml   mathml.mli  tex.mli          texvc_cgi.ml
[xapantu@shell-22009 math]$ make
ocamlopt -c util.ml
make: ocamlopt: Command not found
make: *** [util.cmx] Error 127
[xapantu@shell-22009 math]$

There isn't ocalm on sourceforge...


So, do you really want this plugin :( ? I know it would be cool but it is so complicated...

Re: Math in the Wiki

PostPosted: 04 Jul 2010, 17:24
by svenskmand
Right now I was needing it for describing the math of the alignment system, which Keldaryth come up with, I really think it can be described much more concise by using mathematical notation. The current description of it is very long and cumbersome, the wiki-math would really help.

Also I think that this is not the only places where it would really help, there is surely going to be many more places as we make more game mechanics. So if you can make it work, and have the time, then I would very much like to have it working :)

Re: Math in the Wiki

PostPosted: 05 Jul 2010, 19:29
by andrewbuck
It would be but the since the notation required for the faction calculations is so simple the LaTeX math engine would be overkill. It is quite a bit of work since several things and possibly some libraries would need to be hand built on the sourceforge server without root access (which means it is more difficult since you can't install libraries to the standard places where your other stuff looks for them). If we can do without that would be best.

-Buck

Re: Math in the Wiki

PostPosted: 05 Jul 2010, 23:52
by svenskmand
I do not think that it would be overkill for the alignment calculations, and I do not think that Keldaryths explanation about the system is simple. But using LaTeX to described the system would really make it nice and easy to understand.

Right now I cannot think of other places where we surely will need math, but then again we have not really consider many different game mechanics. If xapantu or andrew wants to give the install a try I bid it very welcome, but it is ultimately up to you guys.

Edit: This might be the solution, it says it is easy to do, and does not require installation of LaTeX :) The first section is the one, it should be easy to do :)

Also if we want to install LaTeX so we do not depend on other services, then we should probably ask Sourceforge about how they normally enable LaTeX math in Mediawiki (surely many other projects use it).

Edit^2: Probably a much more stable LaTeX rendering service is using Google Chart, I think this is the easiest way to get stable LaTeX rendering :)

Edit^3: The Google Chart option is very fast and very flexible :) you can change the background and text color, and the background can have different levels of transparency :)

So a RGB 192 192 192 gray text color on a darkred RGBA 64 0 0 64 background would be this line
"http://chart.apis.google.com/chart?cht=tx&chf=bg,s,40000080&chco=C0C0C0&chl=\sum_{i=1}^n{\frac{1}{i}}"

And a normal RGB 0 0 0 black text color on a white RGBQ 255 255 255 255 would be this line
"http://chart.apis.google.com/chart?cht=tx&chf=bg,s,FFFFFFFF&chco=000000&chl=\sum_{i=1}^n{\frac{1}{i}}"

Re: Math in the Wiki

PostPosted: 06 Jul 2010, 09:56
by svenskmand
I think we should try the solution I posted in Edit^3, that should be pretty easy to do, it does not require LaTeX at all as it uses Google Chart (and there is no limit on the number of API calls you make a day) which is very cool :) and the best thing is that there is nothing to install, you only have to edit two files :)

Both solution 1 and 2, in the link, is equally easy, but I think solution 2 is better as it uses the normal math tag and not the m tag as solution 1 uses.

Xapantu: could you try this? Thanks :)

Re: Math in the Wiki

PostPosted: 07 Jul 2010, 11:11
by svenskmand
Xapantu: could you try solution 2 in this link? You only have to add one line of code and that is it, then it should work.

Re: Math in the Wiki

PostPosted: 07 Jul 2010, 11:18
by xapantu
Sorry for my late reply.... I am going to try now...

Re: Math in the Wiki

PostPosted: 07 Jul 2010, 11:22
by xapantu
andrewbuck ! :)
You are the proprietary of include/Math.php, I can't edit it....

Re: Math in the Wiki

PostPosted: 07 Jul 2010, 15:28
by andrewbuck
That seemed to work. The math on the Sandbox page now works correctly. Regarding the access to the files, since you own some and I own some, I am thinking we should make everything group writable. For example

{l Code}: {l Select All Code}
chmod -R g+w /home/groups/o/op/opendungeons/htdocs


We will both have to run this command since we will only be able to change permissions on the files we own, but that should allow either of us to work on the project, or any other OD admins for that matter. I have not run this command yet, I wanted to ask if you thought it would be safe to do before I do it. My concern is that maybe there are a few files that should not be group writable, but I can't think of any offhand. If you think it would be a good idea to do this then let me know and we can then both run the command.

-Buck

Re: Math in the Wiki

PostPosted: 07 Jul 2010, 23:57
by svenskmand
All files in subdirectories in /home/groups/o/op/opendungeons/htdocs still has permissions -rw-r--r-- could you change that also?

Re: Math in the Wiki

PostPosted: 08 Jul 2010, 00:53
by andrewbuck
That is exactly what we are talking about changing. I don't want to do that though until xapantu says it's ok and that it won't break something security wise. I don't think it will I would just like a second opinion since once it is done it is much more difficult to undo. Also, some of the files are owned by him and some by me, so we will each need to do the permissions on the files we own.

-Buck

Re: Math in the Wiki

PostPosted: 08 Jul 2010, 08:49
by xapantu
It is ok for me, I will do that asap.

Re: Math in the Wiki

PostPosted: 08 Jul 2010, 14:18
by andrewbuck
Xapantu, it looks like you set everything to 777, at least the stuff in the root of the htdocs directory. The command I gave above adds write permissions for the group but leaves everything else untouched. Setting it to 777 is a huge security risk since the "others" group includes the webserver, so it may allow people to see files they shouldn't, especially if there is a bug in the webserver sourceforge runs.

It doesn't look like you applied the -R flag so you only changed the things in the htdocs directory, not any of the subfolders. Please execute the command above exactly as it is. Also the LocalSettings.php file should have more locked down permissions on it. This page says LocalSettings.php should be 700 but I'm not sure if that will work or not since the webserver needs to read it. It should be as locked down as possible though as it contains sensitive information.

EDIT: Also, I have run the command from my side so once you run that and reset the perms on LocalSetiings we should be good.

-Buck

Re: Math in the Wiki

PostPosted: 08 Jul 2010, 15:18
by svenskmand
If xapantu is the only one that can set the permissions does that not mean that he is the owner of the files? Why not just chown the files so the group opendungeons is the owner and anybody in it can change all the permissions they want on the files? It seems a more practical way, than having everybody who have created files change permissions on files that they forgot to set the right ones on?

I mean why not do this?
{l Code}: {l Select All Code}
chown -R :opendungeons /home/groups/o/op/opendungeons/htdocs

Re: Math in the Wiki

PostPosted: 08 Jul 2010, 15:47
by andrewbuck
They are group opendungeons already, however only the owner can change permissions and there is no way around this.

-Buck

Re: Math in the Wiki

PostPosted: 08 Jul 2010, 15:55
by svenskmand
Hmmm, that is pretty lame :(