Skip to main content

mkdocs-decision-records

PyPI version PyPI - Downloads LICENSE CircleCI codecov Quality Gate Status Code Smells Maintainability Rating Security Rating Renovate


Manage decision records with mkdocs in a customizable and minimal fashion.

Features

  • Customizable status colors and lifecycle
  • Enforces information to be present for ADRs
  • Allows description being kept as markdown

Demo

You can find a Demo on GitHub Pages

Installation

  1. Install mkdocs-decision-records from the PyPi registry using your favorite package manager
  2. Configure your mkdocs.yml
    plugins:
    - decision-records:
        # Folder where your decision records are located, defaults to adr
        decisions_folder: adr
        # Optional prefix to prepend to ticket numbers
        ticket_url_prefix: https://ticket.example.com/
        # Configure amount of required deciders
        required_deciders_count: 1
        # Configure the length of decision IDs (default: 3)
        decision_id_length: 3
        # Enable validation that IDs match the configured length (default: false)
        # When enabled, IDs that don't match the configured length will be rejected
        validate_id_length: false
        # Configure available stages and the badge colors
        lifecycle_stages:
          {status}: {color}
    
  3. Create your ADRs ensuring to add the frontmatter meta data:
    ---
    id: 000
    status: proposed | rejected | accepted | deprecated | … | superseded
    [superseded_by: <id it has been replaced with>]
    date: YYYY-MM-DD
    deciders:
       - decider 1
       - decider 2
    # Optional ticket
    ticket: FOO-1
    ---
    
    ## Context and Problem Statement
    
    [Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.]
    
    ## Decision Drivers <!-- optional -->
    
    * [driver 1, e.g., a force, facing concern, …]
    * [driver 2, e.g., a force, facing concern, …]
    * … <!-- numbers of drivers can vary -->
    
    ## Considered Options
    
    * [option 1]
    * [option 2]
    * [option 3]
    
    ## Decision Outcome
    
    Chosen option: "[option 1]",
    because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)].
    
    ## Pros and Cons of the Options <!-- optional -->
    
    ### [option 1]
    
    [example | description | pointer to more information | …] <!-- optional -->
    
    * Good, because [argument a]
    * Good, because [argument b]
    * Bad, because [argument c]
    * … <!-- numbers of pros and cons can vary -->
    
    ### [option 2]
    
    [example | description | pointer to more information | …] <!-- optional -->
    
    * Good, because [argument a]
    * Good, because [argument b]
    * Bad, because [argument c]
    * … <!-- numbers of pros and cons can vary -->
    
    ### [option 3]
    
    [example | description | pointer to more information | …] <!-- optional -->
    
    * Good, because [argument a]
    * Good, because [argument b]
    * Bad, because [argument c]
    * … <!-- numbers of pros and cons can vary -->
    
    ## Links <!-- optional -->
    
    * [Link type] [Link to ADR] <!-- example: Refined by [ADR-0005](0005-example.md) -->
    * … <!-- numbers of links can vary -->
    

Superseding ADRs

This plugin is opinionated about using superseded status.

When setting the status to superseded, make to sure also set superseded_by to the ADR id it has been replaced with.

---
# adr details
status: superseded
superseded_by: 123
---
<!-- Deprecated ADR -->

Generated decision index

On every build, the plugin writes a decision_index.json to the root of the built site (e.g. site/decision_index.json). It contains one entry per decision record (templates excluded), and can be used to build custom search or listing features on top of the generated site.

Each entry has the shape:

{
  "id": "000",
  "date": "2024-01-01",
  "title": "Example decision",
  "status": "accepted",
  "toc": "...",
  "sections": [
    { "title": "Context and Problem Statement", "text": "..." }
  ],
  "superseded_by": "001"
}
  • toc is the page's table of contents, as produced by MkDocs
  • sections lists the page's headings with their rendered text content
  • superseded_by is only present when status is superseded

Motivation

I love ADRs and documenting decisions in general. This plugin makes it a bit easier, enforcing basic meta information while keeping the format open enough so you can do your thing.

Contributing

I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the configuration
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

To get started please read the Contribution Guidelines.

Development

Requirements

  • Python 3.12+
  • Poetry

Build

poetry install

Alternatives

Download files

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

Source Distribution

mkdocs_decision_records-2.4.3.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_decision_records-2.4.3-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_decision_records-2.4.3.tar.gz.

File metadata

  • Download URL: mkdocs_decision_records-2.4.3.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"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 mkdocs_decision_records-2.4.3.tar.gz
Algorithm Hash digest
SHA256 15adee5fa3454a15ac290b5eca7526b41db58c64425a3e15dddb87db449d77ac
MD5 0c26f9d4548eb90276b9dc8d8d19d1d4
BLAKE2b-256 e509157344ab7398bed87d66729876c4a0fbddde197a8184ea892eab7a233272

See more details on using hashes here.

File details

Details for the file mkdocs_decision_records-2.4.3-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_decision_records-2.4.3-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"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 mkdocs_decision_records-2.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ca071be9f12c602e7714837e8ef3d19dd07049754734a70b1a4f94db40312fab
MD5 1fbcd8816af8ad992ad4345e9a84546a
BLAKE2b-256 1da4db93956d769aa60b7a8cffe02ac5eb1017e639aa0ee9c3f60c72079e101a

See more details on using hashes here.

Release history Release notifications | RSS feed

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

2.4.4

2 files

This release

2.4.3 This release

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.0

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 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