Extension:HeaderSections
![]() リリースの状態: 安定 |
|
---|---|
実装 | ユーザー インターフェイス, 外装 |
説明 | A MediaWiki extension that adds a CSS class to the section of content below a header. |
作者 | Derf Jaggedトーク |
最新バージョン | 1.0 (2022-12-30) |
MediaWiki | 1.25+ |
PHP | 5.5+ |
データベースの変更 | いいえ |
ライセンス | MIT ライセンス |
ダウンロード | |
例 | ConsoleMods.org |
HeaderSections is a MediaWiki extension that adds a CSS class to the section of content below a header. This effectively allows for CSS styling to be applied to sections such as different background colors or indent levels for H2 and H3 sections or to target a certain section type using your own custom JavaScript. This extension is based on the HideSection extension.
This extension tags sections hierarchically, meaning a nested element under multiple parent headers will have current section tag (e.g. H3-section) and all parent section tags (e.g. H1-section and H2-section).
For reporting an issue or a bug, please open a GithHub issue.
Installation
Requires MediaWiki 1.25 or higher for wfLoadExtension registration.
- Downloadして、ファイルを
extensions/
フォルダー内のHeaderSections
という名前のディレクトリ内に配置します。 - 以下のコードを LocalSettings.php ファイルの末尾に追加します:
wfLoadExtension( 'HeaderSections' );
完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
Configuration
ext.headersections.css - Edit contents of stylesheet as desired.
Your CSS rules in ext.headersections.css needs to be in the proper order so that the higher numbered section rules (H4) take precedence over the lower-numbered section rules (H3).
Default configuration is set to indent each section following a header by an increasing amount using these CSS classes:
.H1-section .H2-section .H3-section .H4-section .H5-section .H6-section