跳转到内容

模板:Excerpt/ja

来自天灾之下:危险连接资料站


模板文档

このテンプレートは、ページの一部を他のページで再利用するために使用されます。 この方法にはいくつかの利点があります:

  • メンテナンスを削減 - 複数回更新する必要のある重複コンテンツを回避することで
  • コンテンツの品質を向上 - 編集のさまざまな段階で複数のバージョンを用意するのではなく、編集者に関連するコンテンツの統合を促すことで
  • 共同作業を促進 - 並行して作業するのではなく、貢献者を 1 か所に集めることで

このテンプレートは、組み込みの通常の参照読み込み機能を拡張します。

使用法

基本的な使用法

  • {{Excerpt|Page title}} — 先頭節を参照読み込みする (例)
  • {{Excerpt|Page title|Section title}} — 特定の節から下位の節を除いて参照読み込みする (例)

パラメーター

  • 1 — 参照読み込みするページの名前。 唯一の必須のパラメーターです。 既定では、導入節が参照読み込みされます (例)。
  • 2 — Title of the section to transclude (example) or name of the ‎<section> tag to transclude. Notice that this template provides other ways of targeting specific elements of a page without having to resort to section tags.
  • only — 参照読み込みする要素 (例)。 既定ではすべての要素が参照読み込みされます。
    • only=file または only=files — ファイルのみを参照読み込みする
    • only=list または only=lists — 一覧のみを参照読み込みする
    • only=table または only=tables — 表のみを参照読み込みする
    • only=template または only=templates — テンプレートのみを参照読み込みする
    • only=paragraph または only=paragraphs — 段落のみを参照読み込みする
  • paragraphs — 参照読み込みする段落。 既定ではすべての段落が参照読み込みされます。
    • paragraphs=0 — 段落を参照読み込みしない
    • paragraphs=1 — 最初の段落を参照読み込みする
    • paragraphs=2 — 2 番めの段落を参照読み込みする
    • paragraphs=1,3 — 最初と 3 番めの段落を参照読み込みする
    • paragraphs=1-3 — 最初から 3 番めまでの段落を参照読み込みする
    • paragraphs=1-3,5 — 最初から 3 番めまでと 5 番めの段落を参照読み込みする
    • paragraphs=-1 — 最初以外のすべての段落を参照読み込みする
    • paragraphs=-2 — 2 番め以外のすべての段落を参照読み込みする
    • paragraphs=-1,3 — 最初と 3 番め以外のすべての段落を参照読み込みする
    • paragraphs=-1-3 — 最初から 3 番め以外のすべての段落を参照読み込みする
    • paragraphs=-1-3,5 — 最初から 3 番めまでと 5 番め以外のすべての段落を参照読み込みする
  • lists — 参照読み込みするリスト。 既定ではすべてのリストが参照読み込みされます。 Same syntax as when transcluding paragraphs.
  • files — 参照読み込みするファイル。 既定ではすべてのファイルが参照読み込みされます。 Same syntax as when transcluding paragraphs, but also:
    • files=A.jpg — 「A.jpg」という名前のファイルを参照読み込みする
    • files=A.jpg, B.png, C.gif — 「A.jpg」「B.png」「C.gif」という名前のファイルを参照読み込みする
    • files=.+%.png — すべての PNG ファイルを参照読み込みする
    • files=-A.jpg — 「A.jpg」という名前のファイル以外のすべてのファイルを参照読み込みする
    • files=-A.jpg, B.png, C.gif — 「A.jpg」「B.png」「C.gif」という名前のファイル以外のすべてのファイルを参照読み込みする
    • files=-.+%.png — PNG 以外のファイルをすべて参照読み込みする
  • tables — 参照読み込みする表。 既定ではすべての表が参照読み込みされます。 Same syntax as when transcluding paragraphs, but also:
    • tables=Stats2020 — 「Stats2020」という ID の表を参照読み込みする
    • tables=Stats2020, Stats2019, Stats2018 — 「Stats2020」「Stats2019」「Stats2018」という ID の表を参照読み込みする
    • tables=-Stats2020 — 「Stats2020」という ID の表以外のすべての表を参照読み込みする
    • tables=-Stats2020, Stats2019, Stats2018 — 「Stats2020」「Stats2019」「Stats2018」という ID の表以外のすべての表を参照読み込みする
  • templates — 参照読み込みするテンプレート。 既定ではすべてのテンプレートが参照読み込みされます。 Same syntax as when transcluding paragraphs, but also:
    • templates=Infobox — Transclude the template 'Infobox'
    • templates=Infobox, Navbox, Chart — Transclude the template 'Infobox', 'Navbox' and 'Chart'
    • templates=-Infobox — Transclude all templates except 'Infobox'
    • templates=-Infobox, Navbox, Chart — Transclude all templates except 'Infobox', 'Navbox' and 'Chart'
  • this — Change the initial text of the hatnote. For example, if the transcluded content is a gallery, you can set this=This gallery is so that the hatnote reads "This gallery is an excerpt from..."
  • displaytitle — Change the text of the link in the hatnote. For example to add italics, subscripts, etc.
  • hat=no — Hide the hatnote "This section is an excerpt from..."
  • more=yes — Show a "Read more..." link at the end
  • bold=yes — Keep bold text.
  • quote=yes — Wrap the excerpt with ‎<blockquote> tags.
  • inline=yes — Remove the hatnote and ‎<div> tags around the excerpt, to use it inside other text.
  • references=no — Remove all references.
  • subsections=yes — Include subsections of the transcluded section. Notice that if the transclusion is done from a section level 3, and the transcluded subsections are level 3 too, then the transcluded subsections will show with the same hierarchy as the transcluding section, which is probably not desirable, so use with caution.

Replacing a section with an excerpt

文件:How to excerpt.webm
How to replace a section with an excerpt.

A section is often a summary of a more precise page dealing with a subtopic. Sometimes it's convenient to replace the content of such a section with an excerpt of the page about the subtopic, after merging the original content of the section (if any) into the page about the subtopic. This improves both the page about the subtopic and the section, reduces maintenance, drives contributors to collaborate, etc.

An efficient way to proceed is:

  1. Open the section for editing in one tab, and the page about the subtopic in another.
  1. Copy the text of the section and append it to the lead of the page about the subtopic.
  1. Consolidate and adjust the combined lead using common sense.
  1. Save the changes in the child article with an edit summary like: Copied content from [[Page]]; see that article's history for attribution.
  1. Back in the section, delete all content and replace it with an excerpt of the page about the subtopic.
  1. Save the changes in the section with an edit summary like: Move content to [[page about the subtopic]] and leave an excerpt.

Excerpt trees

文件:Excerpt tree.png
Visual representation of an imaginary excerpt tree.

When a very general article uses excerpts from more specific articles, which in turn use excerpts from even more specific articles, then a tree structure emerges, called an "Excerpt tree".

Below you can navigate the main excerpt trees on this wiki. It's useful for editors interested in expanding or improving them.

例

先頭節

{{Excerpt|Lorem ipsum}}
page-not-found

特定の節

{{Excerpt|Lorem ipsum|Section}}
page-not-found

ファイルのみ

{{Excerpt|Lorem ipsum|only=files|hat=no}}
page-not-found

基礎情報ボックスのみ

{{Excerpt|Extension:CategoryLockdown|only=templates|templates=Extension|this=This infobox is}}
page-not-found

基礎情報ボックスなし

{{Excerpt|Extension:CategoryLockdown|templates=-Extension}}
page-not-found

ポータル

{{Excerpt|Lorem ipsum|files=1|references=no|hat=no|more=yes}}
page-not-found

関連項目

テンプレートデータ

模块:TNT第207行Lua错误:数据集Data:Excerpt.tab无效