Doc Widgets#

The purpose of a doc widget is to navigate a document, in a doc panel. It can:

  • Highlight a “selection” in a document, meaning an arbitrary union of boxes

  • Cause a document to auto-scroll to make such a selection visible

Its visual appearance is like a link, i.e. clickable text.

Format#

  • TYPE: doc

  • NAME: Optional.

  • LABEL: Required. Appears as clickable text in the page.

  • ROLE_FIELD: sel

  • CONTENT_FIELD: None.

Fields#

Required#

No field is required on its own, but, among doc and sel, at least one must be given.

Optional#

Field

Type

Description

doc

libpath

Indicate which document you are trying to point to, by giving a relative libpath that resolves to a doc info object.

This field is optional because you may specify the document instead as a part of the sel field (formats (1) and (3)).

group

string / int

See Navigation groups.

sel

Indicate a desired selection within the document.

If not given, then doc must be given, and the widget will simply cause the document to load, without highlighting any particular selection within it.

    (1)

libpath

You can use a libpath to point to a node. In this case, the node must define a doc label, and the widget will then point to the exact same document selection that the node does.

This is the preferred format, and should be used whenever possible. See Reuse doc labels whenever possible.

    (2)

string

If you used the doc field to specify the document, then the sel field can be a box combiner code.

    (3)

string

If you omitted the doc field, then the sel field can be in the full Doc ref string format.