Skip to main content

GrippyDoc

Prevent documentation drift by linking Markdown files to specific code.

GrippyDoc tracks code references in your documentation and alerts you when the code changes but the docs haven't been updated. Perfect for CI/CD pipelines to catch stale docs before they reach production.

Keep your docs gripping the code.

Installation

pip install grippydoc

Or install from source:

git clone https://github.com/grippydoc/grippydoc.git
cd grippydoc
pip install -e .

Quick Start

1. Reference Code in Your Docs

In your Markdown files, add grip references to code:

# Authentication

The login function handles user authentication:

[grip:src/auth.py:10-25]

For the full module, see:

[grip:src/auth.py]

2. Record the Current State

grippydoc record

This updates your markdown files in-place with content hashes:

[grip:src/auth.py:10-25 @a1b2c3d4e5f6g7h8]

3. Check for Drift

grippydoc check

If any referenced code has changed since the last record, GrippyDoc will:

  • List all stale documentation references
  • List any unrecorded references (missing hashes)
  • Exit with code 1 (useful for CI/CD)

Reference Syntax

Syntax Description
[grip:path/to/file.py] Track entire file
[grip:path/to/file.py:42] Track single line
[grip:path/to/file.py:42-58] Track line range
[grip:path/to/file.py#function_name] Track function by name
[grip:path/to/file.py#ClassName] Track class by name
[grip:path/to/file.py#ClassName.method] Track method by name
[grip:path/to/file.py#CONSTANT] Track top-level variable

After recording, hashes are appended inline: [grip:path/to/file.py:42-58 @a1b2c3d4]

Symbol References (Python only)

Symbol references let you track code by name instead of line numbers. This is more resilient to code changes that shift line numbers:

The authentication is handled by the login function:

[grip:src/auth.py#login]

The `Auth` class manages user sessions:

[grip:src/auth.py#Auth]

Specifically, the logout method:

[grip:src/auth.py#Auth.logout]

Symbol references support:

  • Functions (sync and async)
  • Classes
  • Methods (including nested classes)
  • Top-level variables and constants
  • Decorated functions and classes (includes decorator lines)

How It Works

┌─────────────────────────────────────────────────────────────────────┐
│                           SETUP PHASE                               │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│   docs/auth.md                        src/auth.py                   │
│  ┌────────────────────────┐         ┌────────────────────────┐      │
│  │ ## Login Flow          │         │ 10: def login(user):   │      │
│  │                        │         │ 11:     validate(user) │      │
│  │ [grip:src/auth.py:10-15] ───────▶│ 12:     token = gen()  │      │
│  │                        │         │ 13:     return token   │      │
│  │ The login function...  │         │ ...                    │      │
│  └────────────────────────┘         └────────────────────────┘      │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
                          ┌──────────────────┐
                          │ grippydoc record │
                          └────────┬─────────┘
                                   │ hashes lines 10-15
                                   ▼
                     ┌──────────────────────────────────┐
                     │  docs/auth.md (updated in-place) │
                     │  [grip:src/auth.py:10-15 @a1b2]  │
                     └──────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────┐
│                       CHECK PHASE (CI/CD)                           │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│   Developer changes src/auth.py line 12:                            │
│                                                                     │
│   - token = gen()                                                   │
│   + token = generate_secure_token()                                 │
│                                                                     │
│    ┌──────────────────┐     ┌─────────────────────────────────────┐ │
│    │ grippydoc check  │────▶│ ⚠ Stale: docs/auth.md:5            │ │
│    └──────────────────┘     │   [grip:src/auth.py:10-15]         │ │
│              │              │   Exit code: 1                      │ │
│              ▼              └─────────────────────────────────────┘ │
│         CI fails ❌                                                 │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘

CI/CD Integration

GitHub Actions:

- name: Check documentation freshness
  run: |
    pip install grippydoc
    grippydoc check

GitLab CI:

docs-check:
  script:
    - pip install grippydoc
    - grippydoc check

Commands

Command Description
grippydoc record Scan docs and record hashes of referenced code inline
grippydoc check Compare current code against recorded hashes
grippydoc status Show status of all tracked references

Why GrippyDoc?

  • Zero source code changes - References live in your docs, not your code
  • No extra files - Hashes are stored inline in your markdown
  • Simple syntax - Just [grip:file:lines] in Markdown
  • CI/CD ready - Exit code 1 on stale docs
  • Lightweight - No dependencies, pure Python

License

MIT

Metadata

Release files for grippydoc 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grippydoc 0.3.0
File Size Uploaded
grippydoc-0.3.0.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for grippydoc 0.3.0
File Interpreter ABI Platform
grippydoc-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.6 kB

Release files / grippydoc-0.3.0.tar.gz

Download URL grippydoc-0.3.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ed85cd49f9fbebf301cb9d56975aa4eae0e5c805bd7586f746022a39a98908b5
BLAKE2b-256 checksum
How to use checksums
caad8da7c7b6ed61338c35cc5b12f4bb44a8093173d4a4ecc1d33dad714b51ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 14, 2026.

Transparency log

Release files / grippydoc-0.3.0-py3-none-any.whl

Download URL grippydoc-0.3.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25461bc67478f7fbac75ac65858ccb9d7b3a686725ff2aaf785fa83ff5eba81e
BLAKE2b-256 checksum
How to use checksums
bc3e1bbed9cbebe80327fd3aad0b9469693d3376f4a1eddb32b194d545e450b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page