Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Category:Harv and Sfn template errors

Help
From Wikipedia, the free encyclopedia
It is used to build and maintain a list or lists of pages—primarily for the sake of the lists themselves and their use in article and category maintenance. It is not part of theencyclopedia's categorization scheme.
More information:
  • This category ishidden on itsmember pages—unless the correspondinguser preference (Appearance → Show hidden categories) is set.
  • These categories are used to track, build and organize lists of pages needing "attentionen masse" (for example, pages using deprecated syntax), or that may need to be edited at someone's earliest convenience.
  • These categories also serve to aggregate members of several lists or subcategories into a larger, more efficient list (discriminated by classifications).
  • Typically, tracking categories are automatically populated by templates invoked in pages or by the MediaWiki software (seeSpecial:TrackingCategories for an overview of the latter).
Administrators: Please do not delete this category as empty!
This category may be empty occasionally or even most of the time.

This category holds articles that use any of the short-cite templates ({{harv}} and{{sfn}} template families, and{{harvc}}) where one or more of those short-cite templates do not properly link to a full citation, the target, or where multiple full cites can be the target of a single short-cite template.

Due totechnical limitations,Category:Harv and Sfn no-target errors contains many articles withfalse-positive errors.No-target error messages are hidden by default. Articles with multiple-target errors are listed inCategory:Harv and Sfn multiple-target errors. Multiple-target errors are not susceptible to false-positive errors so those errors are not suppressed.Several options to view error messages are detailed below, as well as possible ways toresolve errors.

Displaying error messages

[edit]

Currently, twouser scripts relatively reliably detect errors

as well as a third experimental method based on customizing a.css page. The three methods are

Method 1 – Automatic script installation
Go in the'Gadgets' tab of your preferences and select the 'Install scripts without having to edit JavaScript files' option at the bottom of the 'Advanced' section.
Click on the 'Install' button in at the top of eitherUser:Svick/HarvErrors.js, orUser:Trappist the monk/HarvErrors.js
Method 2 – Manual script installation
Go toSpecial:MyPage/common.js and add any of
importScript('User:Svick/HarvErrors.js');// Backlink: [[User:Svick/HarvErrors.js]]
importScript('User:Trappist the monk/HarvErrors.js');// Backlink: [[User:Trappist the monk/HarvErrors.js]]
in yourskin page, likethis. Alternatively, you can go toSpecial:MyPage/skin.js to make the script apply only to your currentskin.
Method 3 – .css code for error messages emitted by the short-cite templates
Error messages are emitted by the various short-cite templates viaModule:Footnotes andModule:Harvc. Because oftechnical limitations, the modules can emitfalse-positive error messages along with valid error messages. For this reason, no-target error messages are hidden by default. To show these hidden error messages, include the following text in yourcommon.css page or your specificskin.css page:
.harv-error{display:inline!important;}/* display Module:Footnotes errors */
Error message display may be enabled in the future.

Error messages

[edit]

If short-cite template error messages areenabled, editors can see these messages:

  1. Harv/sfn error: no target: <anchor ID> – short-cite template cannot find<anchor ID> so cannot link to a full-cite target. Causes for this can be:
    1. the article does not have full-cite target with<anchor ID>
    2. the matching full-cite target is acs1 orcs2 template that:
      1. has|ref=none
      2. uses a redirect name when that redirect does not begin withcite orcita – these two forms cover most of the cs1|2 redirects
    3. the full-cite target does not use exactly the same author or editor surnames and/or date as listed in<anchor ID>
    4. the short-cite template links to a full-cite target that is a wrapper-template; seefalse-positive errors below
  2. Harv/sfn error: multiple targets (n×): <anchor ID> – short-cite template found more than one full-cite target with a matching<anchor ID>. Causes for this can be:
    1. authors' writings from different sources produced in the same year cited without disambiguation|date=2020a,|date=2020b
    2. redundant use of the full cite where one full-cite target might be in a References section and a duplicate might be in a Further reading section

Similar (although not identical) messages are emitted by theuser scripts. See the script documentation.

Resolving errors

[edit]

Ways of resolving legitimateno target errors include:

  • adding a missing full citation. When short citations are copied from one article to another without a full citation, you can sometimes find the full citation in a related article using Wikipedia's search feature.
  • correcting the author and/or editor names in either the short or full citation so that they match each other
  • correcting or adding dates in either the short or full citation so that they match each other; remember that date ranges are separated with an ndash character (–)
  • converting a plain-text full citation into a templated citation using one of the cs1|2 families of templates (e.g.{{Cite book}})
  • change cs1|2 template redirect names that do not begin withcite orcita to the target of the redirect (e.g. change{{encyclopedia}} to{{cite encyclopedia}})
  • create and use{{cite ...}} redirects for citation wrapper templates:{{<whatever>}}{{cite <whatever>}}. Consider renaming the wrapper template so that its canonical name is{{cite <whatever>}} because there are automated processes out there that rename redirects to their canonical names; once renamed by these drones, false-positive error messaging may reappear.
  • wrapping a plain-text citation inside{{wikicite}} and setting|ref= or|id= as appropriate to match the value expected by the short-cite template
  • placing{{anchor}} adjacent to the plain-text citation; set the{{anchor}} parameter value to the value expected by the short-cite template
  • set the short-cite parameter|ref=none to suppress anchor ID link creation

Ways of resolving false positiveno target errors include:

Ways of resolvingmultiple targets errors include:

  • adding|ref=none to cs1|2 templates
  • addingdisambiguation letters to|date= and to the{{sfn}} template when there are multiple full citations to works in the same year by identical authors or editors
  • converting redundant full citations into short citations using{{sfn}}, leaving only one full citation to the referenced work in the article
  • entirely removing a redundant full citation, e.g. identical full citations in a "Bibliography" section and in "Further reading"

No advice is given for resolvingfalse-positive errors.

Current limitations and false-positive errors

[edit]

Brief explanation

[edit]

When a short-cite template links to a full citation that is rendered by a template that wraps a CS1 template, like{{cite DNB}} (which wraps{{cite encyclopedia}}), ano target error may be displayed even when the short-cite template is valid and the link works. That is a "false positive" error. If you find what looks like a false positive error, please report it on the talk page for this category, and another editor will either fix the article or add the template in question toModule:Footnotes/whitelist.

Details

[edit]

The short-cite templates employ an article reader to read the article's raw wikitext (the same text that you see in the source editor's edit window). While reading the wikitext, the article reader looks for a variety of templates that can create anchor IDs. For each such template found, the article reader attempts to extract the necessary information to determine the template's anchor ID, if it produces one. For cs1|2, the most common long-form citation templates, the article reader looks for:

  • The default anchor ID created by the template automatically: up to four author / editor / contributor surname(s) and the year portion of the date
  • |ref={{sfnref}}: the anchor ID generated by{{sfnref}} (or its redirect{{harvid}})
  • |ref=<plain text>: the anchor ID is the<plain text>

The article reader extracts similar information from other templates as appropriate for those templates.

Each long-form citation anchor ID is saved in a list along with a tally indicating how many of that ID the article reader found. When the short-cite template renders its output, it looks for its target anchor ID in the anchor-ID list:

  • anchor ID found and the tally is 1: short-cite template is rendered without error message
  • anchor ID found and the tally is 2 or more: short-cite template is rendered with amultiple target error message and the article is added to Category:Harv and Sfn template errors
  • anchor ID not found: short-cite template is rendered with ano target error message and the article is added to Category:Harv and Sfn template errors

Theno target errors may be true errors or may befalse-positive errors. For true errors, there is no anchor ID in the article to match the anchor ID expected by the short-cite template. A false-positive error occurs because the article reader can only read the article's raw wikitext, it cannot burrow into wrapper templates. Wrapper templates enclose the template that creates the anchor ID. This enclosure hides the necessary details, so the article reader cannot determine that wrapper template's anchor ID. For example,{{cite DNB}} is a wrapper template that encloses{{cite encyclopedia}}. The values assigned to the{{cite DNB}} parameters|year= and|supplement= tell{{Cite DNB}} how to set editor names and date in its call to the enclosed{{cite encyclopedia}}, which uses them to create the wrapper template's anchor ID. When a wrapped template creates a matching anchor ID that the article reader cannot see; the link from short-cite to long-form citation works but is marked with ano target false-positive error message.

Subcategories

This category has the following 2 subcategories, out of 2 total.

Retrieved from "https://en.wikipedia.org/w/index.php?title=Category:Harv_and_Sfn_template_errors&oldid=1300800086"
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp