Directives in the JavaScript domain¶
The domain name is js
. See https://www.sphinx-doc.org/en/master/usage/domains/javascript.html.
- $.myFunction(href, callback[, errback])¶
The
.. js:function::
directive, showing a JavaScript function or method.- Arguments:
href (
string()
) – An URI to the location of the resource.callback – Gets called with the object.
errback – Gets called in case the request fails. And a lot of other text so we need multiple lines.
- Throws:
SomeError()
– For whatever reason in that case.- Returns:
Something.
- $.myMethod(href, callback[, errback])¶
The
.. js:method::
directive (an alias for.. js:function::
, showing a function that is implemented as a method on a class object.
- class MyClass(name[, num])¶
The
.. js:class::
directive, showing a JavaScript object.- Arguments:
name (
string()
) – A namenum (
number()
) – An optional number
- my_variable¶
The
.. js:data::
directive, showing a global variable or constant.
- object.name¶
The
.. js:attribute::
directive, showing an attribute name of object.