Executable documentation smoke tests for Markdown snippets.
Project description
docsmoke
docsmoke validates executable Markdown snippets before they drift out of sync
with the software they document.
It is built for maintainers who want docs to fail like code: run the fenced
shell and Python examples in README.md and docs/, assert on expected
output, and fail CI when installation guides or CLI examples stop working.
Highlights
- Markdown-native snippet discovery with explicit
docsmokeopt-in markers - Built-in shell and Python executors
- Per-snippet directives for timeouts, expectations, environment variables, working directories, and skips
- CLI, JSON, and Markdown reporting
- GitHub Action for CI usage
- Typed Python package with strict linting, mypy, pytest, pre-commit, Docker, and release automation
Quick start
python3.11 -m pip install docsmoke
docsmoke --help
Mark runnable snippets in Markdown:
```bash docsmoke
# docsmoke: name=quickstart; expect-contains=passed
docsmoke scan README.md --quiet
```
Run a scan:
# docsmoke: expect-contains=list-snippets
docsmoke --help
List what would run:
# docsmoke: expect-contains=example-snippet
docsmoke list-snippets examples --json
Directive syntax
Directives live in the first lines of a runnable fenced block:
```bash docsmoke
# docsmoke: name=install-check
# docsmoke: cwd=examples
# docsmoke: expect-contains=hello
printf 'hello\n'
```
Supported directives:
name=<value>: human-friendly snippet labelcwd=<path>: working directory relative to the project roottimeout=<seconds>: positive per-snippet timeoutexpect-contains=<text>: required stdout or stderr substringexpect-regex=<pattern>: required regex match against stdout or stderrenv.NAME=<value>: environment variable overrideshell=<binary>: shell override for shell snippetsskip[=true|false]: skip the snippet without removing it
GitHub Action
Use the moving @v1 tag to receive compatible 1.x fixes automatically, or
pin an exact release such as @v1.0.0 for fully reproducible workflow inputs.
- uses: dev-ugurkontel/docsmoke@v1
with:
paths: README.md docs examples
Documentation
- docs/INSTALL.md: installation options
- docs/USAGE.md: CLI usage and workflows
- docs/CONFIG.md: configuration file reference
- docs/ARCHITECTURE.md: internal architecture
- docs/RELEASE.md: release and tag-management process
- docs/REPOSITORY.md: repository settings checklist
- CONTRIBUTING.md: contribution workflow
- SECURITY.md: private vulnerability disclosure
- SUPPORT.md: usage help and issue routing
Development
make all
License
Apache 2.0 licensed. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docsmoke-1.0.0.tar.gz.
File metadata
- Download URL: docsmoke-1.0.0.tar.gz
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b58431a8764d9afbcc04c217c9484d1774e47443b69b9fd9360991ef15bbe8d
|
|
| MD5 |
a1dbf92df8fadfd82ba94600f47bf3c2
|
|
| BLAKE2b-256 |
c0c6b0341be9b9ebb4a3792af0ca632516547a316ef80c666b2e12d52a0ed597
|
Provenance
The following attestation bundles were made for docsmoke-1.0.0.tar.gz:
Publisher:
release.yml on dev-ugurkontel/docsmoke
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docsmoke-1.0.0.tar.gz -
Subject digest:
7b58431a8764d9afbcc04c217c9484d1774e47443b69b9fd9360991ef15bbe8d - Sigstore transparency entry: 1353057288
- Sigstore integration time:
-
Permalink:
dev-ugurkontel/docsmoke@c32642cff1012e985a640f499d861ed4abf7d5ed -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/dev-ugurkontel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c32642cff1012e985a640f499d861ed4abf7d5ed -
Trigger Event:
push
-
Statement type:
File details
Details for the file docsmoke-1.0.0-py3-none-any.whl.
File metadata
- Download URL: docsmoke-1.0.0-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d52ad90b0b7c7c3e08021a0ba949f57eaf96f8d2f4d7111b32911b8b678474d
|
|
| MD5 |
527d372add864caffe094d326cbdc9ea
|
|
| BLAKE2b-256 |
a0e26b0b91105e195ec9764a33246f17be68a126c2205abd2c90053b3f05443c
|
Provenance
The following attestation bundles were made for docsmoke-1.0.0-py3-none-any.whl:
Publisher:
release.yml on dev-ugurkontel/docsmoke
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docsmoke-1.0.0-py3-none-any.whl -
Subject digest:
4d52ad90b0b7c7c3e08021a0ba949f57eaf96f8d2f4d7111b32911b8b678474d - Sigstore transparency entry: 1353057334
- Sigstore integration time:
-
Permalink:
dev-ugurkontel/docsmoke@c32642cff1012e985a640f499d861ed4abf7d5ed -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/dev-ugurkontel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c32642cff1012e985a640f499d861ed4abf7d5ed -
Trigger Event:
push
-
Statement type: