Nokome Bentley2 min read

Raw Block

Document content in a specific format

The content of the block is not decoded by any codecs and is output when the encoding format matches that of the raw block and the render option is used. Analogous to node types in Pandoc and MultiMarkdown.

Properties

The RawBlock type has these properties:

Name Description Type Inherited from JSON-LD @id Aliases
id The identifier for this item. String Entity schema:id -
format The format of the raw content. String - stencila:format -
content The raw content. Cord - stencila:content -
compilationDigest A digest of the format and content properties. CompilationDigest - stencila:compilationDigest compilation-digest, compilation_digest
compilationMessages Messages generated while parsing and transpiling the content into the css property. CompilationMessage* - stencila:compilationMessages compilation-messages, compilation_messages, compilationMessage, compilation-message, compilation_message
css A Cascading Style Sheet (CSS) generated from the content. String - stencila:css -
authors The authors of the content. Author* - schema:author author
provenance A summary of the provenance of the content. ProvenanceCount* - stencila:provenance -

Related

The RawBlock type is related to these types:

Formats

The RawBlock type can be encoded (serialized) to, and/or decoded (deserialized) from, these formats:

Format Encoding Decoding Support Notes
DOM HTML 🟢 No loss
HTML 🔷 Low loss
JATS
Markdown ⚠️ High loss Encoded using implemented function
Stencila Markdown ⚠️ High loss
Quarto Markdown ⚠️ High loss
MyST Markdown ⚠️ High loss
LLM Markdown ⚠️ High loss
LaTeX 🔷 Low loss 🔷 Low loss
PDF 🔷 Low loss
Plain text ⚠️ High loss
IPYNB 🔷 Low loss 🔷 Low loss
Microsoft Word DOCX 🔷 Low loss 🔷 Low loss
OpenDocument ODT 🔷 Low loss 🔷 Low loss
TeX 🔷 Low loss 🔷 Low loss
JSON 🟢 No loss 🟢 No loss
JSON+Zip 🟢 No loss 🟢 No loss
JSON5 🟢 No loss 🟢 No loss
JSON-LD 🟢 No loss 🟢 No loss
CBOR 🟢 No loss 🟢 No loss
CBOR+Zstandard 🟢 No loss 🟢 No loss
YAML 🟢 No loss 🟢 No loss
Lexical JSON 🔷 Low loss 🔷 Low loss
Koenig JSON 🔷 Low loss 🔷 Low loss
Pandoc AST 🔷 Low loss 🔷 Low loss
Directory
Stencila Web Bundle
Debug 🔷 Low loss

Bindings

The RawBlock type is represented in:

Testing

During property-based (a.k.a generative) testing, the properties of the RawBlock type are generated using the following strategies for each complexity level. Any optional properties that are not in this table are set to None.

Property Complexity Description Strategy
format Min+ Fixed as Markdown String::from("markdown")
High+ Generate a random string of up to 10 alphanumeric characters. r"[a-zA-Z0-9]{1,10}"
Max Generate an arbitrary string. String::arbitrary()
content Min+ Generate a simple fixed string. Cord::from("content")
Low+ Generate a random string of up to 10 alphanumeric characters (exclude whitespace which when leading or trailing causes issues for 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)
Max Generate an arbitrary string. String::arbitrary().prop_map(Cord::from)

Source

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