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.

Methods

getGroupRefsByParents(groupName) → {Object.<string, Array.<ve.dm.MWReferenceNode>>} #

Get all refs for a group, organized by parent ref

This is appropriate when rendering a reflist organized hierarchically by subrefs using the extends feature.

Parameters:

Name Type Description
groupName string

Filter by this group.

Source:

Returns:

Mapping from parent ref name to a list of its subrefs. Note that the top-level refs are under the null value.

Type
Object.<string, Array.<ve.dm.MWReferenceNode>>

Get all refs for a group, organized by parent ref

This is appropriate when rendering a reflist organized hierarchically by subrefs using the extends feature.

getIndexNumber(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 index numbers as a simple property in each 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

Source:

Returns:

Singleton docRefs

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