「ヘルプ:トランスクルージョン」の版間の差分

削除された内容 追加された内容
Sat.d.h. (トーク | 投稿記録)
Sat.d.h. (トーク | 投稿記録)
51行目:
<code><nowiki>## label ##</nowiki></code>
 
あるいは、文章の個々の箇所を<code>&lt;section begin="label" /></code> and end で始め、<code>&lt;section end="label" /></code>で始め終わらせることもできます。
 
'''Note''':
* sectionタグは引用符で<code>"label"</code>のように囲み、あいまいさをなくすことを推奨します。
* Section tags are recommended to be wrapped in quotes <code>"label"</code> to avoid ambiguity.
* ラベルにつけるテキストは自由ですが、ページ上の文脈に適したラベルには利点がある可能性があります。
* These are just free text labels, however, making labels contextual to the page can have advantages.
* 英数字を使うのが通常推奨され、他の拡張的文字はトランスクルージョン時に問題を引き起こすかもしれません。
* Use of letters and numbers is usually a recommendation, and other extended characters may cause some issues when transcluding.
* ラベルはページ内の関連する節と別のものにする必要があり、そうすることで対象の節が適切に抽出されます。
* Labels need to be unique for relevant sections on a page, so that the targeted section can be extracted.
* <code><poem></code>マーカーを使うときは、節の''中''で開始・終了するようにしてください。そうしなければ、節のトランスクルージョンが適切に機能しません。
* If you are using <code><poem></code> markers, please make sure to open and close them ''inside'' the sections, or else section transcluding will not work properly.
 
=== Main名前空間へのトランスクルージョン ===
===Transcluding to main namespace===
トランスクルージョンをアンカー地点で終わらせるため、<nowiki><pages></nowiki>にさらなる引数tosectionが必要になります。構文は以下の通りです:
An extra parameter, '''tosection''', is required in <nowiki><pages></nowiki> to end the transclusion at the anchor. The syntax is as follows:
 
<code><nowiki><pages index="file name.djvu" from=x to=y tosection="label" /></nowiki></code>
:* "file name.djvu" is replaced with the exact name of the file you are working with.は取り組んでいるファイルの正確な名前に置き換えます。
:* トランスクルージョンしたい最初のページが"x"です。
:*The number after the slash (/) following the file name of the first page you wish to transclude is "x".
:* トランスクルージョンしたい最後のページが"y"です。
:*The number after the slash (/) following the file name of the final page you wish to transclude is "y".
:* "label"は挿入したアンカー名で置き換えます。
:*"label" is replaced with the name of the anchor you inserted.
To display what is transcluded at [[:en:Popular Science Monthly/Volume 25/June 1884/The Sins of Legislators II]] you would type:でトランスクルージョンしたものを表示するためには、以下のように打ち込みます:
 
<code><nowiki><pages index="Popular Science Monthly Volume 25.djvu" from=155 to=169 tosection=E169/></nowiki></code>
 
アンカー地点の章または節の最初のページを始めるには、'''fromsection'''引数が必要になります。以下のパターンに従ってください:
To begin the first page of a chapter or section at the anchor, a '''fromsection''' parameter is needed. Follow this pattern:
 
<code><nowiki><pages index="file name.djvu" from=x to=y fromsection="label" /></nowiki></code>
:* "file name.djvu" is replaced with the exact name of the file you are working with.は取り組んでいるファイルの正確な名前に置き換えます。
:* トランスクルージョンしたい最初のページが"x"です。
:*The number after the slash (/) following the file name of the first page you wish to transclude is "x".
:* トランスクルージョンしたい最後のページが"y"です。
:*The number after the slash (/) following the file name of the final page you wish to transclude is "y".
:* "label"は挿入したアンカー名で置き換えます。
:*"label" is replaced with the name of the anchor you inserted.
To display what is trancluded at [[:en:Popular Science Monthly/Volume 25/June 1884/Modes of Reproduction in Plants]] you would type:でトランスクルージョンしたものを表示するためには、以下のように打ち込みます:
 
<code><nowiki><pages index="Popular Science Monthly Volume 25.djvu" from=169 fromsection=B169 to=180 /></nowiki></code>
 
連続する節がページの途中で終わるときは、追加的引数が両方一度に必要になるかもしれません。
If successive sections finish part way through a page, then both extra parameters may need to be used at once.
 
==How to transclude single-section==