Extension:Link Attributes

This page is a translated version of the page Extension:Link Attributes and the translation is 44% complete.
警告 警告: This extension is often confused with the similarly named Extension:LinkAttributes.
MediaWiki 拡張機能マニュアル
Link Attributes
リリースの状態: 安定
実装 パーサー関数
説明 Adds support for the rel, rev and class attributes on links
作者 Toby Inkster, Dennis Roczek, Sam Wilson
最新バージョン 1.1
MediaWiki >= 1.35.0
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
Quarterly downloads 4 (Ranked 140th)
translatewiki.net で翻訳を利用できる場合は、Link Attributes 拡張機能の翻訳にご協力ください

This extension adds support for the rel, rev and class attributes on external links:

  • relThe relationship of the linked URL as space-separated link types.
  • revSpecified a reverse link; the opposite of the rel attribute. Deprecated for being very confusing.
  • class – A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements.

使用法

The syntax is a little unorthodox. To set the rel attribute, place one or more tokens in double-parentheses at the end of the link title. e.g.:

  [http://tobyinkster.co.uk/ My website((me home))]

The above would be converted to the following link:

  <a href="http://tobyinkster.co.uk/" rel="me home" class="external">My website</a>

To set the class attribute, the same syntax is used, but tokens which represent classes are prefixed with a dot:

  [http://tobyinkster.co.uk/ My website((me .class1 home .class2))]

Becomes:

  <a href="http://tobyinkster.co.uk/" rel="me home" class="external class1 class2">My website</a>

Similarly, prefixing with a tilde (~) sets the rev attribute.

Tokens may be prefixed by a minus sign (-) to indicate that you don't want to add the token, but remove it. For example:

  [http://tobyinkster.co.uk/ My website((me -.external home))]

Becomes:

  <a href="http://tobyinkster.co.uk/" rel="me home">My website</a>

The "nofollow" rel token is considered untouchable though.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のLink_Attributesという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Link_Attributes
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'Link_Attributes' );
    
  •   完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

関連項目

  • Extension:LinkAttributes a different syntax for adding the attributes.
  • T35886