Extension:Calendar-Wikivoyage

From Linux Web Expert

Revision as of 02:30, 17 June 2023 by imported>Legobot (Migrating {{Used by}} data to Module:Used by/data.json)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MediaWiki extensions manual
Calendar-Wikivoyage
Release status: stable
Implementation Parser function
Description Creates a table showing the monthly calendar.
Author(s) Roland Unger
Latest version 1.1
MediaWiki 1.32+
License GNU General Public License 2.0 or later
Download
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Translate the Calendar-Wikivoyage extension if it is available at translatewiki.net

Calendar is an extension that creates a Calendar in pages. This extension was originally from the old Wikivoyage project.

Download

<translate> The extension can be retrieved directly from Git</translate> [?]:

  • <translate> Browse code</translate>
  • <translate> Some extensions have tags for stable releases.</translate>
  • <translate> Each branch is associated with a past MediaWiki release.</translate> <translate> There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).</translate>

<translate> Extract the snapshot and place it in the <tvar name=name>extensions/Calendar/</tvar> directory of your MediaWiki installation.

If you are familiar with Git and have shell access to your server, you can also obtain the extension as follows: </translate>

cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Calendar.git Calendar

Installation

  • <translate> <tvar name=1>Download</tvar> and place the file(s) in a directory called <tvar name=name>Calendar</tvar> in your <tvar name=ext>extensions/</tvar> folder.</translate>
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'Calendar' );
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Usage

The Calendar extension implements the following functions:

  • calendar: Creates a table showing the monthly calendar.
  • Example for application:
{{#calendar: 
 | title= Table header. Instead of a missing title the month and year are shown.
 | prevLink= Text or link with the meaning of "previous". The text can contain place-holders.
 | nextLink= Text or link with the meaning of "next". The text can contain place-holders.
 | month= month to show. Possible values are 1 through 12. A missing month is substituted by the current month.
 | year= year to show. A missing year is substituted by the current year.
         Possible values are between 1970 and 2038.
 | offset= offset to the given month/year in months.
 | lang= Language of days and months names. Supported language codes are 'user' (user language) or
         'content' (content language; default).
 | highlightedDays= Highlighted days in addition to the current day. Values are separated by spaces.
 | start= first day of week. Possible values are 0 (Sundays) and 1 (Mondays).
 | position= defines additional floating. Possible values are (nothing), left, right and center
         (case insensitive)
 | 1= to 31= For every day a link can be specified
 | titleLink= Link to the title. The link can contain place-holders. Do not use link parentheses.
 | generalLinks= Identical links to all days. The links can contain place-holders. Do not use link parentheses.
         generalLinks is overwritten by the options 1= to 31=
 | dayCharsCount= maximum numbers of characters for weekday names 
 | monthCharsCount= maximum numbers of characters for month names
 | tableWidth= width of the table. 'none' means no definition, 'default' the default width of 20em
         You can also specify other CSS values like 50%, 300px or 30em.
 | showToday= specify the highlightings of the today's day. 'true' is default.
         'false' prevents highlighting
}}
  • Place-holders for links:
$a - abbreviated weekday name
$A - full weekday name
$b - abbreviated month name
$B - full month name
$d - day of the month, range 01 to 31
$D - day of the month, range 1 to 31
$e - day of the month, range ' 1' to '31'
$m - month as a decimal number, range 01 to 12
$M - next month as a decimal number, range 01 to 12
$n - abbreviated month name of the next month
$N - full month name of the next month
$o - year of the next month as a decimal number without a century, range 00 to 99
$O - year of the next month as a decimal number including the century
$p - abbreviated month name of the previous month
$P - full month name of the previous month
$q - year of the previous month as a decimal number without a century, range 00 to 99
$Q - year of the previous month as a decimal number including the century
$R - previous month as a decimal number, range 01 to 12
$y - year as a decimal number without a century, range 00 to 99
$Y - year as a decimal number including the century
$% - Dollar sign (use it if necessary)

Used style classes

{{#calendar:|position=Right|start=1|lang=user|highlightedDays=1 9 17}} In the Calendar directory you will find the file Calendar.css. It can be overwritten in Common.css or Monobook.css.

  • class="calendar" -- for the table as a whole
  • class="calLeft" -- left floating
  • class="calRight" -- right floating
  • class="prevNext" -- for previous and next links
  • class="calTitle" -- for the table header
  • class="sundays" -- highlighting for sundays
  • class="today" -- highlighting for the date of today
  • class="highlighted" -- additional highlighted dates

Known Problems

It is not possible to convert non-ASCII characters in month names to upper case characters. ucfirst() works only with ASCII characters but not with other Unicode characters.

This message box is using an invalid "type=parser function" parameter and needs fixing.