Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Stencila examples

Mainly for testing.

assistants

The assistants folder is for testing Stencila's specialized AI assistants.

kernels

The kernels folder is for testing Stencila's execution kernels. Each subfolder contains examples related to one or more executable node types. Within those there are files illustrating the execution of those node types within one or more execution kernels. These examples are generally kept small so that they can be easily read as JSON when executed and outputted in the console e.g.

cargo run -p cli execute examples/kernels/code-chunk/hello-world-bash.md --to yaml

The make kernels recipe executes all kernels/**/*.md files into sibling kernels/**/*.json files. At present these are not snapshot tested for changes, but are likely to be in the future.

nodes

Each of the examples in the nodes directory is a Stencila Article containing examples of a particular type of document node. The primary purpose for these examples is providing a consistent set of tests fixtures across file formats.

The canonical source for each document is the file with the .json extension (e.g. the canonical source for the "paragraph" document is paragraph/paragraph.json). Other files, with the same file name stem but different extension (e.g. paragraph/paragraph.yaml) are generated by Stencila "codecs" when tests are run (and then subsequently checked for changes), and represent the same document, but in a different format. These alternative files thus represent "snapshots" of how each codec is working. This is really useful for automatically implementing regression testing for each codec.

To add a new example create a new folder and create a .json file within it containing examples of the document node you wish to test.

When adding new examples, or updating existing ones, to updated derived files (i.e. non-JSON files) do this,

make examples