Home

Code Inline

This is an inline representation used in Stencila Schema for non-executable code.

It extends CodeStatic for short code fragments that appear within prose, preserving programming language and other code metadata without adding execution semantics. This keeps inline code aligned with the broader code model used throughout Stencila documents.

Key properties are primarily inherited from CodeStatic, especially code and programmingLanguage.

Analogues

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

Properties

The CodeInline type has these properties:

NameDescriptionTypeInherited from
codeThe code.CordCodeStatic
programmingLanguageThe programming language of the code.StringCodeStatic
authorsThe authors of the code.Author*CodeStatic
provenanceA summary of the provenance of the code.ProvenanceCount*CodeStatic
idThe identifier for this item.StringEntity

Related

The CodeInline type is related to these types:

Bindings

The CodeInline type is represented in:

Testing

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

PropertyComplexityDescriptionStrategy
codeMin+Generate a simple fixed string of code.Cord::from("code")
Low+Generate a random string of up to 10 alphanumeric characters (exclude whitespace whichcan be problematic in Markdown).r"[a-zA-Z0-9]{1,10}".prop_map(Cord::from)
High+Generate a random string of up to 100 characters (excluding control characters).r"[^\p{C}]{1,100}".prop_map(Cord::from)
MaxGenerate an arbitrary string.String::arbitrary().prop_map(Cord::from)
programmingLanguageMin+Do not generate a programming language.None
Low+Generate one of the well known programming language short names.option::of(r"(cpp)|(js)|(py)|(r)|(ts)")
High+Generate a random string of up to 10 alphanumeric characters.option::of(r"[a-zA-Z0-9]{1,10}")
MaxGenerate an arbitrary string.option::of(String::arbitrary())

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

© 2026 Stencila