Vorlage:Fixcaps
{{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}} {{{1}}}
Dieser Artikel wurde aus einer englischen Sprachversion importiert und wurde noch nicht vollständig übersetzt. Bitte hilf mit, den Text auf deutsch verfügbar zu machen. |
Notice: This template is mostly non-transluded, intended for use only during edit-preview of articles, where the formatted lowercase output is eventually copied back, or substituted, into those articles. |
Diese Vorlage sollte immer ersetzt – werden {{subst:Fixcaps}}. |
The Template:Fixcaps sets the lowercase or capital-letter format of each word (or phrase) in a slash-encoded title, as with a book or film title.
- Usage: {{Fixcaps|GOnE wiTH tHE /winD}} → Gone with the Wind
- {{fixcaps|JOHN/DOE,/"/PROPER/PUNCTUATION/OF/TITLES"}} → John Doe, "Proper Punctuation of Titles"
- {{fixcaps|SHOW|[[wikilink]]ed|+TEXT.}} → Show [[wikilink]]ed text.
- {{subst:fixcaps|"/SAVE/INSIDE/PAGE"}} → "Save Inside Page"
Most words will be displayed with a capital-letter, followed by all lowercase letters, while a preposition or article (a/an/the) will be shown in lowercase letters. A leading "+" forces lowercase. A leading caret symbol ("^") will cause the text to display unchanged, so "^woRDs" would show "woRDs". Prepositions include: about, above, after, at, before, by, for, in, of, on, with and without. Each word to capitalize must be preceded by a slash ("/"), but all spaces could be slashes, and prepositions would still display in lowercase letters. Only 25 slashes are allowed in each parameter, or about 40-45 words (2 lines of text) per parameter, and a wikilink must be in a separate parameter, not embedded inside other text (see below: Limitations). A total of 8 parameters are allowed, or about 320-360 words.
The resulting text, with mixed capital and lowercase letters, can be substituted into the page during edit SAVE, or copy-pasted back into the text, using the template as an editing gadget.
An extra space is added at the end of each slashed part except after a single quotation mark, left parenthesis, em dash, or apostrophes (''').
Examples
The following are some other examples:
- {{fixcaps|A./EINSTEIN. ''/oUT OF/mY/lATEr/YEaRS''}} → A. Einstein. Out of My Later Years
- {{fixcaps|W./MOZART. ''/eiNE KLEINE /nachTMUSIK'' (ORCHESTRAL COMPOSITION)}} → W. Mozart. Eine kleine Nachtmusik (orchestral composition)
- {{fixcaps|+WHEN THE/^UN/ORGANIZATION BEGAN IN 1946.}} → when the UN Organization began in 1946.
A major use for the template would be in reformatting long lists of book titles entered as ALL-CAPS text, while inserting formatting codes for italics, footnotes or bolded volume numbers. Occasionally, entire sections or paragraphs of an article might contain ALL UPPERCASE TEXT, and the template can be used to more easily downcase all the improperly formatted text.
- {{fixcaps|THE ''/TIMES OF /INDIA'' REPORTED MANY CASES OF UNREST IN BOTH EARLY AND LATE YEARS OF THE |British Raj,|+INTO THE 20TH CENTURY. /EARLY COMPUTERS USED |teletypes|+ WHICH DISPLAYED TEXT IN/^ALL-CAPS/+UPPERCASE LETTERS, AND/+NO COMPUTER DOCUMENTS HAD LOWERCASE TEXT.}}
→
The Times of India reported many cases of unrest in both early and late years of the British raj, into the 20th century. Early computers used teletypes which displayed text in ALL-CAPS uppercase letters, and no computer documents had lowercase text.
- {{fixcaps|THE ''/TIMES OF /INDIA'' REPORTED MANY CASES OF UNREST IN BOTH EARLY AND LATE YEARS OF THE |British Raj,|+INTO THE 20TH CENTURY. /EARLY COMPUTERS USED |teletypes|+ WHICH DISPLAYED TEXT IN/^ALL-CAPS/+UPPERCASE LETTERS, AND/+NO COMPUTER DOCUMENTS HAD LOWERCASE TEXT.}}
→
- {{fixcaps|THE/SHRI/SHIVAJI/RAIGAD/SMARAK/MANDAL WAS ESTABLISHED WITH/SENAPATI/KHANDERAO/DABHADE/^II/+of/TALEGAON/DABHADE.}} →
The Shri Shivaji Raigad Smarak Mandal was established with Senapati Khanderao Dabhade II of Talegaon Dabhade.
- {{fixcaps|THE/SHRI/SHIVAJI/RAIGAD/SMARAK/MANDAL WAS ESTABLISHED WITH/SENAPATI/KHANDERAO/DABHADE/^II/+of/TALEGAON/DABHADE.}} →
Just inserting a few slashes into the text, such as at the start of sentences and town names, and putting wikilinks as separate lowercase parameters, can easily salvage a whole paragraph of caps-only text, within 1 minute. Wikilinks are NOT allowed embedded within the text, only as separate parameters (each in vertical bars "|[[link]] |").
Limitations
Fixcaps is limited by restrictions set in the MediaWiki software, version 1.44.0-wmf.3 (b4aac1f), of about 40-45 words (255 characters, or about 2 lines of text) in each of the 8 parameters. Wikilinks must be separate parameters in bars(|[[Link]]|), not embedded within the text, or else put between 2 {{fixcaps}} around a wikilink; otherwise, an embedded wikilink will repeat 25 times. The encoding of the text is limited to 25 slashes in each parameter, and the enclosed text cannot display slashes, except using a slash-backslash-slash ("/\/") to display a forward slash. A total of eight (8) parameters are allowed, to handle 320-360 words or about 16 lines. For larger sections, use multiple {{fixcaps}} to handle 700 or more words, or for each 16 lines of text.
Special conditions:
- forcing lowercase letters - put "+" after slash ("/+LOWERS") to force text as "lowers"
- forcing uppercase letters - put "^" after slash ("/^eXacT") to force as exact case "eXacT"
- cannot split wikilinks - invalid: "text|[[|LINKED TEXT|]]|+more"
- 40-word parameters - use multiple parameters for each 40 words
- maximum 8 parameters - use multiple {{fixcaps}} for longer text
- using Substitution - use {{subst:fixcaps}} to store results upon SAVE of edit.
Any other character after the slash will cause the text to have all lowercase letters.
See also
- w:en:Help:Parser functions - Upcase with {{uc:uppercase here}} → UPPERCASE HERE
- Template:Strfind short - quickly finds a string in a line of text
- String handling templates
- w:en:WP:substitution and Template:Subst - explain how to use subst: ({{subst:Fixcaps|(string)}} will permanently fix a block of text)
External links
- Die obige Dokumentation wurde aus der Seite Vorlage:Fixcaps/Doku eingefügt. (bearbeiten | Versionsgeschichte) Die Kategorien für diese Vorlage sollten in der Dokumentation eingetragen werden. Die Interwiki-Links sollten auf Wikidata eingepflegt werden.
- Liste der Unterseiten