Help:Wiki

From wiki
Revision as of 20:39, 25 November 2020 by Hdridder (talk | contribs) (→‎CirrusSearch)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Generic

Wiki formatting setting not to forget: Check Mediawiki advanced editing [1] for more.

<syntaxhighlight lang='bash'>
</syntaxhighlight>
Block of code formatted for the specified language
<nowiki>
</nowiki>
Do not apply wiki formatting on this block
; Definition list term (<dt>)
: Definition list definition or just indent(<dd>)
:: Indent more
* Bullit list
  • Bullit list
# Numbered list
  1. Numbered list
[[category:name]]
Add this page to category 'name'
[[wikipage|alt text]]
Link to page on local wiki. When provided 'alt text' is displayed instead of the page name.
[[wikipage#Anchor|alt text]]
Link to anchor on local wiki page. Headings, span and div's are automatic anchors.
<span id=Anchor1></span>
<div id=Anchor1></div>
=Heading=
Create anchor (works for each heading level)
[URL text]
Link to URL. When text is not provided the link's consecutive number is displayed.
''italics''
'''bold'''
'''''bold italics'''''
<code>Fixed width text</code>


Tables

{| table start, required
|+ table caption, optional; only between table start and table row
|- table row, optional on first row—wiki engine assumes the first row
! table header cell, optional. Consecutive table header cells may be added on same line separated by double marks (!!) or start on new lines, each with its own single mark (!).
| table data cell, optional.> Consecutive table data cells may be added on same line separated by double marks (||) or start on new lines, each with its own single mark (|).
|} table end, required

Template:

{| class="wikitable" style="width:60%"
|+ Caption
! Header
! Header
|-
| Content
| Content
|}

Caption
Header Header
Content Content

Formula's

For formula rendering by the Math extension check these examples

Embedded file (images)

[[file:RadioSpectrum.jpeg|400x1107px]]. See the MediaWiki documentation.

Add icons to the footer

Add following to LocalSettings.php

$wgFooterIcons['poweredby']['ipv6ready'] = [
        "src" => "https://ipv6-test.com/button-ipv6-small.png",
        "url" => "https://ipv6-test.com/validate.php?url=$wgServer",
        "alt" => "ipv6 ready",
        "height" => "31",
        "width" => "88",
];

src can be a local file too. More information on the Mediawiki site.

Toolbar editing

Edit the sidebar (not the Tools section there).
Like editing a wikipage, goto //yourwikiurl/index.php?title=MediaWiki:Sidebar
Syntax is a bit different, e.g. no [[]] for links
More info on the MediaWiki manual

Delete page history

20180817 BEWARE, yet untested

  1. Prodecure found here [2] that just invokes in the maintenance subdirectory # php deleteOldRevisions.php --delete
  2. A more complex suggestion
  3. This page advises to go to Special:Nuke, which does not exist on my wiki.

Installations and upgrades

Upgrade

  • Download and extract mediawiki and your extenstions tar-files
  • Run php ./maintenantce/upgrade.php
  • Link your web-root to the new release
  • Rename the old directory to xxx_old to make sure nothing is fetched from any cache (I have to do this despite removing browser history and nginx restarts)

CirrusSearch

Search extension that supports more complex search phrases.

For installation on mediawiki 1.34:

  • Install java8 and elasticsearch 6.5.4
    • apt-get install openjdk-8-jre-headless
    • cd /opt;tar xzvf <location of elasticsaerch tar-file>
    • As user elasticsearch:/opt/elasticsearch/bin/elasticsearch -d
  • Install the Elastica and CirrusSearch mediawiki extensions [3]
  • Follow instructions in ./extentions/CirrusSearch/README
    • Add this to LocalSettings.php
wfLoadExtension( 'Elastica' );
wfLoadExtension( 'CirrusSearch' );
$wgDisableSearchUpdate = true;
  • php7.4 /.extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php
  • Remove $wgDisableSearchUpdate = true from LocalSettings.php
  • php7.4 ./extensions/CirrusSearch/maintenance/forceSearchIndex.php --skipLinks --indexOnSkip
  • php7.4 ./extensions/CirrusSearch/maintenance/forceSearchIndex.php --skipParse
  • Edit LocalSettings.php to have $wgSearchType = 'CirrusSearch';

Check Special:Version to see if all is installed

To verify CirrusSearch is used add '&cirrusDumpQuery' to a search URL. A json-string will be shown.

For automatic start/stop I created /etc/init.d/elasticsearch like

#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides:          elasticsearch
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start ElastichSearch deamon
# Description:       Start ElastichSearch deamon
#                    This script starts a
#                    single forking daemon capable of writing a pid
#                    file.  
### END INIT INFO

# Author: Hans de Ridder <hans@deridder.it>
#

if [ `id -nu` != 'elasticsearch' ]
then
 su elasticsearch $0 $*
 exit
fi 

DESC="ElasticSearch engine"
DAEMON="/opt/elasticsearch/bin/elasticsearch"
DAEMON_ARGS="-d"

Now you can start by service elasticsearch start. Stopping is not implemented in this script.

In /etc/rc5.d do ln -s ../init.d/elasticsearch S02elasticsearch