Skip to main content

API Reference

remarklet() ⇒ void

The interface for the Remarklet library.

Kind: Exported function

remarklet.activate() ⇒ void

Activates the Remarklet library, initializing all necessary components.

Kind: static method of remarklet
Since: 1.0.0

remarklet.deactivate() ⇒ void

Deactivates the Remarklet library, cleaning up any resources or event listeners. Note, to activate this method using an event listener, you need to use the capture option. See this issue for more details on that: #149.

Kind: static method of remarklet
Since: 1.0.0
Example

document.body.addEventListener("click", function(e) {
// Deactivate the library if the event target is the deactivate button.
if ("deactivate" === e.target.id) {
remarklet.deactivate();
}
// Ignore other clicked elements.
}, { capture: true });
remarklet.activate();

remarklet.version : string

Get the current version of the Remarklet library.

Kind: static property of remarklet
Read only: true
Since: 1.0.2

remarklet.options(options) ⇒ void

Configures the library's features.

Kind: static method of remarklet
Since: 1.1.0

ParamTypeDescription
optionsObjectThe configuration options.
options.persistbooleanWhether to persist the state of the page between sessions.
options.hidebooleanWhether to hide certain elements.

remarklet.restore() ⇒ void

Restores the persisted changes, if any. Runs before the interactive features are initialized.

Kind: static method of remarklet
Since: 1.2.0