Quick Start Guide¶
Get up and running with Plating in 5 minutes.
Installation Required
If you haven't installed Plating yet, see the Installation Guide first.
Basic Usage¶
Plating follows a simple three-step workflow:
1. Adorn - Create Templates¶
Generate documentation templates for components that don't have them:
This creates .plating bundles with template files for your components.
2. Plate - Generate Documentation¶
Transform templates into Terraform Registry-compliant documentation:
3. Validate - Check Quality¶
Ensure generated documentation meets standards:
Python API Example¶
import asyncio
from pathlib import Path
from plating import Plating, PlatingContext
from plating.types import ComponentType
async def generate_docs():
# Initialize with context
context = PlatingContext(
provider_name="my_provider",
log_level="INFO"
)
# Create API instance
api = Plating(context, package_name="pyvider.components")
# Step 1: Create templates for missing documentation
adorn_result = await api.adorn(
component_types=[ComponentType.RESOURCE]
)
print(f"✅ Created {adorn_result.templates_generated} templates")
# Step 2: Generate documentation (with automatic validation)
plate_result = await api.plate(
output_dir=Path("docs"),
validate_markdown=True # Validates during generation
)
print(f"📄 Generated {plate_result.files_generated} files")
# Optional: Run standalone validation if needed
# validate_result = await api.validate(output_dir=Path("docs"))
# print(f"✓ Validation: {validate_result.passed}/{validate_result.total} passed")
return plate_result.success
# Run the async function
if __name__ == "__main__":
success = asyncio.run(generate_docs())
exit(0 if success else 1)
Bundle Structure¶
Each component gets a .plating bundle:
my_resource.plating/
├── docs/
│ └── my_resource.tmpl.md # Documentation template
├── examples/
│ └── basic.tf # Usage examples
└── fixtures/
└── data.json # Test data (optional)
Template Functions¶
In your .tmpl.md files, use these built-in functions:
# my_resource
{{ example("basic") }} <!-- Include examples/basic.tf -->
## Schema
{{ schema() }} <!-- Generate schema table -->
Next Steps¶
- Author bundles - Create custom documentation
- CLI reference - All command options
- Complete examples - Real-world usage patterns
- API reference - Full API documentation