The editor for which this mode is created.
The options for the mode. Each mode defines what fields this object contains.
Check that the options are okay. This method will throw if there are any unexpected options or mandatory options are missing.
The options to check.
Returns a URL to the documentation for an element. The element should be named according to the mappings reported by the resolve returned by "wed/mode".Mode.getAbsoluteResolver. The generic mode delegates the call to the metadata.
The name of the element.
The URL. If the value returned is undefined
, then URL is not
available. If the value returned is null
, the URL has not been loaded
yet.
The default implementation returns an empty array.
The generic mode's implementation merely returns what it has stored in its transformation registry.
Gets the mode options. The returned object should be considered frozen. You may inspect it, not modify it.
The base implementation returns an empty array.
The default implementaiton returns an empty array.
undefined
. The default implementation has no mode-specific
checks and thus not return a validator.
Gets the options that the mode wants wed to use with this mode.
The options. Callers are not allowed to modify the value returned.
Returns a short description for an element. The element should be named according to the mappings reported by the resolve returned by "wed/mode".Mode.getAbsoluteResolver. The generic mode delegates the call to the metadata.
The name of the element.
The description. If the value returned is undefined
, then the
description is not available. If the value returned is null
, the
description has not been loaded yet.
The template that checkOptions uses to check the options passed to this mode. Consider this object to be immutable.
Generated using TypeDoc
This is the class that implements the generic mode. This mode decorates all the elements of the file being edited. On the basis of the schema used by wed for validation, it allows the addition of the elements authorized by the schema.
Recognized options:
metadata
: this option can be a path (a string) pointing to a module that implements the metadata needed by the mode.autoinsert
: whether or not to fill newly inserted elements as much as possible. If this option is true, then when inserting a new element, the mode will try to detect whether the element has any mandatory children and if so will add these children to the element. For instance, iffoo
is invalid without the childbaz
then when insertingfoo
in the document, the following structure would be inserted<foo><baz></baz></foo>
. This automatic insertion of children happens only in non-ambiguous cases. Taking the same example as before, iffoo
could containa
orb
, then the mode won't add any children. This option istrue
by default.