createSectionHeading
Creates an auto-generated Heading for a structural section of the document (e.g. table of contents, bibliography).
The heading title is resolved from:
A user-provided title, if not
nulland not empty.A localized fallback from localizationKey, if title is
null.If neither resolves to text, the heading is still created with empty text when customId is set (to serve as a referenceable anchor), or omitted (
null) otherwise.
An explicitly empty title means no heading should be displayed at all.
The resulting heading is marked with Heading.excludeFromTableOfContents to prevent self-referencing in the document's table of contents.
Return
a Heading node, or null if title is explicitly empty or no title could be resolved and no customId is provided
Parameters
user-provided title content. If null, the default localized title from localizationKey is used. If empty, no heading is created.
key to look up the default localized title if title is null
context for localization
depth of the heading (1-6)
optional custom ID for cross-referencing. If set and no title is resolved, the heading is still created with empty text to act as an anchor
whether the heading can trigger an automatic page break
whether the heading's position should be tracked and numbered. Implicitly enabled when includeInTableOfContents is true.
whether this heading should be indexed in the document's table of contents. Implicitly enables canTrackLocation.