Help:Formatting conventions
The following conventions are considered best practices for pages in the Page: namespace (DjVu, PDF and other files which use the ProofreadPage extension). For general article formatting conventions and guidelines see Wikisource:Style guide.
Running headers
[edit]A scanned page's header and footer often include page number and titles, which are not transcluded. Place this information in the header and footer edit boxes, accessed by clicking the which appears above the edit window, in the Proofread tools
section.
The {{RunningHeader}} template is useful for formatting these headers, and is used as follows:
{{RunningHeader|left=|center=|right=}}
- This can be shortened to
{{rh|left=|center=|right=}}
. Labels such asleft=
are not required and can be omitted to shorten the template call further.
- This can be shortened to
- Five-entry style headers, such as those that appear in certain encyclopedias and dictionaries, can also be entered with {{RunningHeader}}.
- It is best practice not to modify the font size/style within the {{RunningHeader}} template. Each parameter can be modified using CSS within the work's stylesheet.
- Modify the CSS using
.wst-rh > div:nth-child(n)
, where n is the cell number, or target all cells with.wst-rh > div
.
- Modify the CSS using
Line breaks
[edit]- Remove end-of-line hyphens and line breaks.
It was a dark and stormy night, the rain fell in tor-⏎ rents—except at occasional intervals, when it was⏎ checked by a violent gust of wind which⏎ ... |
It was a dark and stormy night, the rain fell in torrents—except at occasional intervals, when it was checked by a violent gust of wind which... |
- To start a new paragraph, MediaWiki pages use two line breaks (i.e., press return twice and leave one line blank):
...this is the end of one paragraph. This is the start of the next paragraph...
- Poetry and other texts presented on a line-by-line basis should have their line breaks preserved. See H:POEM for how to format them.
Hyphenated end of page words
[edit]
- When a word is hyphenated onto two consecutive pages of the scans, the software will automatically remove the hyphen and join the words together when transcluded into the main namespace.
- First page:
Sometimes words are hyphen-
- Second page:
ated across page breaks.
- Final result: "Sometimes words are hyphenated across page breaks."
- First page:
- If you wish to keep the hyphen (e.g., in the word "over-eager"), use {{peh}} (a.k.a. {{page end hyphen}}) and the software will not remove it:
- First page:
Sometimes removal of hyphens is over{{peh}}
- Second page
eager: you wish to keep the hyphen.
- Final result: "Sometimes removal of hyphens is over-eager: you wish to keep the hyphen."
- First page:
- If a link goes across a page break, use {{lps}} and {{lpe}}. See the documentation of those templates for the various cases that they support.
- If a hyphenated word is bold or in italics, and the hyphen is not to be kept, put the hyphen outside the bold/italic markup:
- First page:
Sometimes hyphenated words are ''ita''-
- Second page:
''lic'' or bold.
- Final result: "Sometimes hyphenated words are italic or bold."
- First page:
Paragraph ending at the bottom of a page
[edit]- If a paragraph ends at the bottom of a page scan and a new paragraph in the same chapter will start on the next page, add {{nop}} at the bottom of the page (on its own line) to force a break in the text. Otherwise, when the pages are transcluded the separation between the two pages will be treated as a single space rather than a new line. Example: (Page:Personal Recollections of Joan of Arc.djvu/476 and Personal Recollections of Joan of Arc/Book III/Chapter 14).
Binder's marks
[edit]- If a binder's mark appears at the bottom of a print page do not reproduce it. These are an artefact of the publishing process for print books. As our works are digital, such marks are not relevant. The marks take various forms, but all indicate the sequence in which printed sections of pages should be bound together.
Templates
[edit]- Using standard templates instead of other types of markup, gives Wikisource protection from undesirable external changes. e.g., Use {{right}} instead of
<p align="right">
.- If you need to indicate a word/phrase should be in Small Caps, use the {{small-caps}} template.
- If you need to indicate a word/phrase should be in a smaller (or larger) font, use the {{smaller}} template. Similarly, the {{xx-smaller}}, {{x-smaller}}, {{larger}}, {{x-larger}}, {{xx-larger}}, and {{font-size}} templates can be used to modify text size.
Footnotes
[edit]- Footnotes in the print version of the book should be implemented using the
<ref></ref>
and<references/>
( or {{smallrefs}} ) mark up. The {{reflist}} mark-up is for Author and Main namespaces.
Obsolete markup
[edit]Some markup is obsolete in modern HTML and will eventually be removed from browsers and MediaWiki. This is not a MediaWiki or Wikisource decision: the HTML constructs are deprecated by the official web standards body, the W3C.
Generally, there are two kinds of deprecation:
- Obsolete tags (tags look like
<this>
) that represent "non-semantic" content and are more correctly done using semantically-meaningful tags and styles via CSS - Obsolete attributes on tags (attributes look like
<tag attribute=this orthis>
) which encode stylistic information that is more correctly implemented in CSS
In some cases, for example, in EPUB exports, such deprecated HTML can cause client problems and the exporter will attempt to strip the problematic code and replace with a best-effort replacement. This does not always work.
Some deprecations that are common, and their resolutions
- Obsolete HTML tags. Use of these tags triggers linter errors.
- The use of the
align
attribute is also deprecated and should be replaced with CSS:- For table positioning[1]
align=center
: usestyle="margin: auto;"
align=left/right
: usestyle="margin-right/margin-left: auto;"
(the margin is on the "blank" side of the table)align=left/right
: usestyle="float: left/right;"
(this allows surrounding content to "flow" around the table)
- For text alignment (e.g., in table cells)[2]:
align=left/center/right
: usestyle="text-align: left/center/right;"
- For table positioning[1]
- The use of the
valign
attribute should be replaced with CSS[3]:valign=top
→vertical-align: top;
valign=middle
→vertical-align: middle;
valign=bottom
→vertical-align: bottom;
- All other table-specific attributes on tables are deprecated [4]:
width
: use CSSwidth
frame
: use CSSborder
cellpadding
: use CSSpadding
on the cells, and setborder-collapse: collapse
cellspacing
: use CSSborder-spacing
and do notborder-collapse
(both apply to the table, not the cells)bgcolor
: use CSSbackground-color
If there are a lot of similar rows (such as a work with numerous tables showing numerical statistical data), consider creating specfic CSS for that work, which should be placed as an Indexstyle for that work.
Tagging
[edit]Some, but not all, deprecations are automatically tagged by an edit filter. If your edits are so tagged, you may wish to adjust the content to avoid a deprecated construction. You do not have to do so, but it will avoid creating a backlog if/when such deprecations cause technical issues in the future. Recent changes with this tag can be seen here. Sometimes, your edits may be tagged not because of your contributions, but because of pre-existing deprecated markup.