Skip to main content

Run commands against code blocks in reStructuredText and Markdown files.

Project description

Build Status codecov PyPI Documentation Status

doccmd

A command line tool for running commands against documentation files.

Installation

With pip

Requires Python 3.11+.

pip install doccmd

With Homebrew (macOS, Linux, WSL)

Requires Homebrew.

brew tap adamtheturtle/doccmd
brew install doccmd

Usage example

# Run mypy against the Python code blocks in README.md and CHANGELOG.rst
$ doccmd --language=python --command="mypy" README.md CHANGELOG.rst

# Run gofmt against the Go code blocks in README.md
# This will modify the README.md file in place
$ doccmd --language=go --command="gofmt -w" README.md

TODO:

  • Add documentation (automated, and link to it, and add pre-commits for Sphinx stuff, update urls.Source)

  • Release Homebrew

  • Release pre-commit hook

  • Verbose mode… “Running command “X” against README.rst example from line …”

  • Allow multiple languages (e.g. shellcheck versus shell, sh, bash)

  • Add license (also to sybil-extras)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doccmd-2024.9.11.3.tar.gz (20.0 kB view hashes)

Uploaded Source

Built Distribution

doccmd-2024.9.11.3-py2.py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft Sir Raditya Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page