Stencila supports a range of document and data formats via codecs. Each codec converts to and from the Stencila schema, enabling bidirectional conversion between formats where supported.
Codecs encode external formats into Stencila's schema nodes and decode them back again. This mirrors Pandoc's approach: conversion goes through a canonical internal representation so any format with both directions can convert between each other. Some codecs are fully lossless (for example, JSON, CBOR, YAML), while others are lossy because the source format lacks structure for all Stencila nodes.
Stencila uses property testing to exercise codec round-trips and detect regressions; see rust/codecs/tests/proptests.rs for the property test suite. The examples/conversion folder contains snapshots of Stencila node types serialized into various formats, which are used for regression testing and documentation.
Deprecated formats directory and swb are not documented.