Difference between revisions of "Mediawiki"

From Steak Wiki
Jump to navigationJump to search
Line 46: Line 46:
 
Something like the following should be added to LocalSettings.php (the mediawiki customization page):
 
Something like the following should be added to LocalSettings.php (the mediawiki customization page):
  
{{cat|Localsettings.php|
+
 
wfLoadExtension( 'Scribunto' );
+
wfLoadExtension( 'Scribunto' );
$wgScribuntoDefaultEngine = 'luastandalone';
+
$wgScribuntoDefaultEngine = 'luastandalone';
}}
 
  
 
===Common.css===
 
===Common.css===

Revision as of 03:58, 23 May 2020

Mediawiki is what this site is. It's great. Much easier to digest information than a blog.

Mediawiki Docker Setup

todo

Mediawiki Navbox Setup

All mediawiki's should use the navbox. They are not in the default install though. So, hoops must be jumped through (job security for mediawiki admins...?). I will do my best to document this, and my steps should help anyone implementing this, however I can't confirm this will be 100% of what you need. However, it should get you most of the way there.

Roadmap

To install navbox we need to do the following:

  • Install Scribunto Extension, and get Lua enabled
  • Add some Module and Template pages to the custom wiki (Modules: Navbox,Arguments,Navbar and Template:Navbox)
  • LocalSettings.php of the mediawiki must have the scribuntu extension enabled
  • You must add a new Common.css file. It is placed in Mediawiki:Common.css (only admins can add this)

Install Scribunto

See https://www.mediawiki.org/wiki/Extension:Scribunto Straightforward. If you have docker, you'll have to make a volume for the extensions, something like the following in your docker-compose.yml:

 volumes:
      - ./mwiki_files/images/:/var/www/html/images
      # After initial setup, download LocalSettings.php to the same directory as
      # this yaml and uncomment the following line and use compose to restart
      # the mediawiki service
      # Note that it will create this file for you from the web setup.
      - ./mwiki_files/LocalSettings.php:/var/www/html/LocalSettings.php
      - ./mwiki_files/log/:/var/log/apache2/
      - ./mwiki_files/etc_apache/:/etc/apache2/
      # need extensions to add scribuntu to get modules to get navbox to work. ugh.
      - ./mwiki_files/extensions/:/var/www/html/extensions/
      - ./mwiki_files/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini

Add some Module and Template pages

You need to copy and paste these from mediawiki.

   Template:Navbox
   Module:Arguments
   Module:Navbar
   Module:Navbox

And put them in the same pages on your wiki.

Some other templates that are useful:

Template:Cmd
Template:Cat
Template:Box

These may be on other wikis, e.g. gnu\linux wikis.

LocalSettings.php

Something like the following should be added to LocalSettings.php (the mediawiki customization page):


wfLoadExtension( 'Scribunto' );
$wgScribuntoDefaultEngine = 'luastandalone';

Common.css

Go to https://en.wikipedia.org/wiki/MediaWiki:Common.css copy the source code, and then upload that to your own wiki at the same page (Mediawiki:Common.css).

You will need to be an interface admin. You will find out this if it says Permission denied on the Mediawiki:Common.css page.

Example Template

You can copy these from anywhere, but look at one of mine to get an example of how it's formatted. e.g. Template:GNU\Linux. Embed them in the site with 2x curly braces instead of brackets, and omit the Template part. So it would be "curly brace, curly brace, GNU\Linux, curly brace, curly brace. Again, examples are everywhere online.

White Space Counts in Navbox

Be careful of this. No spaces allowed between the end of Xilinx, and the start of * FPGA. Or else the formatting will break.

 | group3 = FPGAs
 | list3  =
 * [[Xilinx]]
* [[FPGA - Rotary Encoder]]
 | group3 = FPGAs
 | list3  =
 * [[Xilinx]]
 * [[FPGA - Rotary Encoder]]

Further Reading

The Talk Archives of Navbox can be stepped through (there are maybe 30-40 now, so sit down, and allocate some time) to find where I figured this out from.

End result is below: