Mediawiki: Difference between revisions

From 太極
Jump to navigation Jump to search
Line 61: Line 61:


== Color format ==
== Color format ==
<pre>
<span style="color: red">
<span style="color: red">
Text is red.
Text is red.
</span>
</span>
</pre>


== Create tables ==
== Create tables ==

Revision as of 14:58, 3 September 2015

Help resources

Cheatsheet

Wikipedia.org

Install mediawiki on ubuntu

http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Debian_GNU/Linux

Check requirement

php -v
mysql -V  # capital V

Enable tex for formula

1. The following line is coming from an earlier bookmarked tutorial (not sure if it is needed anymore)

apt-get install mediawiki-math

2. Download Math extension from this link

3. Then you should extract the archive in the "extensions" folder within your MediaWiki installation directory.

4. Next, you need to add the following line to your LocalSettings.php file:

require_once("$IP/extensions/Math/Math.php");

5. Install texvc and ocaml

sudo apt-get install ocaml
cd extensions/Math/math
make

6. The next step is to execute the "maintenance/update.php" script via shell:

php maintenance/update.php  

Done. Go to test it. [Tested on mediawiki 1.22 on Ubuntu 12.04]. Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Install mediawiki on debian

Link here [1]

Preformatted text with text wrap

Search 'Customized preformatted' on the Formatting page.

<pre style="white-space: pre-wrap; /* CSS 3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* IE 5.5+ */ " > YOUR TEXT </pre>

Color format

<span style="color: red">
Text is red.
</span>

Create tables

Introduction Introduction Installation Installation Packages and Repositories Packages and
Repositories
File Managers File Managers
Desktop Add-ons Desktop Add-ons Virtual Machines Virtual Machines Games and Entertainment Games and
Entertainment
Internet Internet

Auto timeout

See mediawiki.org. On ubuntu, change /etc/php5/apache2/php.ini.

"session.cahce_expire=180".

"session.gc_maxlifetime = 1440"

Colored font

https://meta.wikimedia.org/wiki/Wiki_color_formatting_help

<span style="color: red"> ..... </span>

Syntax highlight

Use the "syntaxhighlight" (for newer versions of mediawiki) or source (for older versions) tag for inline/non-inline syntax highlight. For example,

library(d3Network)

Source <- c("A", "A", "A", "A", "B", "B", "C", "C", "D") 
Target <- c("B", "C", "D", "J", "E", "F", "G", "H", "I") 
NetworkData <- data.frame(Source, Target) 

d3SimpleNetwork(NetworkData, height = 800, width = 1024, file="tmp.html")

can be created by

<source lang="rsplus">
library(d3Network)

Source <- c("A", "A", "A", "A", "B", "B", "C", "C", "D") 
Target <- c("B", "C", "D", "J", "E", "F", "G", "H", "I") 
NetworkData <- data.frame(Source, Target) 

d3SimpleNetwork(NetworkData, height = 800, width = 1024, file="tmp.html")
</source>

Note for some reason, when I use the syntaxhighlight tag (use syntaxhighlight instead of source tag), 'r' is not recognized on my mediawiki 1.22 although 'bash' works.

favicon

Move favicon.ico to the mediawiki folder and include the following line in the <LocalSettings.php>

$wgFavicon = "$wgScriptPath/favicon.ico";

Note that the attribute of the ico file has to be at least 644. If not, just run the following line

chmod 644 favicon.ico

To download a favicon, use the approach here. For example, to download the favicon icon from https://wiki.ubuntu.com/ website, we just open the url https://wiki.ubuntu.com/favicon.ico.

The approach works is based on the assumption that the favicon.ico file name is not changed and usually located under the website root directory.

Change user's password

https://www.mediawiki.org/wiki/Manual:Resetting_passwords

Extensions

Google Analytics

http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration#Installation

Math

http://www.mediawiki.org/wiki/Extension:Math