class documentation

class JSObject(ObjectDescription[Tuple[str, str]]):

Known subclasses: sphinx.domains.javascript.JSCallable

View In Hierarchy

Description of a JavaScript object.
Method add​_target​_and​_index Undocumented
Method after​_content Handle object de-nesting after content
Method before​_content Handle object nesting before content
Method get​_display​_prefix Undocumented
Method get​_index​_text Undocumented
Method handle​_signature Breaks down construct signatures
Method make​_old​_id Generate old styled node_id for JS objects.
Class Variable allow​_nesting Undocumented
Class Variable has​_arguments Undocumented
Class Variable option​_spec Undocumented
def add_target_and_index(self, name_obj, sig, signode):

Undocumented

Parameters
name​_obj:Tuple[str, str]Undocumented
sig:strUndocumented
signode:desc_signatureUndocumented
def after_content(self):

Handle object de-nesting after content

If this class is a nestable object, removing the last nested class prefix ends further nesting in the object.

If this class is not a nestable object, the list of classes should not be altered as we didn't affect the nesting levels in before_content.

def before_content(self):

Handle object nesting before content

JSObject represents JavaScript language constructs. For constructs that are nestable, this method will build up a stack of the nesting hierarchy so that it can be later de-nested correctly, in after_content.

For constructs that aren't nestable, the stack is bypassed, and instead only the most recent object is tracked. This object prefix name will be removed with after_content.

The following keys are used in self.env.ref_context:

js:objects
Stores the object prefix history. With each nested element, we add the object prefix to this list. When we exit that object's nesting level, after_content is triggered and the prefix is removed from the end of the list.
js:object
Current object prefix. This should generally reflect the last element in the prefix history
def get_display_prefix(self):

Undocumented

Returns
List[Node]Undocumented
def get_index_text(self, objectname, name_obj):

Undocumented

Parameters
objectname:strUndocumented
name​_obj:Tuple[str, str]Undocumented
Returns
strUndocumented
def handle_signature(self, sig, signode):

Breaks down construct signatures

Parses out prefix and argument list from construct definition. The namespace and class will be determined by the nesting of domain directives.

Parameters
sig:strUndocumented
signode:desc_signatureUndocumented
Returns
Tuple[str, str]Undocumented
def make_old_id(self, fullname):

Generate old styled node_id for JS objects.

Note

Old Styled node_id was used until Sphinx-3.0. This will be removed in Sphinx-5.0.

Parameters
fullname:strUndocumented
Returns
strUndocumented
allow_nesting: bool =

Undocumented

has_arguments: bool =

Undocumented

option_spec: OptionSpec =

Undocumented