Skip to main content

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 uv for 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-0 is 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:

  • .tf files for resources/data sources (flat examples)
  • .py files for Python API examples
  • Subdirectories with main.tf for 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


Download files

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

Source Distribution

plating-0.0.1026.tar.gz (84.9 kB view details)

Uploaded Source

Built Distribution

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

plating-0.0.1026-py3-none-any.whl (79.2 kB view details)

Uploaded Python 3

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

Hashes for plating-0.0.1026.tar.gz
Algorithm Hash digest
SHA256 f51b924e29cccf80b7ea272e53abd9f785dc974c6ecce5e694fa48b76174bc68
MD5 752e52884b66840d3238acc31cd9c113
BLAKE2b-256 3663f9c40e036f2c104062d45c20be4f1ab0925e1fac72f40e17afd2917326ef

See more details on using hashes here.

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

Hashes for plating-0.0.1026-py3-none-any.whl
Algorithm Hash digest
SHA256 709a79f2e2266aae721fe15e92463d8099faffc313b2f8ae4a377d29f5941ad6
MD5 1dddcd14ddca00c55b63884a244f4559
BLAKE2b-256 51b15eb15500b3234b9c98bbc35590b1fbdbbac07a8126ae27a8fded07132e2f

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