உள்ளடக்கத்துக்குச் செல்

உதவி:Page breaks

விக்கிமூலம் இலிருந்து

Lua error in Module:Header_structure at line 139: attempt to call upvalue 'plain_sister' (a nil value).

Page breaks can cause several problems when transcluding texts, even if the individual pages render well in the Page: namespace.

Templates across page breaks

[தொகு]

If you have a template that spans a page break, you cannot just put the opening of the template (eg {{fine block| on the first page and the closing }} on the next page. This is because the Wikimedia software first renders the wikicode on each page, before transclusion, so the software never notices that a template is closed in a later page: it treats it as normal text.

To get around this you need to use a "split" form of this template, along with the header and footer fields in the Page: namespace edit view (if you don't have these visible, click the [+] button in the toolbar). This means that only a single "start" and "end" template appear in the transclusion, but the contained text is not actually inside a template. Each page is also wrapped in the Page: namespace, using the header and footer fields, so it appears correctly both before and after transclusion.

Method

[தொகு]

First page

[தொகு]
Body
{{fine block/s}}
First page text
Footer
{{fine block/e}}

Middle pages

[தொகு]
Header
{{fine block/s}}
Body
Middle page text
Footer
{{fine block/e}}

Last page

[தொகு]
Header
{{fine block/s}}
Body
Last page text
{{fine block/e}}

Templates that use this system

[தொகு]

This method is used by many templates. These are "block" level templates like {{fine block}}, as "span" level templates like {{smaller}} don't cause a line break when they are ended. If you need to run a span template across page, simply terminate the first template on the first page, and start a new one on the second.

If the block template you would like to use across a page break doesn't have a split variant, create it using one of the templates above as a reference. Remember to transclude the documentation from the unsplit template page.

Tables across page breaks

[தொகு]

Tables split over pages are done the same way as the split templates above, using the table syntax of {| and |} instead of {{template/s}} and {{template/e}}. For some commonly used table formatting, split templates such as {{block center/s}} and {{TOC begin}} already exist, and are used as described above.

For a one-off split-table, you don't need to make a template.

Method

[தொகு]

First page

[தொகு]
Body
{| class="class?" style="table styling here"
|-
|Table contents
Footer

|}

Middle pages

[தொகு]
Header
{| class="class?" style="table styling here" (same as first page, or this page will render wrongly in the page view)
Body
{{nop}}
|-
|More table rows
Footer

|}

Last page

[தொகு]
Header
{| class="class?" style="table styling here" (same as first page, or this page will render wrongly in the page view)
Body
{{nop}}
|-
|More table rows
|}
[தொகு]

Distinct from but related to the above is the case where footer content ought to appear (typically a footnote or page number) beneath a "first" or "middle" component of a multi-page-crossing table. The following code looks like it ought to work but in fact fails:

First page Middle page
Body
{| class="class?" style="table styling here"
|-
|Table contents
|-
Footer
|}
<references/>
Header
{| class="class?" style="table styling here" (same as first page, or this page will render wrongly in the page view)
|-
Body
{{nop}}
|More table rows
|-
Footer
|}
<references/>

Under the current software the footnotes are frustratingly rendered above the top of the table instead of where you might expect them to appear.

Method

[தொகு]

The solution is to insert a {{nop}} into the footer just above the |} like this:

First page Middle page
Body
{| class="class?" style="table styling here"
|-
|Table contents
|-
Footer
{{nop}}
|}
<references/>
Header
{| class="class?" style="table styling here" (same as first page, or this page will render wrongly in the page view)
|-
Body
{{nop}}
|More table rows
|-
Footer
{{nop}}
|}
<references/>

Footnotes across page breaks

[தொகு]

Footnotes that span more than one page are handled in a similar way to normal. The method below will display correctly both in the Page namespace and when transcluded into the Main namespace.

Method

[தொகு]

First page

[தொகு]
Body
Lorem ipsum dolor sit amet,<ref name="p76">dolorem ipsum, quia dolor sit amet,</ref>
Footer
{{smallrefs}}

Subsequent pages

[தொகு]
Body
…est laborum.<ref follow="p76">consectetur, adipisci velit…</ref>
Footer
{{smallrefs}}

Potential problems

[தொகு]
  • The <ref name=…> can be anything, but the use of the page number is preferred.
  • Normally the <ref follow=…> is at the end of the page. However, if there is a change of section – for transcluding in a different chapter – then continued footnote should be moved to the top of the page, or else it will not be transcluded.
  • Long footnotes may have multiple paragraphs; the use of double carriage returns to start a new paragraph will not work in the transcluded footnotes – it has to be forced by wrapping the second and subsequent paragraphs with the HTML paragraph tags <p>…</p>.

Newlines across pagebreaks

[தொகு]

The default behavior for transclusion is to just add a space between the text of two pages, even when there should be a paragraph break, or when there should be no space at all. There are a few templates to assist in such cases.

Template You type You get
{{Hyphenated word start}} or {{hws}} This page ends with the split word "{{Hyphenated word start|abso|absolutely}} This page ends with the split word "abso-
{{Hyphenated word end}} or {{hwe}} {{Hyphenated word end|lutely|absolutely}}," split between two pages. -lutely," split between two pages.
{{nop}} Used where the end of a page is also end of a paragraph.

NB: The hyphenated word start and hyphenated word end should be paired across two pages in the Page namespace. They will appear correctly as one, unhyphenated word when transcluded to the main namespace.

"https://ta.wikisource.org/w/index.php?title=உதவி:Page_breaks&oldid=1663299" இலிருந்து மீள்விக்கப்பட்டது