Predloga:Slog navajanja - dokumentacija/anchors

Iz Wikipedije, proste enciklopedije

Sidro[uredi kodo]

Ta predloga za sklicevanje se lahko uporablja znotraj Kratki sklici ali Medbesedilni sklici v oklepaju znotraj besedila. Predloga ustvari HTML sidro z ID-jem, na katerega se lahko pustvari povezava znatraj članka. To se stori z uporaba parametra ref.

Prednastavljeno, ta predloga ne generira ID-ja. V večini primerov se |ref=harv uporablja za kreacijo ID-ja iz izraza CITEREF, plus priimek prvih štirih avtorjev, ali priimek prvih štirih urednikov, plus leto ali datum. Zgled:

Uporaba ID
{{navedi knjigo |last=Harwood |first=William B |title=Raise Heaven and Earth |year=1993 |ref=harv}}
CITEREFHarwood1993
{{navedi knjigo |last1=Brett |first1=Daniel |last2=Hardman |first2=George |last3=Ratycz |first3=Rostyslaw |title=Pershing: ST-120 Stabilizing Platform Familiarization |year=1964 |ref=harv}}
CITEREFBrettHardmanRatycz1964

Nekateri urejevalci lahko uporabljajo več avtorjev v enem parametru. Ločila so določena, ampak izhod ni tisto, kar bi pričakovali. Zgled:

Uporaba ID
{{navedi knjigo |authors=Daniel; Hardman, George; Ratycz, Rostyslaw |title=Pershing: ST-120 Stabilizing Platform Familiarization |year=1964 |ref=harv}}
CITEREFDaniel.3B_Hardman.2C_George.3B_Ratycz.2C_Rostyslaw1964

Priporočeno je, da uporabite parametere last1 do last9 ali editor1-last doeditor1-last4, če želite ustvariti sidro.

Kjer avtor ali datum ne obstajata, potem se za generacijo uporabi ročno ustvarjen ID |ref=ID.

Uporaba ID
{{navedi časopis |title=Pershing Rockets for Europe |journal=Interavia |year=1961 |ref=CITEREFInteravia1961}}
CITEREFInteravia1961

Priporočeno je, da se ID začne z CITEREF, saj to omogoča delovanje orodjem za preverjanje napaka. Ročni ID mora slediti tem pravilom:

  • Imena se ne smejo pričeti s cifro.
  • Edini znaki, ki se lahko uporabljajo nekodirano so črke A–Z, a–z in cifre 0–9.
  • Vključevanje kateregakoli drugega znaka bo povzročilo kodiranje s piko.
Priporočeno je, da naj bodo imena enostavna in omejena na črke standardne angleščine cifre.

Datumi[uredi kodo]

Ta predloga podpira date, year in month. Pomembno je, da uporabite te parametre pravilno zaradi preprečevanje okvarjenih ID-jev.

  • Mesec, dan, leto: Uporabite date
  • Samo leto: Uporabite year
  • Leto in mesec: Uporabite year in month

Če uporabite v date samo leto, predloga lahko interpretira to kot čas, in ID ne bo tak kot je pričakovan..

{{markup |


. Posebni parameter |ref=harv generira ID primeren za predloge za Harvardsko sklicevanje kot je {{harv}} kot je opisanje v naslednjem poglavju; to je prednastavljeno v predlogi {{citat}}. Če je podan prazen |ref=, se sidro ne generira; to je prednastavljaneo za predloge Navedi kot je {{navedi knjigo}} in {{navedi novice}}. ID lahko določite tudi direktno z uporabo parametra |ref=ID. Na primer, predvidevajmo, da poglavje Sklici v članku vsebuje:

  • {{Citat |author=Sigmund Freud |title=Civilization and Its Discontents |year=1930 |ref=CivDis}}

kar povzroči izpis sklica:

  • Sigmund Freud (1930), Civilization and Its Discontents

Then, the markup "([[#CivDis|Freud 1930]])" generates a parenthetical reference "(Freud 1930)" containing a wikilink to the citation (try clicking on the wikilink).

Anchors for Harvard referencing templates[uredi kodo]

IDs compatible with Harvard referencing templates such as {{harv}} are computed from the last names of the authors and the year of the cited source. For example, the markup "{{harv|Wright|Evans|1851|p=ix}}" generates the Harvard reference "(Wright & Evans 1851, str. ix)", which wikilinks to the citation whose markup and appearance are shown below:

  • {{Citation |last1=Wright |first1=Thomas |last2=Evans |first2=R. H. |title=Historical and Descriptive Account of the Caricatures of James Gillray |location=London |publisher=Henry G. Bohn |year=1851 |oclc=59510372}}
  • Wright, Thomas; Evans, R. H. (1851), Historical and Descriptive Account of the Caricatures of James Gillray, London: Henry G. Bohn, OCLC 59510372

In this example the {{citation}} template defines, and the {{harv}} template uses, the HTML ID "CITEREFWrightEvans1851", composed by concatenating the string "CITEREF" with the last names of the authors and the year. The {{harvid}} template can be used to generate such IDs, for example, {{harvid|Wright|Evans|1851}} generates "CITEREFWrightEvans1851".

Related methods which leave only a number in the text are to use the {{harvnb}} template enclosed in the <ref></ref> html code, or to use the {{sfn}} template alone. The example above would be <ref>{{harvnb|Wright|Evans|1851|p=ix}}</ref> or {{sfn|Wright|Evans|1851|p=ix}} both of which generate a footnote, such as

17. Wright & Evans 1851, str. ix

The names of only the first four authors are used; other author names are not concatenated to the ID. If no author names are given, editor names are used instead. For patents, inventor names are used instead of authors or editors. If these names are not given, this template does not generate an anchor.

Last names are used, as specified by the parameters |last1= (or |last=), |last2=, |last3=, and |last4=, and similarly for |editor1-last= etc. and for |inventor1-last= etc. If a full name is given but no last name is specified, this template falls back on the full name, but this usage is not recommended. For example, in "{{Citation | author = Sigmund Freud | title = The Ego and the Id | year = 1923}}" no last name is given, so this citation cannot be combined with the Harvard reference "{{harv|Freud|1923}}". To make these {{citation}} and {{harv}} invocations compatible, either replace "|author=Sigmund Freud" with "|first=Sigmund |last=Freud", or add "|ref={{harvid|Freud|1923}}" to the {{citation}} invocation, or add the same ref parameter (say, "|ref=EgoId") to both the {{citation}} and the {{harv}} invocations.

Similarly, the year is used, as specified by |year=. If no year is given, this template attempts to derive the year from |date= (or, if no date is given, from |publication-date=) by applying the MediaWiki#time function. This heuristic works with many common date formats (American, International and ISO standard format YYYY-MM-DD as listed in WP:MOS), but may not work as expected with other formats, so when in doubt it may be safer to use |year=. Note that if only a year, say 2005, is known you must use |year=2005 rather than |date=2005.

IDs must be unique[uredi kodo]

Names, years, and hand-specified IDs must be chosen so that the IDs are unique within a page; otherwise the HTML will not conform to the W3C standards, and any references to the citations will not work reliably. For example, suppose a page contains the following two citations with {{harv}}-compatible IDs:

If these citations were altered to say "2008" rather than "2008a" and "2008b", the resulting page would not work, because the two different citations would both attempt to use the ID "CITEREFMontesHalterman2008". To avoid this problem, distinguish the citations by appending suffixes to the years, e.g., "|year=2008a" and "|year=2008b", as was done above. Any Harvard references to these citations should use years with the same suffixes.

It is good practice to verify that a page does not contain duplicate IDs by using the W3C Markup Validation Service; glej Zunanje povezave.