The CiteNG extension provides advanced citation capabilities, extending those provided by the Cite extension, and is fully compatible with it.

Getting Started edit

Basic Usage Example edit

As said above, CiteNG is fully compatible with Cite.




Beyond The Basics edit

Terminology edit

Pointer edit

A pointer is a tag that points to a named definition. Editors place pointers in the article to cite or reference a source. A pointer is created by placing the <ref> tag anywhere in the text. A pointer tag must specify the name attribute, and must not have a tag body (i.e. <ref .../>). A pointer tag with no name or empty name attribute generates an error; a pointer tag with a tag body becomes an Inline Definition.

A pointer tag is rendered for display with a Pointer Rendering Template. The default rendering template replaces the original tag with a super-script numeric label (i.e. [1]) that links to the named definition. If a rendering template isn't specified, it is inherited from the definition to which this pointer points to.

Syntax edit
<ref name="NAME" [ pointer-renderer="{{TEMPLATE [|PARAM1=VAL1...]"}} ]/>

Example:

<ref name="NASA89-1" pointer-renderer="{{PointerLabelRenderer|label=note}}"/>


<reference group="Notes" pointer-renderer="{{PointerLabelRenderer|label=note}}"> <ref name="Sun vs. MS dispute"> </reference>

Definition edit

  • Named Definition
  • Anonymous Definition
  • Typed Definition
  • Inline Definition
  • Group
  • Pointer Rendering Template
  • Definition Rendering Template
  • Group Rendering Template
  • Style


Group edit

  • reference
    • group
    • pointer-renderer
    • definition-renderer
    • group-renderer
    • style

The Citation-Reference Style edit

Syntax 1 edit

The Moon is Earth's only natural satellite and is the fifth largest satellite in the Solar System.<ref name="R1"/> It is the largest moon in the Solar System relative to the size of its planet, a quarter the diameter of Earth and 1/81 its mass, and is the second densest satellite after Io. It is in synchronous rotation with Earth, always showing the same face; the near side is marked with dark volcanic maria among the bright ancient crustal highlands and prominent impact craters. <reference style="citation"> <ref name="R1"><ref name="NASA89"/>, pp.105-106</ref> </reference> <reference style="reference"> <ref:book name="NASA89" .../> </reference>

Syntax 2 edit

The Moon is Earth's only natural satellite and is the fifth largest satellite in the Solar System.<ref g="citation"><ref name="NASA89"/>, pp. 105-106</ref> It is the largest moon in the Solar System relative to the size of its planet, a quarter the diameter of Earth and 1/81 its mass, and is the second densest satellite after Io. It is in synchronous rotation with Earth, always showing the same face; the near side is marked with dark volcanic maria among the bright ancient crustal highlands and prominent impact craters. <reference style="citation"/> <reference style="reference"> <ref:book name="NASA89" .../> </reference>

Syntax 3 edit

The Moon is Earth's only natural satellite and is the fifth largest satellite in the Solar System.<ref name="NASA89-1"/> It is the largest moon in the Solar System relative to the size of its planet, a quarter the diameter of Earth and 1/81 its mass, and is the second densest satellite after Io. It is in synchronous rotation with Earth, always showing the same face; the near side is marked with dark volcanic maria among the bright ancient crustal highlands and prominent impact craters. <reference style="citation"> <ref><ref name="NASA89" pp="105-106"/></ref> <reference style="reference"> <ref:book name="NASA89" .../> </reference>

Zbale edit

In CiteNG, a Reference has two parts: the Reference Definition and zero or more Reference Pointers. A reference definition describes a previously published work, and is usually placed within a Definition Group, at the foot of the article. A reference pointer is placed within the article body, and is used to point to a reference definition.

Reference Definition edit

Technically speaking, a reference definition has three main properties:

Property Description
Location The place within the article where the reference definition is located. A definition within the article body is called an inline definition; a definition that is located inside a definition group is called a grouped definition. Inline definitions are scattered in the article, and are hard to find and maintain. In contrast, grouped definitions are easily found and maintained: they are grouped together at the foot of the article.
  • Inline: ...and the design of Smalltalk.<ref name="alank">http://smalltalk.org/history.html</ref>
  • Grouped: ...and the design of Java.<ref name="jg"/>
    ==References==
    <references>
      <ref name="jg">http://java.org/history</ref>
    </references>
Type A definition is either typed or typeless. A typed definition specifies the type of the published work it describes (i.e., book, journal, web site etc.); a typeless definition does not. A typed definition can be automatically formatted; a typeless definition is formatted manually, either in a free style, or using a citation template.
  • Typed: <ref:book title="Green" first="John" .../>
  • Naive typeless: <ref>Allan, John (1998), "Green" ...</ref>
  • Advanced typeless: <ref>{{cite book | title="Green" | first="John" ... }}</ref>
Identification

In-place and Out-of-place Definition edit

An in-place definition is a reference definition that is placed somewhere within the article text

In this style, the reference is declared within the article body. This style is easy to use, but makes it hard to maintain the declarations, as they are scattered in the text in no particular order. When the article is rendered, the declaration is considered as if it was declared within a named Reference Declaration Block, matched by the group attribute. If a group attribute is not specified, it defaults to "_anonymous_". Likewise, an unnamed reference declaration block defaults to "_anonymous_".

For example, the following two styles are equivalent:

Definition within the article Definition in a reference declaration block

Blah ... <ref name="foo" label="bar">text</ref> ... blah blah
==References==
<references/>

Blah ... <ref name="foo"/> ... blah blah
==References==
<references>
  <ref name="foo" label="bar">text</ref>
</references>



blah blah <ref [group="GROUP"]>TEXT</ref> blah blah

If group is not specified, the reference is treated as if group = references.


Definitions edit

Reference Pointer edit

A Reference Pointer ("pointer" for short) is a tag that points to a named Reference Declaration. Editors place this tag in the article to cite a source. A pointer tag is rendered for display using a Rendering Template. The rendering template will usually replace the original tag with a link to the appropriate reference declaration, thus allowing the reader to view the source with a mouse click.

Syntax:

<ref name="NAME"/>

Short Syntax edit

For ease of use, the following additional short syntax is supported. Note that this syntax is only supported for reference pointers. In XML terms, <tag foo/> is actually <tag foo="foo"/>.

Syntax:

<ref NAME/>

Reference Declaration edit

A Reference Declaration ("declaration" for short") is a tag that defines the content of a reference. Declarations can be placed anywhere in the text (in-place), but it's best if they are placed within a Reference Declaration Block. A declaration must be named for a pointer (or pointers) to point on it. Unnamed declarations cannot be pointed at by pointers. When a declaration is placed within the article, it can be grouped to a named reference declaration block, thus providing control on the location of the declaration within the rendered article. A declaration can optionally have a label, which is the human-readable name of the declaration. Usually, the Harvard Referencing format is used for labels (i.e., "Darwin 1846"), but any text will do. Reference declarations are rendered using a rendering template.

In-place Declarations edit

In this style, the reference is declared within the article body. This style is easy to use, but makes it hard to maintain the declarations, as they are scattered in the text in no particular order. When the article is rendered, the declaration is considered as if it was declared within a named Reference Declaration Block, matched by the group attribute. If a group attribute is not specified, it defaults to "_anonymous_". Likewise, an unnamed reference declaration block defaults to "_anonymous_".

For example, the following two styles are equivalent:

Definition within the article Definition in a reference declaration block

Blah ... <ref name="foo" label="bar">text</ref> ... blah blah
==References==
<references/>

Blah ... <ref name="foo"/> ... blah blah
==References==
<references>
  <ref name="foo" label="bar">text</ref>
</references>

Named Declaration edit

Syntax:

Blah ... <ref name="NAME" [group="GROUP"] [label="LABEL"]>TEXT</ref> ... blah blah
Unnamed Declaration edit

Syntax:

Blah ... <ref [group="GROUP"] [label="LABEL"]>TEXT</ref> ... blah blah

Built-in Styles edit

Built-in Classes edit

Class:Notes edit

Attribute Default Value Result
pointer-renderer Template:Ref:Pointer:SupIndexedLabelRenderer Hello World.[Note 1]
declaration-renderer Template:Ref:Declaration:DefaultRenderer 1. ^ This is a note.
2. ^ a b And so is this.

Class:Citations edit

Attribute Default Value Result
pointer-renderer Template:Ref:Pointer:SupIndexedRenderer Hello World.[1]
declaration-renderer Template:Ref:Declaration:DefaultRenderer 1. ^ This is a citation.
2. ^ a b And so is this.

Class:References edit

Attribute Default Value Result
pointer-renderer Template:Ref:Pointer:LabelRenderer During the mid nineties research undertaken in Luton (Slater & Jones,

1996) showed that...

declaration-renderer None 1. This is a reference.
2. And so is this.

Built-in Renderers edit

Pointer Renderer edit

A Pointer Renderer is a template that transforms a Reference Pointer tag (i.e., <ref name="foo"/>) to wiki markup text. Several such templates are provided, each generates a different wiki text. The following table lists the parameters that are set when this template is invoked:

Attribute Description Sample
name The name of the declaration to which this pointer links Blo95
label The label (if exists) of the declaration Darwin 1846
index The index of the reference 1 2 ... N
anchor The anchor of this pointer; a declaration may link back here ref_pointer_1
target The anchor of the declaration; the pointer should link to this anchor ref_declaration_1
Template:Ref:Pointer:LabelRenderer edit
<span id="{{{anchor}}}" class="reference">
  [[{{{target}}}|{{{label}}}]]
</span>
Template:Ref:Pointer:SupIndexRenderer edit
<sup id="{{{anchor}}}" class="reference">
  [[{{{target}}}|<nowiki>[</nowiki>{{{index}}}<nowiki>]</nowiki>]]
</sup>
Template:Ref:Pointer:SupIndexedLabelRenderer edit
<sup id="{{{anchor}}}" class="reference">
  [[{{{target}}}|<nowiki>[</nowiki>{{{label}}} {{{index}}}<nowiki>]</nowiki>]]
</sup>

Declaration Renderer edit

A Declaration Renderer is a template that transforms a Reference Declaration tag (i.e., <ref name="foo"/>blah blah</ref>) to wiki markup text. This template is called at least once for every declaration. If more than one reference pointers point to a declaration, this template is called once for each pointer, usually linking the declaration to each of its pointers. The following table lists the parameters that are set when this template is invoked:

Attribute Description Sample
name The name of the declaration Blo95
label The label (if exists) of the declaration Darwin 1846
index The index of the reference declaration; usually serves as the numeric identifier of the declaration 1 2 ... N
pointer The current pointer that needs to be linked 1 2 ... count
count The number of pointers that point to this declaration N
anchor The anchor of this pointer; a declaration may link back here ref_pointer_1
target The anchor of the declaration; the pointer should link to this anchor ref_declaration_1
Template:Ref:Declaration:DefaultRenderer edit
{{{index}}}.&nbsp; 
{{#ifexpr:{{{pointer}}} <= 1 | <span id="{{{anchor}}}" class="reference"> }}
{{#switch:{{{count}}}
    | 0 = <b>^</b>
    | 1 = <b>[[{{{target}}}|^]]</b>
    #default = [[{{{target}}}|#switch:{{{pointer}}}|1=a|2=b|3=c|4=d|5=e|6=f| ...]] 
}}
{{#ifeq:{{{pointer}}} | {{{count}}} | &nbsp;{{{text}}}</span> }}

Block Renderers edit

Template:Ref:Block:HeaderRenderer edit
Template:Ref:Block:FooterRenderer edit

Demo edit

Notes, Citations and References edit

'''Java''' is a [[programming language]] originally developed by [[Sun Microsystems]] 
and released in 1995 as a core component of Sun Microsystems' [[Java (Sun)|Java platform]]. 
The language derives much of its [[Syntax of programming languages|syntax]] from [[C 
(programming language)|C]]<ref name="syntax"/> and [[C++]]<ref name="syntax1"/> but has
 a simpler [[object model]]<ref name="object model"/> and fewer low-level facilities. 
Java applications are typically [[compiler|compiled]] to [[Java bytecode|bytecode]] 
that can run on any [[Java virtual machine]] (JVM) regardless of [[computer architecture]]. 
Sun's trademark license for usage of the Java brand insists that all implementations be
"compatible"<ref name="lawsuit"/>. 

==Notes==
<references:notes>
  <ref name="lawsuite">
    This resulted from a legal dispute with [[Microsoft]] after Sun claimed that the Microsoft
    implementation did not support [[Java remote method invocation|RMI]] or [[Java Native
    Interface|JNI]] and had added platform-specific features of their own. Sun sued in 1997, 
    and in 2001 won a settlement of $20 million as well as a court order enforcing the terms of
    the license from Sun.<ref name="lawsuite javaworld"/>
  </ref> 
</reference:notes>

==Citations==
<references:citations>
  <ref name="JvW"><ref name="van Wyhe 2008"/>, p. 121</ref>


</references:citations>

==References==
<references:references>
  <references>

    <ref:book name="spec"
      author
[[James Gosling]], [[Bill Joy]], [[Guy L. Steele, Jr.|Guy Steele]], and [[Gilad Bracha]], ''The Java language specification'', third edition. Addison-Wesley, 2005. ISBN 0-321-24678-0 (see also [http://java.sun.com/docs/books/jls/index.html online edition of the specification]

    <ref:news name="lawsuit javaworld"
      author="James Niccolai"
      title="Sun, Microsoft settle Java lawsuit"
      url="http://www.javaworld.com/javaworld/jw-01-2001/jw-0124-iw-mssuncourt.html"
      work="JavaWorld"
      publisher="[[IDG]]"
      date="January 23, 2001"
      accessdate="2008-07-09"
    </ref:news>
  </references>
</references:references>