Skip to main content

A tool for dynamically generating markdown files using references to commands.

Project description

Sour 🥒

Build Status Ruff Python Version License: MIT

Sour is a tool for dynamically generating and maintaining markdown files using references to commands and external sources.

🤖 Why Sour?

We are entering the Agentic Era.

In this new paradigm, documentation is no longer just for humans, it's the primary interface for AI Agents. In addition to the existing set of README.mds you have in your codebase, you now need files like AGENTS.md, CLAUDE.md, and GitHub's instruction files, all critical for guiding autonomous agents.

The quality of an agent's output can degrade significantly if there is outdated or false context in your documentation.

Sour solves this by allowing you to generate your documentation from the source of truth. Instead of copy-pasting output, you define how to generate it, ensuring your docs are always 100% accurate.

🏗️ Why not Quarto?

DRY (Don't Repeat Yourself): Quarto is fantastic, but often relies on templates which can introduce duplication. Sour is designed to inject truth directly into your existing markdown files without the need for a complex build chain or intermediate template files.

Simplicity: Quarto is a large, powerful ecosystem. Sour is a small, sharp tool designed specifically for maintaining context for Agents. It does one thing and does it well.

🔒 Safety First

No Arbitrary Execution: Unlike tools that allow running arbitrary bash commands in your documentation (an agentic security nightmare), Sour relies on typed, checked Extensions.

Secure by Design: You define exactly what code can run via extensions. This prevents agents or malicious actors from using your documentation build system as a privilege escalation vector.

✨ Extensions

Sour is designed around Extensions. It comes with powerful built-ins, but you can easily write your own in Python.

🌳 Tree Extension

Automatically visualize your directory structure. It's smart enough to pull descriptions from nested README.md files to annotate your tree.

<!-- docs TREE path="." depth=2 dirs_only=true -->

\```
.
├── examples
│   └── nested # A nested directory for testing tree descriptions
├── src
│   └── sour
└── tests
    └── __pycache__
\```

<!-- /docs -->

🤖 Just Extension

Embed recipes from your justfile directly into your docs. Perfect for "Quick Start" sections.

<!-- docs JUST recipe="test" -->

Run all tests

\```bash
just test
\```

<!-- /docs -->

🔌 Extensible

Add your own extensions by defining a Python function.

# scripts/extensions.py
from sour import register_extension

@register_extension("HELLO")
def hello(content, options, file_path):
    name = options.get("name", "World")
    return f"Hello {name}!"

Usage:

<!-- docs HELLO name="Sour" -->

Hello Sour!

<!-- /docs -->

📈 Star History

Star History Chart

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

sour-0.1.0.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sour-0.1.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file sour-0.1.0.tar.gz.

File metadata

  • Download URL: sour-0.1.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sour-0.1.0.tar.gz
Algorithm Hash digest
SHA256 58f8c71c129bf5aba3ad0059723be77d58b290d4f12361ae34ffc21d2e2be58d
MD5 8dc72df8ad1f63be8b7dd9e59012e393
BLAKE2b-256 20c909a9470c4dbd448507366ebad2341c879eeb2036285b8b4028ed543b2550

See more details on using hashes here.

File details

Details for the file sour-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sour-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sour-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbd63ff789de4372bd1ff855e4fbd2e426cb4ecb0b208061da521e494ce558d2
MD5 5a42e89c698d86e1fc2698b3d563bea7
BLAKE2b-256 7bd7acfe14ef5e9b2a768cf003d7426c8d5de9da075967fa840863808c4565a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page