Expand all

ve.dm.MWDocumentReferences

Constructor

new ve.dm.MWDocumentReferences(doc) #

A facade providing a simplified and safe interface to Cite ref and references tags in a document.

Parameters:

Name Type Description
doc ve.dm.Document

The document that reference tags will be embedded in.

Mixes in:
Source:

A facade providing a simplified and safe interface to Cite ref and references tags in a document.

Properties

cachedByGroup :Object.<string, ve.dm.MWGroupReferences> #

Holds the information calculated for each group.

Type:

Source:
Holds the information calculated for each group.

Methods

getGroupRefs(groupName) → {ve.dm.MWGroupReferences} #

Parameters:

Name Type Description
groupName string

with or without prefix

Source:

Returns:

Type
ve.dm.MWGroupReferences

getIndexLabel(groupName, listKey) → {string} #

Parameters:

Name Type Description
groupName string

Ref group without prefix

listKey string

Ref key with prefix

Deprecated:
  • Should be refactored to store formatted index numbers as a simple property on each CE ref node after document transaction.
Source:

Returns:

Rendered index number string which can be used as a footnote marker or reflist item number.

Type
string

contentLangDigits(num) → {string}static #

Return a formatted number, in the content script, with no separators.

Partial clone of mw.language.convertNumber .

Parameters:

Name Type Description
num number
Source:

Returns:

Type
string
Return a formatted number, in the content script, with no separators.

refsForDoc(doc) → {ve.dm.MWDocumentReferences}static #

Singleton MWDocumentReferences for a document.

Parameters:

Name Type Description
doc ve.dm.Document

Source document associated with the singleton. May be a fragment in which case we only look at refs included in the fragment.

Source:

Returns:

Singleton docRefs

Type
ve.dm.MWDocumentReferences
Singleton MWDocumentReferences for a document.