ವಿಷಯಕ್ಕೆ ಹೋಗು

ಸಹಾಯ:Page breaks

ವಿಕಿಸೋರ್ಸ್ದಿಂದ
Page breaks

This page explains solutions to common problems relating to text being broken across pages in the Page: namespace.

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.

Body
{{fine block/s}}
First page text
Footer
{{fine block/e}}
Header
{{fine block/s}}
Body
Middle page text
Footer
{{fine block/e}}
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.

Examples of templates that use this method include:

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.

This method has two parts, both due to the way that the ProofreadPage extension concatenates pages without newlines between them:

  1. Use {{nopt}} to force the table markup (either |- or |}) to start on a new line in the final text (this is required for it to be seen as table markup).
  2. Place new row markers (|-) at the start of pages, not the end of the previous page. This is required for the page numbers to be placed correctly[].
Page Section Content
First page Body
{| class="_class"
|-
|Table contents
Footer
{{nopt}}
|}
{{smallrefs}} <!--if any-->

Note: the {{nopt}} is important in the footer, because without it, the table will close after the rest of the footer content, like references, and therefore they will render in the wrong place.[]

Middle pages Header
{| class="_class" (same as first page, or this page will render wrongly in the page view)
|-<!-- Trailing row marker needed if using header/ribbon rows  -->
Body
{{nopt}}
|-
|More table rows
Footer
{{nopt}}
|}
{{smallrefs}} <!--if any-->
Last page Header
{| class="_class" (same as first page, or this page will render wrongly in the page view)
|-<!-- Trailing row marker needed if using header/ribbon rows  -->
Body
{{nopt}}
|-
|More table rows
|}

Poems across page breaks

[ಸಂಪಾದಿಸಿ]

Poems should generally be formatted using the {{ppoem}} template. It has been designed specifically for formatting poems on Wikisource and makes a lot of the most common things needed for poems a lot easier. It does however have a slightly different usage model than most of the other templates mentioned here.

Each page of a poem needs to use its own complete {{ppoem}} template, and then the template takes care of joining the parts together in the right way when they are transcluded together for display. In order to do this you need to tell the template whether the page break is on a stanza, if one line follows the last, or if the break is on the same line. On the first or earlier page you tell it how it ends, and on the following page you tell it how it starts.

Page Content Output
First page
{{ppoem|end=follow|
Stanza 1, Line 1
:Stanza 1, Line 2

Stanza 2, Line 1
}}
Stanza 1, Line 1
Stanza 1, Line 2

Stanza 2, Line 1
Stanza 2, Line 2

Stanza 3, Line 1
Stanza 3, Line 2

Stanza 4, Line 1
Stanza 4, Line 2

Middle pages
{{ppoem|start=follow|end=stanza|
:Stanza 2, Line 2

Stanza 3, Line 1
:Stanza 3, Line 2
}}
Last page
{{ppoem|start=stanza|
Stanza 4, Line 1
:Stanza 4, Line 2
}}


The old way to do this, which you will meet in some texts that were transcribed before {{ppoem}} was available, used the <poem> tag. This tag must always be opened and closed in the body of the page.

If you use "direct formatting" (i.e. <br/>), then you don't need to do anything different.

If you use {{block center}}, you have to split that template as usual over the pages:

Page Section Content
First page Body
{{block center/s}}<poem>
Stanza 1, Line 1
Stanza 1, Line 2
<br/><!-- start a new stanza -->
</poem>
Footer
{{block center/e}}
Middle pages Header
{{block center/s}}
Body
<poem>
Stanza 2, Line 1
Stanza 2, Line 2
</poem><!-- no new stanza -->
Footer
{{block center/e}}
Last page Header
{{block center/s}}
Body
<poem>
Stanza 2, Line 3
Stanza 2, Line 4
</poem>
{{block center/e}}

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.

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 as long as it's not shared with unrelated footnotes that are transcluded onto the same page. Using 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 putting the template {{Paragraph break}} (or its shortcuts {{pbr}} / {{parabr}}) between the two paragraphs. Using <br/> or <p></p> to separate the paragraphs should be avoided, as these do not always work well when exporting to PDF or eBook formats.[]
  • The parts of a footnote are automatically joined with a space. For joining without a space (e.g. when a word is split over two pages) use {{hws}} and {{hwe}}.

Lists across page breaks

[ಸಂಪಾದಿಸಿ]

Lists across page breaks create complications where typically, a portion of parent list item and a 'continued' wording is used on the second page.

Sub listed item on second page

[ಸಂಪಾದಿಸಿ]

Rather than placing the continuation content in the header of the second page it should be placed in the body inside a <noinclude></noinclude> pair, followed by a line feed.[] The next list item, (or sub list item) is then continued as normal.

Body of first page
*Parent item of list.
**First item of sub list.
Body of second page
<noinclude>*Parent item list (cont.)</noinclude><!-- The line feed here is significant. -->
*Second item of list.

Continuation of first list item

[ಸಂಪಾದಿಸಿ]
Body of first page
*Parent item of list. Content of item ...
Body of second page
<noinclude>*Parent item of list. (cont.)<br></noinclude>.. continues across a page divide.<!-- -->
** Sub list item.

Note that any Section tag's should be placed after the list item on the first page, but immediately before the noincluded portion on the second. There is NO line-feed placed between the section tags and the noincluded portion on the second page.

If a link spans a page break, use {{lps}} on the first page and {{lpe}} on the second.

As an example, if you wanted to link "Lorem ipsum", but the word break was in the middle, put

{{lps|link = Lorem ipsum|pre=Lorem|post=ipsum}}

on the first page, and

{{lpe|link = Lorem ipsum|pre=Lorem|post=ipsum}}

on the second.

Note that wikitext markup (eg italics) has to go inside the "pre" and "post" parameters to render correctly.

Newlines, hyphens and dashes across pagebreaks

[ಸಂಪಾದಿಸಿ]

The default behavior for transclusion is to just add a space between the text of two pages (except when the page ends in a hyphen, when it is removed and no space is inserted), even when there should be a paragraph break, or when there should be no space at all. There are a some templates to assist in such cases.

  • Use {{page end hyphen}} or {{peh}} when the hyphen at the end of the page should be retained. See H:HYPHEN for more details.
  • Use {{unspaced page end}} or {{upe}} for other cases when there should not be a space between the pages, for example when one page starts with an unspaced em dash (—).
  • Place {{nop}} on a new line when the end of a page is also end of a paragraph.
  1. If you put them at the end of pages, the page number location markers are placed between table rows, and this is invalid HTML, resulting in "fostered content" linter errors. See also phab:T232477.
  2. Specifically, they may be fostered as above and end up at the top of the table and cause a lint error, or they may appear in the last cell of the table.
  3. See also phab:T49544.
  4. This can't go in the header field for now, due to a forced double-newline in the back-end. See phab:T275388 for details.