Redigerer
Kategori:Harv and Sfn template errors
Hopp til navigering
Hopp til søk
Advarsel:
Du er ikke innlogget. IP-adressen din vil bli vist offentlig om du redigerer. Hvis du
logger inn
eller
oppretter en konto
vil redigeringene dine tilskrives brukernavnet ditt, og du vil få flere andre fordeler.
Antispamsjekk.
Ikke
fyll inn dette feltet!
{{Tracking category}} This category holds articles that use any of the short-cite templates ({{tlx|harv}} and {{tlx|sfn}} template families, and {{tlx|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 to [[#Current limitations and false-positive errors|technical limitations]], {{cl|Harv and Sfn no-target errors}} contains many articles with [[#Current limitations and false-positive errors|false-positive errors]]. [[#Error messages|No-target error messages]] are hidden by default. Articles with multiple-target errors are listed in {{cl|Harv and Sfn multiple-target errors}}. Multiple-target errors are not susceptible to false-positive errors so those errors are not suppressed. [[#Displaying error messages|Several options]] to view error messages are detailed below, as well as possible ways to [[#Resolving errors|resolve errors]]. ==Displaying error messages== Currently, two [[WP:User script|user scripts]] relatively reliably detect errors *[[:en:User:Svick/HarvErrors.js]] – Errors only *[[:en:User:Trappist the monk/HarvErrors.js]] – Errors + Warnings about potential errors ''when short footnote templates are used''. This has ''substantially'' fewer pointless warnings than [[:en:User:Ucucha/HarvErrors.js|Ucucha's old script]]. as well as a third experimental method based on customizing a [[.css]] page. The three methods are ;Method 1 – Automatic script installation {{anchor|Method1}} :Go in the [[Special:Preferences#mw-prefsection-gadgets|'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 either [[:en:User:Svick/HarvErrors.js]], or [[:en:User:Trappist the monk/HarvErrors.js]] ;Method 2 – Manual script installation {{anchor|Method2}} :Go to [[Special:MyPage/common.js]] and add any of ::{{code|lang=js|importScript('User:Svick/HarvErrors.js'); // Backlink: [[:en:User:Svick/HarvErrors.js]]}} ::{{code|lang=js|importScript('User:Trappist the monk/HarvErrors.js'); // Backlink: [[:en:User:Trappist the monk/HarvErrors.js]]}} :in your [[Special:MyPage/common.js|skin]] page, like [https://en.wikipedia.org/w/index.php?title=User:Headbomb/monobook.js&diff=947843597&oldid=947843535 this]. Alternatively, you can go to [[Special:MyPage/skin.js]] to make the script apply only to your current [[WP:SKIN|skin]]. ;Method 3 – .css code for error messages emitted by the short-cite templates {{anchor|Method3}} :Error messages are emitted by the various short-cite templates via [[Module:Footnotes]] and [[Module:Harvc]]. Because of [[#Current limitations and false-positive errors|technical limitations]], the modules can emit [[false positive|false-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 your [[Special:MyPage/common.css|common.css]] page or your specific [[Special:MyPage/skin.css|skin.css]] page: ::{{code|lang=css|.harv-error {display: inline !important;} /* display Module:Footnotes errors */}} :Error message display may be enabled in the future. ==Error messages== If short-cite template error messages are [[#Method3|enabled]], editors can see these messages: #{{error-small|Harv/sfn error: no target: <{{var|anchor ID}}>}} – short-cite template cannot find {{error-small|<{{var|anchor ID}}>}} so cannot link to a full-cite target. Causes for this can be: ##the article does not have full-cite target with {{error-small|<{{var|anchor ID}}>}} ##the matching full-cite target is a [[Help:Citation Style 1|cs1]] or [[Help:Citation Style 2|cs2]] template that: ###has {{para|ref|none}} ###uses a redirect name when that redirect does not begin with <code>cite</code> or <code>cita</code> – these two forms cover most of the cs1|2 redirects ##the full-cite target does not use exactly the same author or editor surnames and/or date as listed in {{error-small|<{{var|anchor ID}}>}} ##the short-cite template links to a full-cite target that is a wrapper-template; see [[#Current limitations and false-positive errors|false-positive errors]] below #{{error-small|Harv/sfn error: multiple targets ({{var|n}}×): <{{var|anchor ID}}>}} – short-cite template found more than one full-cite target with a matching {{error-small|<{{var|anchor ID}}>}}. Causes for this can be: ##authors' writings from different sources produced in the same year cited without disambiguation {{para|date|2020a}}, {{para|date|2020b}} ##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 the [[#Displaying error messages|user scripts]]. See the script documentation. ==Resolving errors== Ways of resolving legitimate {{error-small|no 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. {{tl|Cite book}}) or one of the Vcite family of templates (e.g. {{tl|vcite book}}) *change cs1|2 template redirect names that do not begin with <code>cite</code> or <code>cita</code> to the target of the redirect (e.g. change {{tl|encyclopedia}} to {{tl|cite encyclopedia}}) *create and use {{tld|cite ...}} redirects for citation wrapper templates: {{tld|<{{var|whatever}}>}} → {{tld|cite <{{var|whatever}}>}}. Consider renaming the wrapper template so that its canonical name is {{tld|cite <{{var|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 {{tl|wikicite}} and setting {{para|ref}} or {{para|id}} as appropriate to match the value expected by the short-cite template *placing {{tl|anchor}} adjacent to the plain-text citation; set the {{tlc|anchor}} parameter value to the value expected by the short-cite template *set the short-cite parameter {{para|ref|none}} to suppress anchor ID link creation Ways of resolving false positive {{error-small|no target}} errors include: *adding the CITEREF to: ** [[Module:Footnotes/whitelist]] – use this when many articles use the same long-form citation ** a {{tlx|sfn whitelist}} template in the article Ways of resolving {{error-small|multiple targets}} errors include: *adding {{para|ref|none}} to cs1|2 templates *adding [[Template:Sfn#More_than_one_work_in_a_year|disambiguation letters]] to {{para|date}} and to the {{tl|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 {{tl|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 resolving [[#Current limitations and false-positive errors|false-positive errors]]. <!-- this moved here from §Current limitations and false-positive errors --> <!-- {{ombox|text=Adding {{para|ignore-false-positive|yes}} in articles to bypass errors is currently premature. While it will suppress error messages (which are currently hidden by default), it is not necessarily the ideal consensus long-term solution. This use should be limited to testing in sandboxes. You can join the discussion at [[Module talk:Footnotes]] to keep up with the latest developments.}} To resolve a false-positive error, test the suspect link, and if it works, add {{para|ignore-false-positive|yes}} to the short-cite template. Alternately, an article-local whitelist may be made with {{tlx|sfn whitelist}}. The short-cite template will not emit {{error-small|no target}} error messages for anchor IDs listed in {{tld|sfn whitelist}}. Because the multiple-target error is not a false-positive error, it cannot be suppressed. --> ==Current limitations and false-positive errors== ===Brief explanation=== When a short-cite template links to a full citation that is rendered by a template that wraps a CS1 template, like {{tlx|cite DNB}} (which wraps {{tlx|cite encyclopedia}}), a {{error-small|no 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 to [[Module:Footnotes/whitelist]]. ===Details=== 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 * {{para|ref|{{tlx|sfnref}}}}: the anchor ID generated by {{tld|sfnref}} (or its redirect {{tlx|harvid}}) * {{para|ref|<{{var|plain text}}>}}: the anchor ID is the <code><{{var|plain text}}></code> 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 a {{error-small|multiple 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 a {{error-small|no target}} error message and the article is added to Category:Harv and Sfn template errors The {{error-small|no target}} errors may be true errors or may be [[False positive|false-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, {{tlx|cite DNB}} is a wrapper template that encloses {{tlx|cite encyclopedia}}. The values assigned to the {{tld|cite DNB}} parameters {{para|year}} and {{para|supplement}} tell {{tld|Cite DNB}} how to set editor names and date in its call to the enclosed {{tld|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 a {{error-small|no target}} false-positive error message. {{CatAutoTOC}} [[Category:Articles with incorrect citation syntax]]
Redigeringsforklaring:
Merk at alle bidrag til Wikisida.no anses som frigitt under Creative Commons Navngivelse-DelPåSammeVilkår (se
Wikisida.no:Opphavsrett
for detaljer). Om du ikke vil at ditt materiale skal kunne redigeres og distribueres fritt må du ikke lagre det her.
Du lover oss også at du har skrevet teksten selv, eller kopiert den fra en kilde i offentlig eie eller en annen fri ressurs.
Ikke lagre opphavsrettsbeskyttet materiale uten tillatelse!
Avbryt
Redigeringshjelp
(åpnes i et nytt vindu)
Denne siden er medlem av 2 skjulte kategorier:
Kategori:Articles with incorrect citation syntax
Kategori:Sider hvor ekspansjonsdybden er overskredet
Navigasjonsmeny
Personlige verktøy
Ikke logget inn
Brukerdiskusjon
Bidrag
Opprett konto
Logg inn
Navnerom
Kategori
Diskusjon
norsk bokmål
Visninger
Les
Rediger
Rediger kilde
Vis historikk
Mer
Navigasjon
Forside
Siste endringer
Tilfeldig side
Hjelp til MediaWiki
Verktøy
Lenker hit
Relaterte endringer
Spesialsider
Sideinformasjon