Skip to content
Skills Library
Documents & office · Learning & explanation

authoring

/authoring

How to write Stencila Markdown (.smd) and work with executable documents in related flavours (.myst, .qmd). Use when creating or editing .smd files, adding executable code chunks, inline expressions, parameters, figures, tables, math, or document metadata, or when unsure how Stencila Markdown differs from plain Markdown.

Repository
stencila ↗
Licence
Apache-2.0
Last repository change
28.10.2026

Assessment and security

95/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content30 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
14
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

How to write Stencila Markdown (.smd) and work with executable documents in related flavours (.myst, .qmd). Use when creating or editing .smd files, adding executable code chunks, inline expressions, parameters, figures, tables, math, or document metadata, or when unsure how Stencila Markdown differs from plain Markdown.

Original author description

How to write Stencila Markdown (.smd) and work with executable documents in related flavours (.myst, .qmd). Use when creating or editing .smd files, adding executable code chunks, inline expressions, parameters, figures, tables, math, or document metadata, or when unsure how Stencila Markdown differs from plain Markdown.

How it works

  1. What differs from CommonMark
  2. Reference files
  3. Verifying your work
Original SKILL.md headings · 131 lines, 537 words
SKILL.md preview
---
name: authoring
description: How to write Stencila Markdown (.smd) and work with executable documents in related flavours (.myst, .qmd). Use when creating or editing .smd files, adding executable code chunks, inline expressions, parameters, figures, tables, math, or document metadata, or when unsure how Stencila Markdown differs from plain Markdown.
user-invocable: false
---

# Authoring Stencila documents

Stencila Markdown (`.smd`) is CommonMark plus a small set of extensions for
executable, reproducible documents. Stencila also parses MyST (`.myst`) and
Quarto (`.qmd`) Markdown; prefer `.smd` for new documents unless the user
already works in one of those ecosystems, in which case keep their format.
The Markdown parser auto-detects the flavour, so `--from` is rarely needed.

Minimum CLI version: 2.14. Verify a document parses with:

```sh
NO_COLOR=1 stencila convert doc.smd --to json --yes > /dev/null
```

## What differs from CommonMark

The constructs below are the ones worth double-checking; everything else
(headings, emphasis, links, lists, block quotes) is standard Markdown.

### Executable code: `exec`

A fenced code block with the `exec` keyword executes when the document is
rendered, and its outputs become part of the document:

````smd
```python exec
import pandas as pd
data = pd.read_csv("data.csv")
data.describe()
```
````

Without `exec` a code block is static, display-only code. Do not confuse
`exec` with `demo`: `demo` parses-and-renders the block content as document
source without executing anything — it is for documentation that shows
source alongside rendered output.

Execution modes go after `exec` (e.g. `always` to re-run on every execution,
`lock` to preserve existing outputs):

````smd
```r exec always
plot(data)
```
````

### Inline expressions

Backtick code with a language tag and `exec` in braces embeds a computed
value in prose:

```smd
The answer is `6 * 7`{python exec}.
```

Without `exec` (e.g. `` `2 * pi`{python} ``) it is just static inline code
with a language.

### Parameters

Named inputs that can be supplied at render time with
`stencila render doc.smd out.html -- --name=value`:

```smd
Analysis for &[year]{int def=2024} using threshold &[cutoff]{num def=0.05}.
```

### Frontmatter

YAML frontmatter carries metadata (title, authors, description):

```smd
---
title: Analysis of penguin morphology
description: Bill dimensions across three species.
---

# Introduction
```

### Figures, tables, and other colon-fenced blocks

Captioned, labelled figures and tables wrap content in `::: figure` /
`::: table` blocks; code chunks inside them produce the figure or table
content:

````smd
::: figure 1

```r exec
plot(y ~ x)
```

Y against X.

:::
````

## Reference files

Read the relevant reference before writing a construct you are not sure
about — they are generated from Stencila's own documentation and are
authoritative:

| Topic | Reference |
|---|---|
| Document structure, headings, paragraphs | `references/basics.md` |
| Static code blocks and inline code | `references/code.md` |
| Executable chunks, expressions, modes, parameters | `references/execution.md` |
| Including other documents, calling with arguments | `references/include-call.md` |
| Math (TeX and AsciiMath, block and inline) | `references/math.md` |
| Figures, captions, labels | `references/figures.md` |
| Tables, captioned tables | `references/tables.md` |
| Lists, checklists | `references/lists.md` |
| Admonitions / callouts | `references/admonitions.md` |
| Sections and semantic structure | `references/sections.md` |
| Frontmatter metadata | `references/metadata.md` |
| Images, audio, video | `references/media.md` |
| Footnotes | `references/notes.md` |

## Verifying your work

After writing or editing a Stencila document:

1. Lint it: `NO_COLOR=1 stencila lint doc.smd --as json --yes`
2. If it has executable code, render it and check for execution errors
   (see the `execution` skill for how execution and staleness work).

Never report an executable document as finished without executing it.
Files in this package (14)
  • SKILL.md 4 KB
  • references/admonitions.md 1 KB
  • references/basics.md 3 KB
  • references/code.md 2 KB
  • references/execution.md 3 KB
  • references/figures.md 22 KB
  • references/include-call.md 2 KB
  • references/lists.md 2 KB
  • references/math.md 1 KB
  • references/media.md 2 KB
  • references/metadata.md 5 KB
  • references/notes.md 2 KB
  • references/sections.md 3 KB
  • references/tables.md 2 KB

Versions

RepositoryScoreLicence
This page · stencila/stencila95Apache-2.0
CrowdStrike/fusion-skills100MIT
kbluck/agent-resources100MIT
nyelonong/galdr100MIT
OdradekAI/bundles-forge100Apache-2.0
josuecuguy1307/Multi-Auto-Setup98Apache-2.0

Database snapshot: 13.11.2026 · package version 927e111c4e06 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100mira-annotation
    Annotate Markdown documents with MIRA research objects and source-local relations. Use for md, smd, qmd, and myst files when identifying claims, evidence, questions, protocols, requests, typed claims, and relation attributes while preserving the original Markdown flavor and…
  • 100workspaces
    Stencila workspace configuration and document tracking - stencila.toml sections, stencila init, track/status/untrack/clean, and what lives in the .stencila/ directory. Use when configuring a Stencila project, setting up remotes or outputs, interpreting stencila status, or…
  • 100doc-parser
    Parse complex documents with IBM's open-source Docling library, which turns PDFs and Office files into structured Markdown or JSON. Use when a user asks to parse a document with tables, extract figures from a document, handle multi-column layouts, convert a complex PDF to…
  • 100md-document
    Convert authored markdown into a polished self-contained HTML document with a table of contents, numbered figures and tables, cross-references, footnotes, and print-ready CSS. Use when publishing a report, whitepaper, or memo.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.