mmo-element-doc
1 symbol · generated 30 Sep 2026
mmo-element-doc
mmo-element-doc.jhs:1Documents any .jhs custom element, from the element itself.
- Extends
- CustomShadowElement
Index
| element | the tag name to document (mmo-icon). | |
| tag readonly accessor | ||
| constructor() | ||
| init() | ||
| load() | Re-read the documented element and rebuild the page. | |
| read(tag) | Read the documentation of an element: what its jsdoc declared, plus the slots its shadow root actually has -- a slot nobody documented is still a slot, and hiding it would be a lie. | |
| readPreset() | Read the configurator's starting point from the preset slot. | |
| reset() | Put the configurator back to what the preset asks for. | |
| cycleGround() | Show the preview on the next ground: what looks right on white can vanish on ink. | |
| renderConfig() | Build one control per attribute, class and slot. | |
| renderGroup(parent, title, rows) | Add one titled group of rows to the configurator, unless it would be empty. | |
| row(toggle, name, field, description) | One line of the configurator: a switch, a name, a field and what it is for. | |
| update() | Rebuild the preview from the current configuration, and the html that would produce it. | |
| html(tag, attributes, content) | Write the configured element out as a page would: attributes in order, slotted children one per line, nothing the reader would have to delete. | |
| copy() | Copy the generated html. | |
| renderReference() | Build the reference tables, in the order a reader needs them. | |
| table(parent, title, head, rows) | Add one reference table, unless the element has nothing to put in it. | |
| clean(text) | jsdoc writes @attr name - what it does: the dash is a separator, not part of the sentence. | |
| value(value) | Render a default value for the reference: an em dash when there is none. | |
| preset | a <script type="application/json"> giving the configurator its starting point: attributes (per name: value, values to offer, type), classes already on, slots with their starting conte… | |
| (default) | anything to show under the reference, for a page that has more to say. | |
| .compact | hide the configurator and show the preview and the reference only |
Attributes1
element
mmo-element-doc.jhsthe tag name to document (mmo-icon). Changing it re-reads everything.
element
Properties1
tag
readonlyaccessormmo-element-doc.jhs:97- Type
string
Methods17
constructor()
mmo-element-doc.jhs:79init()
mmo-element-doc.jhs:87load()
mmo-element-doc.jhs:104Re-read the documented element and rebuild the page. Called on init and whenever the element attribute changes.
| returns | void |
read(tag)
mmo-element-doc.jhs:129Read the documentation of an element: what its jsdoc declared, plus the slots its shadow root actually has -- a slot nobody documented is still a slot, and hiding it would be a lie.
| tag | string | |
| returns | ?object |
readPreset()
mmo-element-doc.jhs:155Read the configurator's starting point from the preset slot.
| returns | object | the preset slot's json, or an empty preset |
reset()
mmo-element-doc.jhs:170Put the configurator back to what the preset asks for.
| returns | void |
cycleGround()
mmo-element-doc.jhs:200Show the preview on the next ground: what looks right on white can vanish on ink.
| returns | void |
renderConfig()
mmo-element-doc.jhs:209Build one control per attribute, class and slot. @return {void}
renderGroup(parent, title, rows)
mmo-element-doc.jhs:259Add one titled group of rows to the configurator, unless it would be empty.
| parent | HTMLElement | |
| title | string | |
| rows | Array | |
| returns | void |
row(toggle, name, field, description)
mmo-element-doc.jhs:274One line of the configurator: a switch, a name, a field and what it is for.
| toggle | ?HTMLElement | |
| name | string | |
| field | ?HTMLElement | |
| description | string | |
| returns | HTMLElement |
update()
mmo-element-doc.jhs:290Rebuild the preview from the current configuration, and the html that would produce it.
| returns | void |
html(tag, attributes, content)
mmo-element-doc.jhs:322Write the configured element out as a page would: attributes in order, slotted children one per line, nothing the reader would have to delete.
| tag | string | |
| attributes | NamedNodeMap | |
| content | string | |
| returns | string | the html of the configured element, as a page would write it |
copy()
mmo-element-doc.jhs:339Copy the generated html.
| returns | void |
renderReference()
mmo-element-doc.jhs:350Build the reference tables, in the order a reader needs them. @return {void}
table(parent, title, head, rows)
mmo-element-doc.jhs:382Add one reference table, unless the element has nothing to put in it.
| parent | HTMLElement | |
| title | string | |
| head | Array<string> | |
| rows | Array<Array<string>> | |
| returns | void |
clean(text)
mmo-element-doc.jhs:405jsdoc writes @attr name - what it does: the dash is a separator, not part of the sentence.
| text | ?string | |
| returns | string |
value(value)
mmo-element-doc.jhs:414Render a default value for the reference: an em dash when there is none.
| value | * | |
| returns | string |
Slots2
preset
mmo-element-doc.jhsa <script type="application/json"> giving the configurator its starting point: attributes (per name: value, values to offer, type), classes already on, slots with their starting content, and ground (surface, bg or ink).
<slot name="preset">
(default)
mmo-element-doc.jhsanything to show under the reference, for a page that has more to say.
<slot>
CSS hooks1
.compact
mmo-element-doc.jhshide the configurator and show the preview and the reference only
.compact