Extension:JsCalendar
JsCalendar Release status: beta |
|
---|---|
Implementation | Parser extension |
Description | Provides <EventCalendar> tag that shows a JavaScript-based calendar with event pages |
Author(s) | Edward Chernenko, Steffen Beyer |
Latest version | 0.3.1 |
Compatibility policy | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | 1.35 (master branch) 1.34 (REL_34 branch) |
Database changes | No |
License | GNU General Public License 2.0 or later |
Download | GitHub: |
The JsCalendar extension is based on YASEC extension (by Steffen Beyer). It additionally supports coloring (based on category or keywords), showing HTML snippets of event pages, finding event pages by regex, etc. However, unlike YASEC, it only supports MySQL/MariaDB. (PostgreSQL is not supported. Patches are welcome)
Usage
editThe following syntax will find all pages with names like Today_in_History/April,_12
and display a calendar of these events:
<EventCalendar> prefix = Today_in_History/ suffix = dateFormat = F_j </EventCalendar>
The value of dateFormat
parameter is explained here: https://www.php.net/datetime.createfromformat#refsect1-datetime.createfromformat-parameters
The following syntax will find pages like 2020/05/15_Name_of_some_event
and display a calendar:
<EventCalendar> titleRegex = ^([0-9]{4,4}/[0-9][0-9]/[0-9][0-9])_.* dateFormat = Y/m/d </EventCalendar>
By default, pages in main namespace (articles) are shown. To use another namespace, use namespace=
parameter, for example (to find pages like "Template:04-13/WhatHappened"):
<EventCalendar> namespace = Template prefix = suffix = /WhatHappened dateFormat = m-j </EventCalendar>
Events can be colored based on the category they are in. For example,
categorycolor.Cat-related events = red categorycolor.Dogs = green
Events can be colored based on presence of some keyword within their wikitext. For example,
keywordcolor.arctic = yellow keywordcolor.statistically = lightgreen
Instead of the page name, a HTML snippet of the first N symbols can be shown for each event page. To enable, use the following parameter:
symbols = 500
Please see README.md for more details/examples.
Installation
editFor modern versions of MediaWiki (1.35+), use the following instruction:
- Check-out the sources with
git clone https://github.com/edwardspec/mediawiki-extension-JsCalendar.git
and place the file(s) in a directory calledJsCalendar
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'JsCalendar' );
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Installation for older versions of MediaWiki
editFor MediaWiki 1.34, replace the above-mentioned "git clone" command with the following:
git clone -b REL1_34 https://github.com/edwardspec/mediawiki-extension-JsCalendar.git
These versions may still receive security fixes (if any), but not new features.
Alternatives
editPlease see Calendars for the list of other calendar extensions.
This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |