Home

Text

This is an implementation of schema.org Text, adapted in Stencila Schema as a node type rather than a primitive string.

It exists so textual content can participate in the document tree with its own identity and metadata, which is useful for diffing, editing, and collaborative workflows. This differs from the primitive String type, which represents plain scalar string values outside the node model.

The main property is value.

Analogues

The following external types, elements, or nodes are similar to a Text:

  • schema.org Text: Direct schema.org source type, adapted in Stencila from a scalar data type into a first-class node.

  • HTML text node: Closest DOM analogue for literal text content, though Stencila text nodes can carry identity and metadata through Entity.

  • Pandoc Str: Close Pandoc analogue for plain inline text, though Pandoc splits spaces and line breaks into separate inline constructors.

  • MDAST Text: Closest MDAST analogue for text leaf nodes.

Properties

The Text type has these properties:

NameDescriptionTypeInherited from
valueThe value of the text contentCord-
compilationMessagesMessages generated while compiling the text.CompilationMessage*-
idThe identifier for this item.StringEntity

Related

The Text type is related to these types:

Bindings

The Text type is represented in:

Testing

During property-based (a.k.a generative) testing, the properties of the Text type are generated using the following strategies.

PropertyComplexityDescriptionStrategy
valueMin+Generate a fixed string of text.Cord::from("text")
Low+Generate a random string of up to 10 alphanumeric characters.r"[a-zA-Z0-9]{1,10}".prop_map(Cord::from)
High+Generate a random string of up to 100 alphanumeric characters, some special characters commonly used in prose, and whitespace.r"[a-zA-Z0-9 \t\-_.!?*+-/()'<>=]{1,100}".prop_map(Cord::from)
MaxGenerate an arbitrary string.String::arbitrary().prop_map(Cord::from)

This documentation was generated from Text.yaml by docs_types.rs.

© 2026 Stencila