Documentation generation system for Terraform/OpenTofu providers
Project description
๐ฝ๏ธ Plating
A sophisticated documentation generation system for Terraform/OpenTofu providers
Plating is a powerful documentation system that brings culinary elegance to technical documentation. Just as a chef carefully plates a dish, Plating helps you present your Terraform provider documentation beautifully.
โจ Features
- ๐ฏ Automatic Documentation Generation - Generate comprehensive docs from your provider code
- โจ Smart Component Adorning - Automatically create documentation templates for undocumented components
- ๐ฝ๏ธ Beautiful Plating - Render documentation with examples, schemas, and rich formatting
- ๐ Component Discovery - Automatically find and document resources, data sources, and functions
- ๐ Jinja2 Templates - Flexible templating with custom functions and filters
- ๐ Schema Integration - Extract and format provider schemas automatically
๐ฆ Prerequisites
Important: This project uses
uvfor Python environment and package management.
Install UV
Visit UV Documentation for more information.
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Using pipx (if you prefer)
pipx install uv
# Update UV to latest version
uv self update
๐ Getting Started
Installation
Note: Plating is currently in pre-release. Install from source for now.
Version Info: The version
0.0.1000-0is a pre-release identifier indicating active development. Expect the API and features to evolve as the project matures.
# Clone the repository
git clone https://github.com/provide-io/plating.git
cd plating
# Create virtual environment
uv venv
# Activate virtual environment
source .venv/bin/activate # On Linux/macOS
# or
.venv\Scripts\activate # On Windows
# Install dependencies
uv sync
Coming soon to PyPI:
# PyPI installation (not yet available)
# uv add plating
Quick Install from Git
# Install directly from GitHub
uv add git+https://github.com/provide-io/plating.git
๐ Usage Examples
1. Adorn Your Components
First, create .plating bundles for your undocumented components:
# Adorn all missing components
plating adorn
# Adorn only resources
plating adorn --component-type resource
2. Customize Templates
Edit the generated templates in .plating/docs/:
---
page_title: "Resource: my_resource"
---
# my_resource
{{ "{{ example('basic') }}" }}
## Schema
{{ "{{ schema() }}" }}
3. Generate Documentation
Render your documentation:
# Generate docs in ./docs directory
plating plate
# Custom output directory
plating plate --output-dir ./documentation
๐ Bundle Structure
Each component has a .plating bundle:
my_resource.plating/
โโโ docs/
โ โโโ my_resource.tmpl.md # Main template
โ โโโ _partial.md # Reusable partials (optional)
โโโ examples/
โ โโโ basic.tf # Example configurations
โ โโโ advanced.tf # (optional)
โ โโโ full_stack/ # Grouped examples (optional)
โ โโโ main.tf # Required entry point
โโโ fixtures/ # Test fixtures (optional)
โโโ data.json # Test data files
Note: The examples/ directory can contain:
.tffiles for resources/data sources (flat examples).pyfiles for Python API examples- Subdirectories with
main.tffor grouped examples that combine multiple components
๐จ Template Functions
Plating provides powerful template functions:
{{ "{{ schema() }}" }}- Render component schema as markdown table{{ "{{ example('name') }}" }}- Include an example file in a terraform code block{{ "{{ include('filename') }}" }}- Include a static partial file{{ "{{ render('filename') }}" }}- Render a dynamic template partial with current context
๐ Validation
Validate your generated documentation:
# Validate all documentation
plating validate
# Validate in custom directory
plating validate --output-dir ./documentation
๐ก๏ธ Foundation Integration
Plating is built on provide.foundation patterns for enterprise-grade reliability:
- ๐ Automatic Retries: Built-in retry policies with exponential backoff for I/O operations
- ๐ Metrics & Observability: Integrated performance tracking and operation metrics
- โก Circuit Breakers: Prevents cascading failures in distributed systems
- ๐ Structured Logging: Foundation logger integration with contextual information
- ๐ Async-First Design: High-performance async operations throughout
๐ง Advanced Usage
Filter to Specific Package
By default, Plating searches all installed packages for components. You can filter to a specific package:
plating adorn --package-name pyvider.components
plating plate --package-name pyvider.components
Generate Executable Examples
Generate standalone executable Terraform examples alongside documentation:
plating plate --generate-examples
Customize example output directories:
plating plate --generate-examples \
--examples-dir examples/ \
--grouped-examples-dir examples/integration/
๐ง Configuration
Configure Plating in your pyproject.toml:
[tool.plating]
# Provider name (auto-detected if not specified)
provider_name = "my_provider"
Note: Currently only provider_name can be configured in pyproject.toml. Other options like output_dir and component_types must be passed as CLI flags:
plating plate --output-dir docs --component-type resource
๐๏ธ Architecture
Plating follows a modular architecture:
- PlatingBundle - Represents documentation bundles
- PlatingPlater - Renders documentation
- PlatingAdorner - Creates documentation templates
- PlatingDiscovery - Finds components and bundles
- SchemaProcessor - Extracts provider schemas
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
Apache 2.0
๐ Acknowledgments
Built with โค๏ธ using:
- attrs - Python classes without boilerplate
- Jinja2 - Powerful templating
- pyvider - Terraform provider framework
- click - Command line interface
- rich - Beautiful terminal output
Plating - Making documentation as delightful as a well-plated dish ๐ฝ๏ธ
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plating-0.0.1026.tar.gz.
File metadata
- Download URL: plating-0.0.1026.tar.gz
- Upload date:
- Size: 84.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f51b924e29cccf80b7ea272e53abd9f785dc974c6ecce5e694fa48b76174bc68
|
|
| MD5 |
752e52884b66840d3238acc31cd9c113
|
|
| BLAKE2b-256 |
3663f9c40e036f2c104062d45c20be4f1ab0925e1fac72f40e17afd2917326ef
|
File details
Details for the file plating-0.0.1026-py3-none-any.whl.
File metadata
- Download URL: plating-0.0.1026-py3-none-any.whl
- Upload date:
- Size: 79.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
709a79f2e2266aae721fe15e92463d8099faffc313b2f8ae4a377d29f5941ad6
|
|
| MD5 |
1dddcd14ddca00c55b63884a244f4559
|
|
| BLAKE2b-256 |
51b15eb15500b3234b9c98bbc35590b1fbdbbac07a8126ae27a8fded07132e2f
|