A plugin to generate a summary of a ADR directory
Project description
mkdocs-macros-adr-summary
This is a macro plugin to generates summaries from a list of a ADR documents in a directory.
Examples and documentation can be found here
Quick start
Enable the plugin in mkdocs.yml
plugins:
- macros:
module_name: mkdocs_macros_adr_summary
Create a markdown page in your mkdocs website and use the adr_summary
macro providing
the path containing your ADR files relative to the mkdocs.yml
file.
# Summary
{{ adr_summary(adr_path="docs/adr") }}
More customization
The page output is generated using a jinja template, but you can provide a custom one. The file path
must still be relative to the mkdocs.yml
file.
# Summary
{{ adr_summary(adr_path="docs/adr", template_file="other.jinja") }}
The default template is:
## Document list
{% for d in documents %}
* [{{ d.title }}]({{ d.filename }})
* `{{ d.date.strftime('%d-%m-%Y') }}`
* `{{ d.file_path }}`
{% if d.statuses %}
* Statuses:
{% for status in d.statuses %}
* {{ status }}
{% endfor %}
{% endif %}
{% endfor %}
The document
variable in the jinja template is a Sequence of:
@dataclass
class ADRDocument:
file_path: str
title: str
date: Optional[date]
statuses: Optional[Sequence[str]]
Supported ADR formats
The only supported ADR format currently is the nygard
format, it is recommended to
use adr-tools to manage the directory.
Support for MADR versions 2 and 3 will be added with future iterations.
Commands for development
All the common commands used during development can be run using make targets:
make dev-dependencies
: Install dev requirementsmake update-dependencies
: Update dev requirementsmake test
: Run test suitemake check
: Run tests, code style and lint checksmake fix
: Run code style and lint automatic fixes (where possible)make docs
: Render the mkdocs website locally
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
Hashes for mkdocs_macros_adr_summary-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e72f60428f05c55560f2b7f118510578084d7edd6dead2e32f55276dacb2e980 |
|
MD5 | 8fbfd203ddfec8136d2deb227a116206 |
|
BLAKE2b-256 | 6b3644090ccb5291fcbef1fadd0171ba762ef8e3cb0a314e075126802b7926b3 |
Hashes for mkdocs_macros_adr_summary-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62beca9b0f3a7b1e9a03cf1fb299612a355aa7c268ecb5dc09e6a158485c0ee3 |
|
MD5 | 5b3adf3175f6a0f65d9f7c84f2fd76f1 |
|
BLAKE2b-256 | 94bdc5ef3fed82fb774c40a2ecfda8ef2bd279982c40107a7a13a843339f0da2 |