Jump to content

Extension:InlineComments

From mediawiki.org
MediaWiki extensions manual
InlineComments
Release status: stable
Implementation ContentHandler
Description Allows adding inline comments to pages
Author(s)
Latest version 1.0
Compatibility policy For every MediaWiki release that is a Long Term Support release there is a corresponding branch in the extension.
MediaWiki >= 1.39.0
License GNU General Public License 2.0 or later
Download
README
  • $wgInlineCommentsAutoDeleteComments
  • $wgInlineCommentsNamespaces
  • inlinecomments-add
  • inlinecomments-edit-all
  • inlinecomments-view
Quarterly downloads 15 (Ranked 116th)
Translate the InlineComments extension if it is available at translatewiki.net

The InlineComments extension adds the ability for viewers to add inline comments to a page, similar to inline comments in Confluence or annotations in tools like Google Docs.

Usage

To attach a comment to specific text, first highlight the text you want to attach the comment to. A "+" icon will then appear. If you click on it, or use the keyboard shortcut Ctrl+Alt+m, a comment entry form will appear on the side. Fill out the text area and hit "Save" to record your comment.

Once a comment is made, anyone can reply to it by hitting the "Reply" button and adding more text. A thread within InlineComments can grow to any length.

Comments can be edited by the author or the administrator by hitting the pencil icon on the right side of the comment.

You can also delete a thread (which can include one or more comments) by hitting the "Close discussion" button. This will delete all of that text from the InlineComments "slot" of the page. Since this deletion shows up in the page history, you can undo it any time, and restore the thread, simply by undoing that edit.

Users can be mentioned in the comments by using the "@" annotator.

If the Echo extension is installed:

  • Mentioning a user in an inline comment will trigger an echo notification to that user.
  • The comment thread creator will also get notified on any replies or the closure of the thread.

All inline comments are assigned with the "inlinecomments" tag, so that the changes can be easily filtered by tag in Special:RecentChanges and Special:Watchlist.

See also the screenshots below.

Download

You can download the InlineComments code, in .zip format, here.

You can also download the code directly via Git from the MediaWiki source code repository. From a command line, call the following:

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

To view the code online, including version history for each file, go here:

view InlineComments code

Installation

  • Download and move the extracted InlineComments folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/InlineComments
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'InlineComments' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

The following settings can be added to LocalSettings.php:

$wgInlineCommentsAutoDeleteComments
Whether or not to automatically remove comments if the text they are commenting on gets deleted (default true)
$wgInlineCommentsNamespaces
The only namespaces for which InlineComments should be enabled. By default, it is set to $wgContentNamespaces. If set explicitly to an array of some namespaces, $wgContentNamespaces will not be included unless the user adds it in LocalSettings.php

InlineComments defines the following user rights:

inlinecomments-add
Whether you can add and delete comments on a page. By default this is given to all logged in users.
inlinecomments-view
Whether inline comments are shown to you. Please note, this controls the default interface but users may still be able to view existing comments by other means if the have 'read' rights on the wiki, such as through the history page or API.
inlinecomments-edit-all
Whether you can edit all inline comments on a page. By default this is given to sysop users.

Screenshots

Video demo

Version history

  • 0.1 - April 29, 2023 - Initial version
  • 0.2 - February 27, 2024 - Look-and-feel improvements, many bug fixes
  • 0.3 - April 11, 2024 - Renamed $wgInlineCommentsAutoResolveComments setting to $wgInlineCommentsAutoDeleteComments; renamed "Mark resolved" to "Close discussion"; added "inlinecomments-view" permission; added timestamp display on comment creation
  • 1.0 - August 21, 2024 - Added user mentions along with autocompletion; added edit functionality to comments; added $wgInlineCommentsNamespaces setting; overrode JSON diff with custom diff for comment edits; made the sidebar skin-neutral; added "inlinecomments" tag for all comment edits; fixed permission issues for view and edit rights of logged out users, blocked users and hidden users; added Echo notification for the comment initiator on reply and close action; added Echo notification for the mentioned user

See also